Why use StrToTime datetime open_time = TimeCurrent(); // Or Time[0]
Shift is always an int double shift1 = iBarShift(Symbol(),PERIOD_D1,open_time);
Play videoPlease edit your post.
For large amounts of code, attach it.- Your question is about the previous day. Shift1 will ALWAYS be zero (except on weekly/Monthly charts) So your code
double open = iOpen(Symbol(),PERIOD_D1,shift1);
ALWAYS returns TODAY's OHLC, not 'first candle in history.' How to get a time of High/Low of previous day? - MQL4 forum
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
I want to find the previous day open, high, low, close. (PERIOD_D1)
I used the code
But it returns the very first candle available in the history. How can I get the exact value. I think I'm little bit confused on Shift value.