cdavis5766 Posted March 4, 2010 Report Share Posted March 4, 2010 Can some add an alert to this indicator. I know it has been around for a long time but it is great trend detector on 1hr and 4hr time frames. Just need alert when there is a cross of the 0 line. Please include which pair has crossed as it works good on all pairs and I run 8 charts at once thanks. #property copyright "[email protected]" //--------ang_Zad ©------------------- #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red //---------------------- extern double ki=4; //-------------------- double za[],z,za2[],z2; //******************************************************** int init(){ SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,za); SetIndexBuffer(1,za2); return(0);} //******************************************************** int start() { int i,cbi; int n,ai,bi,f,ai2,bi2,f2; cbi=Bars-IndicatorCounted()-1; //------------------------------------------------------------------------------------------------------------------------------ for(i=cbi; i>=0; i--) { if (Close>z && Close>Close[i+1]) z=za[i+1]+(Close-za[i+1])/ki; if (Close<z && Close<Close[i+1]) z=za[i+1]+(Close-za[i+1])/ki; if (Close>z2 && Close<Close[i+1]) z2=za2[i+1]+(Close-za2[i+1])/ki; if (Close<z2 && Close>Close[i+1]) z2=za2[i+1]+(Close-za2[i+1])/ki; if (i>Bars-5) {z=Close; z2=z;} za=z; za2=z2; } //------------------------------------------------------ return(0);} //******************************************************** Quote Link to comment Share on other sites More sharing options...
drbastem Posted March 4, 2010 Report Share Posted March 4, 2010 Re: (REQ) alert Ang_AZAD indicator #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red //---------------------- extern double ki=4; string SonSinyal=""; extern bool Alarm=True; //-------------------- double za[],z,za2[],z2; //******************************************************** int init(){ SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,za); SetIndexBuffer(1,za2); return(0);} //******************************************************** int start() { int i,cbi; int n,ai,bi,f,ai2,bi2,f2; cbi=Bars-IndicatorCounted()-1; //------------------------------------------------------------------------------------------------------------------------------ for(i=cbi; i>=0; i--) { if (Close>z && Close>Close[i+1]) z=za[i+1]+(Close-za[i+1])/ki; if (Close<z && Close<Close[i+1]) z=za[i+1]+(Close-za[i+1])/ki; if (Close>z2 && Close<Close[i+1]) z2=za2[i+1]+(Close-za2[i+1])/ki; if (Close<z2 && Close>Close[i+1]) z2=za2[i+1]+(Close-za2[i+1])/ki; if (i>Bars-5) {z=Close; z2=z;} za=z; za2=z2; } if (za[1]<za2[1] && Alarm && SonSinyal!="SELL") {SonSinyal="SELL";Alert(Symbol()," Period ",Period()," Ang AZAD SELL");} if (za[1]>za2[1] && Alarm && SonSinyal!="BUY") {SonSinyal="BUY";Alert(Symbol()," Period ",Period()," Ang AZAD BUY");} //------------------------------------------------------ return(0);} sohba 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.