FX_Snipers_Ergodic_CCI_Trigger_Signals
Download scriptThis script is a specialized trading tool designed to identify potential entry points in the foreign exchange market by analyzing price momentum and statistical trends. It functions as a visual signaling system, placing arrows directly on your trading chart to highlight specific moments where the market's logic shifts from one direction to another.
Core Operational Logic
The script operates by comparing two distinct data streams derived from an underlying mathematical model (the Ergodic CCI Trigger). You can think of these two streams as "Trend" and "Signal" lines:
- Comparison Mechanism: The tool constantly monitors the relationship between these two variables. When the Trend value is higher than the Signal value, it interprets the market's state as one polarity; when it falls below, it interprets the opposite.
- Crossover Detection: The primary logic triggers an alert only at the exact moment these two lines cross each other. Rather than signaling every time the price moves, it waits for a definitive "flip" in the relationship between the Trend and Signal data.
Visual Signaling System
Once the script detects a shift in momentum (a crossover), it places visual markers on the chart to guide the trader:
- Buy Signals: When the data indicates a bullish shift, the script places a specific arrow below the current price candle.
- Sell Signals: When the data indicates a bearish shift, the script places a corresponding arrow above the current price candle.
Precision and Spacing
To ensure that these signals do not appear cluttered or uncomfortably close to the price candles, the script incorporates an automatic spacing feature. It calculates the market's recent volatility (using the Average True Range) to determine exactly how far away from the "High" or "Low" of a candle it should place the arrow. This ensures that the visual cues are clear and do not overlap with the actual price action, providing a cleaner experience for the user.
Summary for the User
In simple terms, this tool acts as an automated scout. It looks at complex mathematical fluctuations in the background and translates them into simple "Up" or "Down" arrows on your screen. It tells you when the momentum has officially changed direction based on its unique "Ergodic" calculation, helping you identify potential turning points in the market.
//+----------------------------------------------------------------+
//| FX_Snipers_Ergodic_CCI_TriggerTSI Signals.mq4 |
//| modified by Linuxser for Forex-TSD |
//+----------------------------------------------------------------+
#property copyright ""
#property link ""
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_width1 1
#property indicator_width2 1
#property indicator_color1 Yellow
#property indicator_color2 Magenta
//---- input parameters
extern int pq = 2;
extern int pr = 10;
extern int ps = 5;
extern int trigger = 3;
//---- buffers
double bufferUp[];
double bufferDo[];
double bufferTr[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorBuffers(3);
SetIndexBuffer(0,bufferUp);SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,108); SetIndexLabel(0,"UpArrow");
SetIndexBuffer(1,bufferDo);SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,108); SetIndexLabel(1,"DownArrow");
SetIndexBuffer(2,bufferTr);
return(0);
}
int deinit()
{
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//
//
//
//
//
for(int i=limit; i >= 0; i--)
{
bufferUp[i] = EMPTY_VALUE;
bufferDo[i] = EMPTY_VALUE;
bufferTr[i] = bufferTr[i+1];
double curErgodic = iCustom(NULL,0,"FX_Snipers_Ergodic_CCI_Trigger",pq,pr,ps,trigger,1,i);
double curSignal = iCustom(NULL,0,"FX_Snipers_Ergodic_CCI_Trigger",pq,pr,ps,trigger,0,i);
//
//
//
//
//
if (curErgodic>curSignal) bufferTr[i] = -1;
if (curErgodic<curSignal) bufferTr[i] = 1;
if (bufferTr[i]!=bufferTr[i+1])
if (bufferTr[i]==-1) bufferDo[i]=High[i]+iATR(NULL,0,20,i);
else bufferUp[i]= Low[i]-iATR(NULL,0,20,i);
}
return(0);
}
Comments