Hi Coders, I need your help to create a simple indicator to indicate Arrows on charts as I do not have programming background.
I only know how to create a simple loop to get the 1st shift of required conditions but I do not know how to create an indicator up to a sizeable number of candles with multiple / many Arrows to be shown on charts ...
For the Arrows, it should be in colors with green (Arrow "Up", above the High) or red (Arrow "Down", below the Low).
For the input variable :-
startBar=1;
endBar=1000;
After bar 1000, no more Arrow on chart, end of loop here ....
Attachment of chart's sample picture is as below (picture's Arrows were created by myself).
Hope coders can help to provide the indicator's source codes (mq4) so that I can learn and modify the indicator in the future by myself. Lastly, kindly ensure that whenever there is a next new bar, the Arrows will move to last bar automatically (repainting), thank you.
I only know how to create a simple loop to get the 1st shift of required conditions but I do not know how to create an indicator up to a sizeable number of candles with multiple / many Arrows to be shown on charts ...
For the Arrows, it should be in colors with green (Arrow "Up", above the High) or red (Arrow "Down", below the Low).
Inserted Code
// User Input Variables extern int startBar=1; extern int endBar=1000; extern int tf=5; extern color arrowUpColor=clrLime; extern color arrowDownColor=clrRed; //+------------------------------------------------------------------+ int redSWSf=0; for(int i=startBar; i<=endBar; i++) {double Op0=iOpen(Symbol(),tf,i), Op1=iOpen(Symbol(),tf,i+1), Cs0=iClose(Symbol(),tf,i), Cs1=iClose(Symbol(),tf,i+1), MA0=iMA(Symbol(),tf,5,0,0,0,i), MA1=iMA(Symbol(),tf,5,0,0,0,i+1), MA2=iMA(Symbol(),tf,5,0,0,0,i+2), MA3=iMA(Symbol(),tf,5,0,0,0,i+3), Sto0=iStochastic(Symbol(),tf,5,3,3,0,0,0,i), Sto1=iStochastic(Symbol(),tf,5,3,3,0,0,0,i+1), WPR0=iWPR(Symbol(),tf,5,i)+100, WPR1=iWPR(Symbol(),tf,5,i+1)+100; if(Sto1<10 && WPR1<10 && (Sto0>Sto1 || WPR0>WPR1) && Op0>Cs0 && Op1>Cs1 && MA0<MA1 && MA1<MA2 && MA2<MA3) {redSWSf=i; break;}} // Chart to show Green Arrow "Up" above the High of the // red candle's shift of redSWSf //+------------------------------------------------------------------+ int grnSWSf=0; for(int i=startBar; i<=endBar; i++) {double Op0=iOpen(Symbol(),tf,i), Op1=iOpen(Symbol(),tf,i+1), Cs0=iClose(Symbol(),tf,i), Cs1=iClose(Symbol(),tf,i+1), MA0=iMA(Symbol(),tf,5,0,0,0,i), MA1=iMA(Symbol(),tf,5,0,0,0,i+1), MA2=iMA(Symbol(),tf,5,0,0,0,i+2), MA3=iMA(Symbol(),tf,5,0,0,0,i+3), Sto0=iStochastic(Symbol(),tf,5,3,3,0,0,0,i), Sto1=iStochastic(Symbol(),tf,5,3,3,0,0,0,i+1), WPR0=iWPR(Symbol(),tf,5,i)+100, WPR1=iWPR(Symbol(),tf,5,i+1)+100; if(Sto1>90 && WPR1>90 && (Sto0<Sto1 || WPR0<WPR1) && Op0<Cs0 && Op1<Cs1 && MA0>MA1 && MA1>MA2 && MA2>MA3) {grnSWSf=i; break;}} // Chart to show Red Arrow "Down" below the Low of the // Green candle's shift of grnSWSf
For the input variable :-
startBar=1;
endBar=1000;
After bar 1000, no more Arrow on chart, end of loop here ....
Attachment of chart's sample picture is as below (picture's Arrows were created by myself).
Hope coders can help to provide the indicator's source codes (mq4) so that I can learn and modify the indicator in the future by myself. Lastly, kindly ensure that whenever there is a next new bar, the Arrows will move to last bar automatically (repainting), thank you.