Reading bid ask from previous bars.

 

Hi there,

Does anyone know how to code an EA that returns the value of what the bid/ask price was X amount of bars back ?

Thank you !

 

no chance for exact Ask price. since that data is not stored.

if you want the Bid Price for x Bars in the back you can use Open[x] if you want a aproximate Ask Price you can use Open[x]+(MarketInfo(Symbol(),MODE_SPREAD)*Point)

 
zzuegg:

no chance for exact Ask price. since that data is not stored.

if you want the Bid Price for x Bars in the back you can use Open[x] if you want a aproximate Ask Price you can use Open[x]+(MarketInfo(Symbol(),MODE_SPREAD)*Point)


Thanx.. That will do :)

Is there a way I can do this for multiple time frames ? Like open[x] for 5 min open[x] for 15 mins...

Thank you! :)

 
use IOpen(Symbol(),Period_M1,x);
Reason: