How to code this strategy ?

 

As the image attached.

Buy on lowest of each candle, and sell on highest of each candle. 

Files:
AudCad.png  27 kb
 
abu520:

As the image attached.

Buy on lowest of each candle, and sell on highest of each candle. 

Okey than tell me please, how do we know if a live candle is at the high? You do only know at the time when the candle closed. If you solved this riddle you made the holy grail :)
 
Bernhard Schweigert:
Okey than tell me please, how do we know if a live candle is at the high? You do only know at the time when the candle closed. If you solved this riddle you made the holy grail :)
CurHighestMax = high[ArrayMaximum (high, i, 0)];
CurLowestMin = low[ArrayMinimum (low, i, 0)];

isnt this ??

 

just lose big on manual trade,  would like to try auto trading. 

Reason: