Perceptron AI
Download scriptThis tool, known as the Perceptron AI, is designed to act as a specialized visual indicator for traders looking to simplify complex market data into clear, actionable signals. It functions by using a mathematical framework inspired by neural networks to "weigh" different historical price movements and determine their significance in real-time.
How the Logic Works
Instead of relying on a single price point or a simple moving average, the indicator analyzes several historical intervals simultaneously. Here is the step-by-step breakdown of its internal logic:
- Data Gathering: The script identifies specific historical data points (using a calculation method called "Accumulation/Distribution") across four different time offsets on your chart.
- Weighted Analysis: Each of these four data points is assigned a specific "weight" (defined by the input parameters). Think of this like a voting system: some historical moments are given more importance or "votes" than others based on their relevance to current market trends.
- The Calculation: The script multiplies each data point by its respective weight and adds them all together. This creates a cumulative score that represents the overall "momentum" or "strength" of the price action during that period.
- Binary Output: Once the final score is calculated, the indicator performs a simple logic check:
- If the combined score is positive (greater than zero), it registers a value of 1.
- If the score is zero or negative, it registers a value of 0.
Visual Representation
On your trading platform, this logic translates into a clean visual line in a separate window. By converting complex, fluctuating market data into a simple 0 or 1 binary output, the indicator helps you filter out "market noise." It provides a streamlined view of whether the current weighted conditions are leaning toward one side or the other, making it easier to identify trend shifts at a glance.
//+------------------------------------------------------------------+
//| Perceptron AI.mq4 |
//| Ibrahim Noor |
//| http://winning-solution.com/?id=baim78 |
//+------------------------------------------------------------------+
#property copyright "Ibrahim Noor"
#property link "http://winning-solution.com/?id=baim78"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
#property indicator_minimum 0
#property indicator_maximum 1
//---- input parameters
extern int x1 = 135;
extern int x2 = 127;
extern int x3 = 16;
extern int x4 = 93;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
IndicatorBuffers(1);
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexLabel(0,"Perceptron AI");
//----
IndicatorShortName("Perceptron AI");
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
double value, x, y;
for(int i=0;i<=Bars;i++){
double w1 = x1 - 100;
double w2 = x2 - 100;
double w3 = x3 - 100;
double w4 = x4 - 100;
double a1 = iAC(Symbol(), 0, i+0);
double a2 = iAC(Symbol(), 0, i+7);
double a3 = iAC(Symbol(), 0, i+14);
double a4 = iAC(Symbol(), 0, i+21);
x = w1 * a1 + w2 * a2 + w3 * a3 + w4 * a4;
if(x>0) {
value=1;
} else {
value=0;
}
ExtMapBuffer1[i]=value;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments