expert forex Neural network advisor

Neural network advisor


For Councillor must install this same library. Installation and its description can be found in the paper: Using neural networks in MetaTrader (c) Mariusz Woloszyn.

in the root directory of drive C:, create a folder called "ANN", in which to store the customized neural network.

To Library joined in, you also need a terminal menu "Tools"> tab "Expert Advisors" turn on "Allow import DLL"

optimization (learning network)

optimization should be carried out when the genetic algorithm.

adviser has only two input parameters for optimization (the neural network learning):

StopLoss - level stops. Adjusts from 10 in increments of 1 to 100 for four-quotes (or 100 in increments of 10 until 1000 for the five-digit).

x - set values ??from 0 in increments of 1 to 1,000,000

In fact, in the advisor is only one parameter: StopLoss - level stops.

second parameter x - dummy (after optimizing its value has no meaning and can be set to any value). Its mission - to make a genetic algorithm to drive adviser as many sessions of training (epochs) for the optimal level of stops (the level at which it is best to teach the counselor). A genetic algorithm for optimization is still only 10,000 will cycle through the options, but most of them will have on the optimal level of stops.

Next, you need to choose a strategy tester tool (for example, EURUSD), the timeframe (eg, H1), set the "optimization" model "Open Price", configure and enable optimized parameters StopLoss and x (with the above parameters) and press the "Start".

After optimization, we get a list of the best "Optimization Results" value at which the neural network StopLoss best trained. This is the most important and should be set in the advisor for automated trading.

Testing Advisor

Choose the best option in the "Optimization Results" and the test run. Do not be surprised if the test results will be different - a neural network in optimization mode and the test is adaptive, so that after each test run are bound to be differences. After all, was another major era of learning.

Notes on forward test If

drive forward tests, it is evident that the area outside the sample on which the adviser continues to trade profitno, not very long. There are a reasonable explanation for the learning network optimizer terminal took thousands of eras - the training sessions. In test mode, adaptation occurs only at a single epoch.

Advisor is simply unable to adapt to the unsteadiness of the market, speed of learning network is too slow. It may seem that razhim adaptation in test mode to loop? No, this is impossible, since if repeatedly drive the same pattern in the training mode, the neural network learns this very pattern, but it gradually "forgets" about the remaining patterns (unlearns).

For this very reason, adaptation is only included in the optimization mode and testing. In automated trading will not work. Moreover, disabling the adaptation of automated trading carried out not only because of the fact that one era is clearly not enough training, but also because the pattern of the last transaction stored in computer memory, and therefore at shutdown or reboot the terminal is cleared and he blithely included adaptation (douchivanie ) could lead to unpredictable consequences.

There's nothing you can do, but for those who want to trade profitno, you must own every day (every day except Sunday and Monday, just after the terminal date is changed) or at least weekly to conduct pereoptimizatsiyu (pereadaptatsiyu) adviser, that he learned new patterns emerging. Optimization period for the timeframe H1 - 1 year.


In the EA model is used on the opening prices of bars. Drive in the optimization mode on other models does not make sense - a waste of time and computer resources. You can only check for lice results of the optimization model for emulation of all ticks.

Note: Some processors can accelerate the optimization process, if you include a parallel mode. To do this, in line 29 to fix:

static bool Parallel = true;

If the parallel mode is not supported by the CPU, it could lead to the terminal unloaded with an error message FREE DOWNLOAD OF NEURAL NETWORK ADVISOR

< | | >> NEXT>>

Use the contents of the site at your own risk | Satisfaction of machine translation