eddirae: Is there a way to send an alert and a Print message when the Auto Trading is turned off in an Expert Advisor? If so, where would I place the code?
- Perhaps you should read the manual.
Common Functions / Alert - Reference on algorithmic/automated trading language for MetaTrader 5 - Perhaps you should read the manual.
Checkup / TerminalInfoInteger - Reference on algorithmic/automated trading language for MetaTrader 5ENUM_TERMINAL_INFO_INTEGER
Identifier
Description
Type
TERMINAL_TRADE_ALLOWED
bool
Standard Constants, Enumerations and Structures / Environment State / Client Terminal Properties - Reference on algorithmic/automated trading language for MetaTrader 5 - Where do you think? In OnTick.
I have the Alert in the OnDeinit for when the user closes the Expert Advisor or the Chart Window for an element.
When I turn off the "Auto Trading" as the top of FOREXer, the OnDeinit does not run.
You are right!! At the beginning OnTick(), I placed the following and it keeps on alerting until the Auto Trading is turned back on.
if(!TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)) { Alert(my4CastObj.GetSymbol(),": Auto Trading is turned off!!"); Print(my4CastObj.GetSymbol(),": Auto Trading is turned off!!"); return; }
Thanks so much!!
eddirae: When I turn off the "Auto Trading" as the top of FOREXer, the OnDeinit does not run.
Of course not. Perhaps you should read the manual. Where do you see the button in the reason codes?Standard Constants, Enumerations and Structures / Named Constants / Uninitialization Reason Codes - Reference on algorithmic/automated trading language for MetaTrader 5
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
I am trying to notify users that they have turned off their Auto Trading.
Is there a way to send an alert and a Print message when the Auto Trading is turned off in an Expert Advisor? If so, where would I place the code?
Thanks!!
Eddi Rae