Is it possible to find the price of ask and bid say at server time: 2012.02.09 11:17:16 from history? If yes, I would appreciate your help.
- Wont work in EA
- Can there be more Bid than Ask in a tick?
- That is....Slippage ?
Thank you for your quick help.
zaffrono:
Thank you for your quick help.
Thank you for your quick help.
This is the code I just made below. Now, How can I get the Bar Number? because, after I ran this code the value I got for the shift was 0.
datetime some_time=D'2012.02.09 12:21:22'; int shift=iBarShift("EUROUSD",PERIOD_M1,some_time); Comment("shift of bar with open time ",TimeToStr(some_time)," is ",shift);
RaptorUK:
Has 12:21 on your Broker's Time Zone happened yet ?
Yes, it has happened.
Has 12:21 on your Broker's Time Zone happened yet ?
zaffrono:
Yes, it has happened.
I just found out what the problem was. In this line, Yes, it has happened.
int shift=iBarShift("EUROUSD",PERIOD_M1,some_time);I just changed it with the new one below. It works and I get the value 48. Is this value of 48 means the bar number?
int shift=iBarShift("0",PERIOD_M1,some_time);
zaffrono:
I just found out what the problem was. In this line,
I just changed it with the new one below. It works and I get the value 48. Is this value of 48 means the bar number?
I just found out what the problem was. In this line,
I just changed it with the new one below. It works and I get the value 48. Is this value of 48 means the bar number?
Yep, 48 mins ago . . . current bar is bar 0, last complete minute on an M1 chart is 1, etc
RaptorUK:
Yep, 48 mins ago . . . current bar is bar 0, last complete minute on an M1 chart is 1, etc
Now, it works fine, however, when I am using the iopen function the value of iopen is 0. Here is the code below:
datetime some_time=D'2012.02.09 12:21:22'; int shift=iBarShift(0,PERIOD_M1,some_time); double open=iOpen("0",PERIOD_M1,shift); Comment("shift of bar with open time ",TimeToStr(some_time)," is ",shift," open price=",DoubleToStr(open,5));
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register