Complex programing experts need only apply

 

For me this is complex programing.

I need some help with code.

what i am looking to do is have an my EA look and the LAST 3 candles on a chart and get the average price movement (either it's moving up or down at the time).

 

anybody ?

anybody? at least point me in the right direction

 
islandrock:
anybody? at least point me in the right direction

And what is the method for calculating the average? Typical price, close, etc?

 
ryanklefas:
And what is the method for calculating the average? Typical price, close, etc?

I guess he means the average of all ticks on the 3 last candles so, for the 3 last candles :

sum of all tick values / number of ticks

 

the price

the price... the price at close would be be fine or even the average prci to detirmine price rise or fall.

 

ma1=iMA(NULL,0,1,0,MODE_EMA,PRICE_MEDIAN,0);

ma2=iMA(NULL,0,1,0,MODE_EMA,PRICE_MEDIAN,3);

if (ma1>=ma2) direction=up;

else direction=dn; ?

Reason: