![]() ![]() ![]() Ps: To be able to run multiple EAs in parallel you may assign different magic numbers to each of them and use "symbol-magic-number" to create a namespace for GlobalVariables* or the name of a file. Restart procedure: In EA::OnInit() you restore all variables that make-up your EA's runtime state from (1) the account and from (2) external storage. ![]() ![]() You don't wait with writing until MetaTrader shuts down in a (hopefully) clean way. Regular runtime procedure: Each time a NERV in your EA changes you immediately write the change to external storage. When making a decision keep in mind that a hard server shutdown or a crashing terminal may not provide enough time to write GlobalVariables* to disk. ini file (more stable and better maintainable). You may use the terminal's GlobalVariable* functions but I recommend plain text or. After a restart you will have to restore them from the external storage. Those variables not easily to be restored (NERV) need to be stored separately and outside of the EA. You have to decide whether you can easily restore a condition by a few iCustom() calls or not.Īt the end of that separation you may have a number of internal variables you don't know how to restore easily. Restoring internal state depends on the complexity of your EA and can be anything from easy to difficult. Open the Expert Advisors tab, adjust the settings to allow for automated trading on the MT4 platform and select Allow DLL import (this one is not usually required but for some robots, it is mandatory to enable this, otherwise they will not work). External state can be easily restored from the account itself. forex stocks trading A1 Trading Forex Discord Community - Trade alerts, webinars, chatrooms:Use code YTVIP for a 5 off. The next step is to separate these state conditions into ones that can be restored from account data and the ones that cannot. Typically that's external order state (open positions, pending orders, limits) and internal EA state (variables defining trading conditions/logic). To do this as a first step you need to specify what defines the runtime state your EA. When the server/platform restarts the task is to restore the exact original state your EA has been in before the shutdown. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |