Does calling the deinit() work create an EA quit? How can I make an EA bail out or quit, for inistance in case it can't connect to such or a host?
Does calling the deinit() work create an EA quit? How can I make an EA bail out or quit, for inistance in case it can't connect to such or a host?
In the start function, as the very first thingOriginally Posted by ;
if (your creteria to stop == true) return(0);
this may only stop it from doing anything past the if statement if it is true. The EA will not be removed by it from the platform.
Thank you for the answer
So if I call return(0) from init() from the startegy tester it will bail out?
You can not prevent the beginning() function from running every tick so that you must specify your own standards.
I think I get it now
No, return(0) in the init function will just transfer to the beginning() you must use it at first() to cause a loop without any instructions in the loop. The EA sits idleOriginally Posted by ;
Your test in the if ( ... ) may be a call to another function where your tests are finished. Such as
if (yourcriteria() == true) return(0);
There are most likely others that are far more talented at MT4 programing than that, however. Perhaps one of these people understand how to cause itself to be removed by the EA.
Bail from init() yes. It then goes directly to start()Originally Posted by ;
you are able to use the IsConnected() function to discover if your own mt4 is connected to the broker's server.
If you would like to know whether the EA is running on backtester, then you can use the IsTesting() function.
A good illuion of what you will put at the first couple of lines of the start() function is.
Inserted Code int start() if(IsTesting()) return(0); // ... additional codes ...
ideally this will effectively disable backtesting of the EA. Not sure you'll need that though.