Errors, bugs, questions - page 1868
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
build 1589
How to make OnTimer in an indicator stop working when the account/broker changes, if it does not have such a ticker, or it is not added to market overview, without using IndicatorDelete?
Errata in the documentation - there is no IndicatorDelete function, there is ChartIndicatorDelete!
https://www.mql5.com/ru/docs/standardlibrary/cchart/cchartindicatordelete
The situation is as follows - I run the attached indicator on the futures. I switch to another broker, but the timer keeps ticking, although the chart becomes black and does not update.
it does not write the reason for deinitialization
REASON_ACCOUNT
6
Another account has been activated or reconnection to the trade server due to a change in account settings
build 1589
OnDeinit is not called.
What do you mean? Not called at all, or in this code?
build 1589
How to make OnTimer in an indicator stop working when the account/broker changes, if it does not have such a ticker, or it is not added to market overview, without using IndicatorDelete?
Errata in the documentation - there is no IndicatorDelete function, there is ChartIndicatorDelete!
https://www.mql5.com/ru/docs/standardlibrary/cchart/cchartindicatordelete
The situation is as follows - I run the attached indicator on the futures. I switch to another broker, but the timer keeps ticking, although the chart becomes black and does not update.
it does not write the reason for deinitialization
REASON_ACCOUNT
6
Another account is activated or reconnection to a trade server was caused by a change in the account settings
Loading and unloading of indicators
Indicators are uploaded in the following cases
Indicators are unloaded in the following cases
The reason "change of account" does not exist, it means that the indicator is not unloaded at account switching and consequently OnDeinit() for the indicator, when you change the trading account won't be either.
What do you mean? Not called at all, or in this code?
Loading and unloading indicators
Indicators are unloaded in the following cases
The reason "account switch" does not exist, it means that the indicator is not unloaded at account switching and consequently there will be no OnDeinit() for the indicator when you change the trading account.
In fact, the reason I mentioned works only for Expert Advisors.
Then the question remains - how to make the timer stop working without radically removing the indicator from the chart?
In fact, the reason I mentioned only works for experts
Then the question remains - how to get the timer to stop working without drastically removing the indicator from the chart?
In OnInit() memorize the score. In the timer check the account number. If the score has changed - exit the timer.
Then the question remains - how do you get the timer to stop working without drastically removing the indicator from the chart?
don't you think that's a crooked solution?!
suppose we doACCOUNT_LOGIN!=ACCOUNT_LOGIN_NEW, kill the timer, and then go back to this account, what happens? the timer will not start again?
it is easier to add the reason "change of account" to the indicators in the same way, or am i wrong in some way and it will lead to some difficulties?
you have to admit, it's a crooked solution?!
It's a horse move!
Suppose we doACCOUNT_LOGIN!=ACCOUNT_LOGIN_NEW, kill the timer, and then go back to that count, what happens?
When an account change is detected, you remember the new characteristics already.
You can design it as a small library on the principle that here(macros). Then the "crooked" stuff won't be a nuisance.