ZeroLagStochsSignals_v1
Download scriptThis tool is a visual trading assistant designed to identify specific momentum shifts in the market by analyzing a specialized technical indicator known as the "Zero Lag Stochastic." Its primary purpose is to pinpoint potential entry points where price momentum may be changing direction, providing clear visual cues directly on your trading chart.
How the Logic Works
The script functions by monitoring the relationship between two different components of the Zero Lag Stochastic oscillator: its primary signal line and its previous historical state. Rather than just looking at the raw price, the tool focuses on "crossovers"—the moments when these internal lines intersect.
Buy Signals (Bullish Momentum) The system constantly scans the market for a specific pattern where the momentum moves from a downward trend to an upward one. Specifically, it looks for instances where:
- The previous historical value was lower than the current main signal.
- The current value has crossed above that main signal.
When this happens, the tool identifies a "Buy" opportunity. It marks this on your chart with a green arrow positioned just below the recent price candle to make it easily visible.
Sell Signals (Bearish Momentum) Conversely, the system monitors for signs that the market's upward energy is exhausting and beginning to turn downward. It looks for instances where:
- The previous historical value was higher than the current main signal.
- The current value has crossed below that main signal.
When this shift occurs, the tool identifies a "Sell" opportunity, marking the chart with a red arrow positioned just above the recent price candle.
Automated Notifications
Beyond the visual arrows on the chart, the script includes an integrated alert system. If enabled in the settings, the tool will proactively send an instant notification to your trading platform whenever a new Buy or Sell cross is detected in real-time. This allows you to stay informed of market movements even when you are not actively staring at the screen.
Key Features
- Visual Clarity: Uses distinct colors (Green for Buy, Red for Sell) and arrow symbols to differentiate between market sentiments instantly.
- Customizable Sensitivity: Includes a parameter that allows you to adjust the look-back period of the calculations to suit different trading styles (e.g., faster reactions vs. smoother trends).
- Real-Time Tracking: The logic automatically updates with every new price tick, ensuring that signals are captured as soon as the crossover occurs.
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Red
//---- input parameters
extern int a=14;
extern int alerty=0; // 0 for alerts 1 for no alerts
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double b4zls,nowzls,nowzlsmain;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW,EMPTY);
SetIndexArrow(0,233);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(1,DRAW_ARROW,EMPTY);
SetIndexArrow(1,234);
SetIndexBuffer(1, ExtMapBuffer2);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//ObjectDelete("");
//ObjectDelete("down cross");
//ObjectDelete(0,233);
//ObjectDeleteEx(0, DRAW_ARROW,0,0,0);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=1000-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=limit; i>=0; i--)
{
b4zls=iCustom(NULL,0,"ZeroLagStochs",0,i+1);
nowzls=iCustom(NULL,0,"ZeroLagStochs",0,i);
nowzlsmain=iCustom(NULL,0,"ZeroLagStochs",1,i);
if(b4zls>nowzlsmain &&
nowzls<nowzlsmain)
{
ExtMapBuffer2[i]=High[i]+7*Point;
if (alerty==0 && i<2 ) Alert(Symbol()," ",Period()," ZeroLagStochs Cross SELL");
}
if(b4zls<nowzlsmain &&
nowzls>nowzlsmain)
{
ExtMapBuffer1[i]=Low[i]-5*Point;
if (alerty==0 && i<2) Alert(Symbol()," ",Period()," ZeroLagStochs Cross BUY");
}
}
//----
return(0);
}
Comments