Some time last year Metaquotes changed the OnDeinit reason code when switching Profiles from REASON_CHARTCLOSE to REASON_CLOSE
I can't find this documented in any of the MT5 build release notes
This means that a profile switch is now exactly the same as a Terminal close which is very odd
When the Terminal is stopped and restarted the state of every window should be restored exactly on startup
When a profile is changed the entire set of chart windows may change, so it's clearly a different operation to "Terminal Close"
Any indicator that uses ChartID() to save state in files or global variables now cannot choose to clear state on profile change (and retain state on Terminal restart)
MT4 still uses REASON_CHARTCLOSE for Profile changes and this has always worked well.
If Metaquotes wanted to make a change, then they should have created another reason code (REASON_PROFILECLOSE for instance) which would let us distinguish between Profile change and Terminal close
Does anyone know why this change was made, it's a loss of control for us and some of our users are not happy
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Some time last year Metaquotes changed the OnDeinit reason code when switching Profiles from REASON_CHARTCLOSE to REASON_CLOSE
I can't find this documented in any of the MT5 build release notes
This means that a profile switch is now exactly the same as a Terminal close which is very odd
When the Terminal is stopped and restarted the state of every window should be restored exactly on startup
When a profile is changed the entire set of chart windows may change, so it's clearly a different operation to "Terminal Close"
Any indicator that uses ChartID() to save state in files or global variables now cannot choose to clear state on profile change (and retain state on Terminal restart)
MT4 still uses REASON_CHARTCLOSE for Profile changes and this has always worked well.
If Metaquotes wanted to make a change, then they should have created another reason code (REASON_PROFILECLOSE for instance) which would let us distinguish between Profile change and Terminal close
Does anyone know why this change was made, it's a loss of control for us and some of our users are not happy