Switching Profiles - Reason code changed from REASON_CHARTCLOSE to REASON_CLOSE - Now no difference between a Profile switch and a Terminal restart
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
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