Arad_1: Is there any simpler way to get the candle id where a period has started?
Depends on the chart period. -
Less than H4 it is the start of a new day.
int iBOD = iBarShift(_Symbol,_Period, Date() );
Find bar of the same time one day ago - MQL4 programming forum 2017.10.06 - H4 it is the start of the week.
- D1 it is the start of the month.
- W1 it is the start of the year.
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
Is there any simpler way to get the candle id where a period has started?
i know that there is a way around it by using the Bars() function and calculating the candles from current time to the time 00:01 for one day period and then for weekly using the day of the week filter, but trying to avoid it if possible , looking for something simpler then that , if there is any ........
not looking for the exact code , just some guidance .......
thanks