Can EA inputs be changed while the EA is live or does changing the inputs stop the EA trading?

 
Can EA inputs be changed while the EA is live or does changing the inputs stop the EA trading?
 

EA can be edited while actively trading. However when you compile the script, the EA is gona restart... which may result in execution of more orders (if your EA trades straight away).

 

C

Depends what you mean by 'stop trading'

Changing extern/s (and pressing OK) on the EA properties will cause a deinit() followed by an init() and a resumption of start() if the market is open
Values of arrays and variables will need repopulating although Client Terminal global variables will stay up
To change control values on the fly, use a file or webpage to read, or terminal globals

Good Luck

-BB-

 
BarrowBoy:

C

Depends what you mean by 'stop trading'

Changing extern/s (and pressing OK) on the EA properties will cause a deinit() followed by an init() and a resumption of start() if the market is open
Values of arrays and variables will need repopulating although Client Terminal global variables will stay up
To change control values on the fly, use a file or webpage to read, or terminal globals

Good Luck

-BB-



Thank you jacob88 and BarrowBoy.

Nice detail and can you expand on changing control values on the fly using a file or webpage to read...

What I mean by "stop trading" is if the EA inputs are manually changed while the EA is actively managing an order will the EA stop managing that order.

Also, does MT4 have to be exited and restarted for the EA input change to take effect and (again) would the EA continue to work with an order it has opened before the changes and MT4 restart?

Thanks

Couta

 
couta:
Can EA inputs be changed while the EA is live or does changing the inputs stop the EA trading?
The short answer: Yes, they can.
 

C

> expand on changing control values on the fly using a file or webpage to read...

Instead of using an extern value, the EA reads a file or webpage each tick, at a new bar or time interval - the contents of file or page can change and the EA alters to suit the new values without a reload of itself

> What I mean by "stop trading" is if the EA inputs are manually changed while the EA is actively managing an order will the EA stop managing that order..?

Not unless you are storing e.g. ticket number in a volatile variable or array

If you track by MagicNumber and check the whole orders collection periodically, the EA will always track 'its' orders regardless of reloading, MT restarts, PC or VPS reboots etc

> does MT4 have to be exited and restarted for the EA input change to take effect?

No

-BB-

 

EA's must be coded to recover from problems. Changing the parameters is a simple deInit/init cycle. A power failure is a complete OS/terminal restart with NOTHING written to disk.

If the EA is properly coded, it will recover. Otherwise current open orders could be completely ignored. All depends on the coding.

Some EAs try to recover from some OrderSend errors. In my opinion this is the wrong approach. If you get No Result, you do not know if the order opened or not. If, on the next tick, you rebuild the list of open orders, then 1) you know how to recover and 2) a terminal restart is already handled.

 
Have a look as well here: https://forum.mql4.com/40548 maybe useful.