I'm trying to develop an ea, so far I can understand and write this which will place orders when a new bar opens.
int BarsCount = 0;
if (Bars > BarsCount)
BarsCount = Bars;
how to get the highest value of standard deviation for last 2 hours to a variable?
eg: lets say the EA runs in a 30 mins chart and the bar1 has the standard deviation value 0.003, and bar2 has 0.001, bar3 has 0.004 and bar4 has 0.001. So, the highest value for past 4 hours is bar3 which has the value of 0.004, so how to get that value to a variable?
I'm trying to make the EA place orders when this formula is true "((current value of standard deviation/highest value of standard deviation for last 2 hours)*100 ) > 10"