Changing the External Parameters of MQL4 Programs without Restarting

Nov 24th, 2009 | Filed under MetaTrader General News

Anybody who has ever launched an EA or an indicator for execution, faced the possibility to preliminarily set up external parameters that often underlay the success of the program. There is a possibility to change parameters during the program operation. But how can that be done without initialization? In some cases, this may affect managing the previously opened orders. In this article, we try to solve this problem as flexibly as possible.

Problem Statement

We will consider this problem for Expert Advisors rather than for indicators. For indicators, this problem is not so acute, although the methods are universal and you can apply them to any programs.

In the classical EA writing, the context must be created at every tick. There can be two kinds of contexts – the context of status and trading context. The context of status contains the current states of indicators and other elements underlying the decision making on opening/closing/modifying orders. Trading context contains the information about open orders, their statuses and quantities. After trading context has been analyzed, traders make decisions about what to do with their orders. Contexts are divided by types conditionally. This classification has been introduced for convenience.

To read the full article, please visit: http://articles.mql4.com/724

Related posts:

  1. MetaTrader 5 – Migrating from MQL4 to MQL5
  2. Working with Doubles in MQL4
  3. MetaTrader 5 – Guide to Using Technical Indicators in Expert Advisors
  4. MQL4 for Dummies
  5. What Is Automated Trading

Comments are closed.