How do you get "Date" of specific candle? For example I want to know the date of previous candles. The only solution I discovered to use the iTime() function but it's so weird to me because of it's name time, and not only you get time but including the date. I want to know if there's other way to do this task?
TimeToStr(iTime(Symbol(), Period(), x), TIME_Date);
I'm on mobile, there's no option to put code in code format.
- Date time of Previous Year
- Function to get the candle date
- How do you get price for specific bars? I want to know the fastest and best way to get value of every bars?
iTime returns a datetime, which contains both the date and the time. Remove the time and all you have left is the date.
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 and MetaTrader 4 - MQL4 programming forum
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 and MetaTrader 4 - MQL4 programming forum
whroeder1:
Don't triple post!
General rules and best pratices of the Forum. - General - MQL5 programming forumwhroeder1:
It's very different on my previous post. Date of candles and date of period separator are not same.
- Don't triple post! You already had A) Why Period Separator in 4-hr chart include 5 days of candles? and B) How do you get "Date" of specific candle?
General rules and best pratices of the Forum. - General - MQL5 programming forum - There is no "easy solution to get the date of period separator." If you're below H4 get the beginning of the day. On the H4 get the start of the week. On the WK get the start of the month, on the MN get the start of the year.
- I already gave you a link for the first.
- For the others requires higher timeframes, you must handle 4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forumIt's It's It's
- I already gave you a link for the first.
And now you combined them with a third post. They are all part of your same question.
whroeder1:
And now you combined them with a third post. They are all part of your same question.
No! They are all part of same problem with different question. I want my post to be specific, as you said on your previous comment, and other Mods said post must be clear and concise.
And now you combined them with a third post. They are all part of your same question.

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