Hi. I want to get the number of days passed since a specific candle has formed up until the current day. Let us say a candle fromed on the 20 January 2020, then the current day is 23 Jan 2020, then I need an output that produces that the candle on the 20th of Jan formed 2 days ago.
- getting the time of the candles that will be formed later
- How to get the range of indices of lower time frame candles that are included in a specific higher time frame candle?
- How to see part of the prices
There are multiple possibilities
How To Ask Questions The Smart Way. 2004
Be precise and informative about your problem
- You want calendar days, including hourly fraction : (TimeCurrent() - timeCandle) / PeriodSeconds(PERIOD_D1);
- You want calendar days, ignoring fraction: (Date( timeCandle) - Date() ) / PeriodSeconds(PERIOD_D1);
- You want trading days including fraction: iBarShift(_Symbol, _Period, timeCandle) * PeriodSeconds() / PeriodSeconds(PERIOD_D1);
- You want trading days, ignoring fraction: (Date( iTime( _Symbol, _Period, iBarShift(_Symbol, _Period, timeCandle) ) - Date() ) / PeriodSeconds(PERIOD_D1);
Find bar of the same time one day ago - MQL4 programming forum 2017.10.06
Hourly fraction: 20 Jan 10:00 - 23 Jan 9:00 is two days but 20 Jan 10:00 - 23 Jan 10:00 is three.
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