Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week.
https://www.mql5.com/en/docs/marketinformation/symbolinfosessiontrade
- www.mql5.com
Allows receiving time of beginning and end of the specified trading sessions for a specified symbol and day of week.
https://www.mql5.com/en/docs/marketinformation/symbolinfosessiontrade
You must set the start and end time for custom symbol using the CustomSymbolSetSessionTrade() once and before backtest meaning that it is NOT possible to change end time of current session in tester mode.
Any idea how to find this end time ?
- www.mql5.com
Your answer doesn't help.
You must set the start and end time for custom symbol using the CustomSymbolSetSessionTrade() once and before backtest meaning that it is NOT possible to change end time of current session in tester mode.
Any idea how to find this end time ?
This is not an MQL question. If you are importing data from an external source it's your responsibility to collect the trading sessions start and end time and set them for the custom symbol.
So you need to get the answer from your external source.
Your answer doesn't help.
You must set the start and end time for custom symbol using the CustomSymbolSetSessionTrade() once and before backtest meaning that it is NOT possible to change end time of current session in tester mode.
Any idea how to find this end time ?
you can use that function.
compare result of that function in a csv file for couple of days to find out how session combination works.
for example may be there is start and end candle when BOTH symbols (included in your Custom Symbol) has data for that time.
then you can make a function to find sessions start and end time based on your small R&D work.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need to know the end time of each trading session to close position.
I've imported historical data into MT5, and in reality, the end time of each session is not fixed. For example some sessions end at 20:00, while others end at 21:00.
Is there a way in MQL5 to determine the current session's end time in each session?
P.S.
The SymbolInfoSessionTrade() function doesn't work here because the end hours of each session are not fixed.