StepMa_Stoch_SignalAlert_v1

Download script
StepMa_Stoch_SignalAlert_v1

This tool is designed to act as a visual signaling system on your trading charts, specifically designed to identify momentum shifts based on the interaction between two different technical data streams.

Core Logic and Functionality

The script functions by analyzing two distinct lines generated by an external mathematical model (the "StepMA_stoch" oscillator). It looks for specific "cross-over" events where these two lines intersect, which typically suggests a change in market sentiment or trend direction.

How the analysis works:

  • Data Tracking: The script constantly monitors three specific data points: the previous value of the first line, the current value of the first line, and the current value of the second (main) line.
  • Identifying "Sell" Signals: The logic looks for a downward crossover. If the first line was previously above the main line but has now dropped below it, the script identifies this as a bearish shift. It then places a red visual marker at the top of that price candle and triggers an audible/pop-up alert on your screen.
  • Identifying "Buy" Signals: Conversely, the logic looks for an upward crossover. If the first line was previously below the main line but has now climbed above it, the script identifies this as a bullish shift. It places a green visual marker at the bottom of that price candle and triggers a corresponding alert.

Key Features for the User

  • Visual Cues: Instead of you having to watch the lines constantly, the script draws specific arrows (markers) directly on your chart at the exact moments these crossings occur, making it easier to spot entries at a glance.
  • Real-Time Alerts: The script is programmed to notify you immediately via an alert message when a cross occurs on the most recent candles. This allows for quicker reaction times without needing to stare at the screen 24/7.
  • Customizable Sensitivity: The script includes adjustable parameters (like the "Period" and "Kwatr" values) that allow you to smooth out the data or make the signals more sensitive depending on your specific trading style and the timeframe you are viewing.

In summary, this script automates the "heavy lifting" of watching complex oscillator interactions, translating those movements into simple, actionable visual markers and alerts on your trading platform.

Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
13 Views
0 Downloads
0 Favorites
StepMa_Stoch_SignalAlert_v1
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Red
//---- input parameters
extern int PeriodWATR=10;
extern double Kwatr=1.0000;
extern int HighLow=0;
//---- 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,"StepMA_stoch_V1",PeriodWATR,Kwatr,HighLow,0,i+1);
      
   nowzls=iCustom(NULL,0,"StepMA_stoch_V1", PeriodWATR,Kwatr,HighLow,0,i);
   nowzlsmain=iCustom(NULL,0,"StepMA_Stoch_v1",PeriodWATR,Kwatr,HighLow,1,i);
 Comment(b4zls,nowzls,nowzlsmain);
 if(b4zls>=nowzlsmain &&
         nowzls<nowzlsmain)
    
          {
            ExtMapBuffer2[i]=High[i]+7*Point;
      if ( i<2 ) Alert(Symbol()," ",Period()," StepMAStochs Cross SELL");
         }
 
    if(b4zls<=nowzlsmain &&
         nowzls>nowzlsmain)
       {
            ExtMapBuffer1[i]=Low[i]-5*Point;
        if (i < 2 ) Alert(Symbol()," ",Period()," StepMAStochs Cross BUY");
       }
}
//----
return(0);
}

Comments