![]() |
EA compare yesterdays 8pm price against todays 11am price Hi guys Happy easter to you all ![]() Any skilled EA programmers out there that can help with a small query? In my EA I am trying to find out what the price was yesterday at 20:00. Then compare against the price this morning (Between 10am-12:00 midday). Inserted Code datetime yestdatetime = StrToTime(StringConcatenate(Year(),".",Month(),".", (Day() -1), ", 20:00"));
offset=iBarShift(NULL,PERIOD_M5,yestdatetime,false);
YesterdayClosePrice=iClose(NULL,PERIOD_M5,offset);
CurrentPrice=iClose("WS30",PERIOD_M5,1); Also I am struggling to find out what the high was for the morning period (Between 10am and 12midday). Any ideas? Rich |
PHP Code: |
Brill Brill, Thanks Samgmane, dont fully understand it yet but I think I am getting there. ![]() It seems to be working but still with the same problem, my backtest only goes back 11 days. As soon as I try to backtest anything but the last 11 days I get zero figures. I am backtesting the Dow Jones Index (Hence "WS30" as my symbol). I have checked and the data is there. However I am on a demo account. I have set offset as a double, could it be that I need a variable that can do larger numbers? Rich |
PHP Code: |
© Forex Factory