Questions from Beginners MQL5 MT5 MetaTrader 5 - page 393
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
CopyTime - bar open time, but what about the bar close time?
There is no separate function for this. You cannot accept the fact that the previous bar close time is the open time of the current bar in the conditions of your task?
The opening time of the current bar will also be the closing time of the previous bar.
There is no separate function for this. You cannot accept the fact that the previous bar close time is the open time of the current bar in the conditions of your problem?
We need to find the conditions that the first tick has come after the weekend. What is the best way to do it?
Do you want to catch a gap?) This should be done by the number of the day of the week. Using the MqlDatetime structure.
I.e. check if there is a new day and this day number = 1.
Do you want to catch a gap?) This should be done by the number of the day of the week. Using the MqlDatetime structure.
I.e. check that a new day is formed and this day number = 1.
But I think I found it, I will take the penultimate candle CopyOpen (15m) and compare with the opening of the last candle CopyOpen, if more than 24 H, it means it is day off.
Yes hep! :) your option is not good, because there is a broker that opens on Sunday too.
But I think I've got it, I will take the penultimate candle CopyOpen (15m) and compare with the opening of the last candle CopyOpen, if more than 24 H, it means it is weekend.
You can make it invariant, i.e. the number of day of the week, when the market opens, into an external variable and, knowing this parameter, simply change it if necessary. If you are just interested in large GEPs, you can use this indicator or similar ones in kodobase.