Here is an explanation about how to add arrow signals to your indicator. As you will see, it's more complicated than adding a sound alert. You have to know the base of coding, although you don't need to be an expert.
In the header of your indicator, add this :
Then after the main extern parameters, add this :Code:#property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_color2 Red
Your init iteration should look like this :Code:extern bool ArrowsSignal = true; int limit=1;int counter; double CrossUp[]; double CrossDown[]; double prevtime; double Range, AvgRange;
In your code you have to create the conditions or to identify them if they already exist. Like : if(EMA5>EM15){ alert(...Code:int init() { SetIndexStyle(0, DRAW_ARROW, EMPTY, 2); SetIndexArrow(0, 233); SetIndexBuffer(0, CrossUp); SetIndexStyle(1, DRAW_ARROW, EMPTY, 2); SetIndexArrow(1, 234); SetIndexBuffer(1, CrossDown); return(0); } int deinit() { return(0); }
After that you will be able to build the code that will say where the arrows have to be drawn :
Here is an example :
Code:for(int i=1;i<=limit;i++){ counter=i; Range=0; AvgRange=0; for (counter=i ;counter<=i+9;counter++) { AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]); } Range=AvgRange/10; if(EMA5>EMA15){if(ArrowsSignal == true)CrossUp[i] = Low[i] - Range*0.5;} if(EMA5<EMA15){if(ArrowsSignal == true)CrossDown[i] = High[i] + Range*0.5;} if ((CrossUp[0] > 2000) && (CrossDown[0] > 2000)) { prevtime = 0; } if ((CrossUp[0] == Low[0] - Range*0.5) && (prevtime != Time[0])) { prevtime = Time[0]; } if ((CrossDown[0] == High[0] + Range*0.5) && (prevtime != Time[0])) { prevtime = Time[0]; } }



Reply With Quote

