PDA

View Full Version : How to completely re-start EA within code



polichopk
05-06-2010 14:17, 02:17 PM
What code can I put. . Like reload EVERYTHING...

Reload the externs , init()and start() works .... Aswell as reload the chart...


Thank you very far

vimginay
12-13-2021 09:18, 09:18 AM
You can reload the chart together with Sendkeys - will have to visit another symbol or timeframe, then back that in itself will hit the EA and reset all of the factors.
Ps: There is example code in codebase for it.

ebb95
12-13-2021 10:39, 10:39 AM
Its not simple before trying consider that you may fail.

The best way to go about this would be to modularize your code. That means that every item is a separate function. So the Init() code will be in a separate function and all of the logic in the Start() function could be broken up into several functions. You need to consider the way to reinitialize all variables, which normally start off set to zero, when this is working. I might have forgotten something, so that there might be something else. Then there is lots of testing.

No guarantee this will work, but its how I'd tackle the issue and I'd only tackle it if there was some compelling reason to do so.

Azcamale
12-13-2021 12:00, 12:00 PM
I'd put externs into init() to reset, then call init() from beginning() whenever wanted.

Azcamale
12-13-2021 13:21, 01:21 PM
I tell you for sure what you have to do:
Press Compile button.