- If conditions have changed, shouldn't the EA already recompute and adjust. Fix the code.
- Not compiled, not tested
bool isDisabled = false; int init(){ int ret = MessageBox("Press Return to begin autotrading", WindowExpertName(), MB_OKCANCEL+MB_ICONQUESTION); isDisabled = (ret == IDCANCEL); } int start(){ if(isDisabled) return;
Not compiled, not tested
WHRoeder:
- If conditions have changed, shouldn't the EA already recompute and adjust. Fix the code.
- Not compiled, not tested Not compiled, not tested
Thanks WHRoeded.
The problem with option 1 is that conditions set by operator input can change. The inputs are set in the EA dialog but when MetaTrader first starts the EA just begins running with the last set of input it had. The friend using this EA doesn't think to shut down the EA before closing MT for the day.
Your option 2 is a good solution though. Simple and elegant. Thanks for that.
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
If I have a running EA and shut down MetaTrader when I restart MetaTrader the EA begins running again automatically. I can see why this would be normal behaviour but in case market conditions have changed since closing MetaTrader I want to block the automatic start and have a chance to decide to run the EA after restarting MetaTrader.
Is there a way to code my EA so that it does not run on MetaTrader start and waits for some operator action?
SpikeDog