SymbolInfoSessionTrade - session_index, - page 2

 
If I understand correctly, 

the image is just the structure I proposed, and it's filled in. Nothing terrible. 

And if there are multiple sessions, they'll simply be added. 
The filling code tries all the session numbers until it fails and moves on to the next day.
 
Gerard William G J B M Dinh Sy #:
If I understand correctly, 

the image is just the structure I proposed, and it's filled in. Nothing terrible. 

And if there are multiple sessions, they'll simply be added. 
The filling code tries all the session numbers until it fails and moves on to the next day.

okay makes sense 

 
Gerard William G J B M Dinh Sy #:
If I understand correctly, 

the image is just the structure I proposed, and it's filled in. Nothing terrible. 

And if there are multiple sessions, they'll simply be added. 
The filling code tries all the session numbers until it fails and moves on to the next day.

The question is why do you need a structure ?

What is your goal ?

Just using SymbolInfoSessionTrade() when needed is not enough ?

 
Alain Verleyen # :

The question is why do you need a structure ?

What is your goal ?

Just using SymbolInfoSessionTrade() when needed is not enough ?

Hello
It smells like a trap, but here are my arguments.

the SymbolInfoSessionTrade() function will always return the same results per day of the week.

It's almost like asking for the return of a constant.

It's better to store them when loading once and for all than to have to request them every X ticks, knowing that _a will not change....

It also seems that it is intended that these return values never change since ENUM_SYMBOL_TRADE_MODE is present

 
Gerard William G J B M Dinh Sy #:

Hello
It smells like a trap, but here are my arguments.

the SymbolInfoSessionTrade() function will always return the same results per day of the week.

It's almost like asking for the return of a constant.

It's better to store them when loading once and for all than to have to request them every X ticks, knowing that _a will not change....

It also seems that it is intended that these return values never change since ENUM_SYMBOL_TRADE_MODE is present

Clear arguments.

Though, 

1. You don't know if they will change or not. Say you start and fill your structure a Monday, with data for all the week(s), Tuesday the broker decide to change the Friday sessions. Your structure data are now outdated.

2. These data are already recorded somehow (structure or whatever) in the Terminal, believe me this function SymbolInfoSessionTrade() doesn't poll the server, so you are just creating an additional layer which you will ALSO need to check to get the needed data. Data which are possibly now outdated.

3. The code to get the information ('is a given datetime currently an a trading session ?') is very fast, executing it even every tick is not a problem in a live environment. The optimization you are trying to do is called premature optimization. I posted the needed code, somewhere in the forum, years ago.

4. With the Strategy Tester, for sure you don't want to check that function every tick, say every minute is far enough. Checking it at max every minute is trivial and doesn't need to record these data (which anyway you would need to check too), if every minute is still too often (which I doubt), you can improve that to do it every 5 minutes, every hour, whatever...still without a need to record.

Of course, you do as you want. Just want to share my experience. 

 
Alain Verleyen #:

Clear arguments.

Though, 

1. You don't know if they will change or not. Say you start and fill your structure a Monday, with data for all the week(s), Tuesday the broker decide to change the Friday sessions. Your structure data are now outdated.

2. These data are already recorded somehow (structure or whatever) in the Terminal, believe me this function SymbolInfoSessionTrade() doesn't poll the server, so you are just creating an additional layer which you will ALSO need to check to get the needed data. Data which are possibly now outdated.

3. The code to get the information ('is a given datetime currently an a trading session ?') is very fast, executing it even every tick is not a problem in a live environment. The optimization you are trying to do is called premature optimization. I posted the needed code, somewhere in the forum, years ago.

4. With the Strategy Tester, for sure you don't want to check that function every tick, say every minute is far enough. Checking it at max every minute is trivial and doesn't need to record these data (which anyway you would need to check too), if every minute is still too often (which I doubt), you can improve that to do it every 5 minutes, every hour, whatever...still without a need to record.

Of course, you do as you want. Just want to share my experience. 

how often does the terminal poll the server for a change in these structures ? if you know

(and can you whisper in their ear to force brokers -if they can- to fill up the other symbol info stuff properly ? thanks)

 
Lorentzos Roussos #:

how often does the terminal poll the server for a change in these structures ? if you know

I have no idea about that sorry. Ideally the server should notify the Terminal when something is changed rather than letting the Terminal to poll the server. Though we don't know how it works and it's hard to check. 

(and can you whisper in their ear to force brokers -if they can- to fill up the other symbol info stuff properly ? thanks)

Even MetaQuotes can't force brokers to be responsible and competent. I already read Renat (MetaQuotes CEO) complaining about that, sometimes a broker is running an outdated version of the server itself, so don't even think about the server configuration and data.

I would recommend everyone to use serious and competent brokers. If you noticed wrong data provided, ask them to fix it (an error or bug can always happen). If they do it quickly, fine, otherwise change your broker.

 
Alain Verleyen # :
Just want to share my experience. 

THANKS