fx2013: I have noticed something it is weird to me. I made an EA and attached to the chart and run as good as i want, but when i change the timeframe to an other on the same chart, the EA start up its functions again. I know when the EA removed from chart, EA calls Deinit() function, but in this case i noticed, when changing from timeframe to an other, the EA calls Deinit() function and calls Start() function again. So how to solve this problem in the new versions of MetaTrader platforms?
It goes through de-init, init and start_once. The best solution depends on your problem which isn't clear to me. If you have global variables which are being compounded in init (for example) here. Then you'll need to modify your codes accordingly by either using functions which doesn't depend on static/global variables. Or identify when the terminal goes through de-init and ignore stuff.
fx2013:
Don't change timeframe on a chart with an EA on it. Open a second chart for the same symbol and change timeframes on that chart.
Hello
I have noticed something it is weird to me. I made an EA and attached to the chart and run as good as i want, but when i change the timeframe to an other on the same chart, the EA start up its functions again. I know when the EA removed from chart, EA calls Deinit() function, but in this case i noticed, when changing from timeframe to an other, the EA calls Deinit() function and calls Start() function again. So how to solve this problem in the new versions of MetaTrader platforms?
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
Hello
I have noticed something it is weird to me. I made an EA and attached to the chart and run as good as i want, but when i change the timeframe to an other on the same chart, the EA start up its functions again. I know when the EA removed from chart, EA calls Deinit() function, but in this case i noticed, when changing from timeframe to an other, the EA calls Deinit() function and calls Start() function again. So how to solve this problem in the new versions of MetaTrader platforms?