A quick and free library for MT4, much to the delight of neuralnetworkers - page 40

 
Roman.:


One thing you should understand is that the "basic" EA is the simplest, it serves to demonstrate the work of the library itself in general and its use as a neurofilter in particular. If you set H1, then the

training period should include "various" movements - both trend and flat (on H1, train the net from the beginning of 2008 - 31st of July 2010, When I got acquainted with the library the basic Expert Advisor was not trained at all with amount of trades < 700, maybe I was doing something wrong - I'll come back to this later. Expert Advisors in attachment modified. Try your own variants - who knows - the main thing is that the filter works, and on the forward side it shows the same results (with tolerances both in one direction and in the other), as on the training area...


Forward using nets will always lie, it's an unusual EA where everything is fixed, with every run it may show different cuts.

I have two more questions: When optimising (re-optimising, say I want to re-train it in two days), should the ANN folder be cleaned or should I train "over the top"? I just trained over the top, I have a weird optimization schedule.

Question number two: How to apply this library to any other EA and what is the result? How.

 

And what exactly are the changes? I'm not a coder, the code won't tell me anything, I just can't see the differences.

 

Why did I bother with the Magic, I just want to run a portfolio of EAs on one demo account next week and see, i.e. not each one individually, but several on one account, for that I need the Magic in all of them.

 
marker:


Forward will always lie when using nets, it is an unusual EA where everything is fixed, it may show different rez each time it is run.

I have two more questions: During optimisation (repeated, e.g. I wanted to optimise it after two days), should the ANN folder be cleared or should I teach it "over"? I just trained over the top, I have a weird optimization schedule.

Question number two: How to apply this library to any other EA and what is the result? How.


1. Clear the ANN folder when you re-train NS.

2. This library can be applied to the "similar - other" Expert Advisor as a filter, to do this, you need to change the conditions of entering trades, conditions of

Exit from a position - in the basic version, the exit is performed only by Take or Stop Loss, more detailed approach to processing of input parameters for the grid (indicator readings (in this case) - their normalization and much more - but this is the main thing ... You need to deal with these questions in detail.

As for Magic, then in the basic version of the Expert Advisor (from the article), its number is here (indicated in bold), then in the code, it changes (but this does not change the essence...).

in any case, it is unique):

// Connect FANN2MQL library
#include <Fann2MQL.mqh>

// Define global variables
#define ANN_PATH "C:\\\ANN\\"
// EA name
#define NAME "NeuroMACD"

//---- input parameters
extern double Lots=0.1;
extern double StopLoss=180.0;
extern double TakeProfit=270.0;
extern int FastMA=18;
extern int SlowMA=36;
extern int SignalMA=21;
extern double Delta=-0.6;
extern int AnnsNumber=16;
extern int AnnInputs=30;
extern bool NeuroFilter=true;
extern bool SaveAnn=false;
extern int DebugLevel=2;
extern double MinimalBalance=100;
extern bool Parallel=true;

// Global variables

// Path to the directory with neural networks
string AnnPath;

// Magic number for trade
int MagicNumber=65536;


// AnnsArray[ann#] - array of neural networks
int AnnsArray[];

// flag status of all neural networks

-----------------------------------

--------------------------------

Further, when opening a position, the Expert Advisor points to this array:

here in the code

------------------------

/* No long positions */
if(LongTicket==-1)
{
/* BUY signal */
if(BuySignal)
{
/* if NeuroFilter is set,
use neural network wisdom to decide:) */
if(!NeuroFilter || ann_wise_long()>Delta)
{
LongTicket=
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,
Bid-StopLoss*Point,
Ask+TakeProfit*Point,
NAME+"-"+"L ",MagicNumber,0,Blue);

}
/* Memorize neural network inputs */
for(i=0;i<AnnInputs;i++)
{
LongInput[i]=InputVector[i];
}
}
--------------------------------------------------------

---------------------------------------------------------

Close the positions at Take or Loss. In any case, the EA opens orders with a unique "own" magic number. If you have another variant of your EA, change the code accordingly.

In other words, you can use it in your portfolio independently of other EAs. It has a unique magician. The only thing is, of course, other EAs have to

Open and close positions according to conditions (trading criteria) only for appropriate Expert Advisors to magicians.

P.S. When trying to insert code as code, my page crashes into normal mode, so the code is displayed as text, in the attached file the Expert Advisor from the article.

Files:
 

Roman, thanks for the reply. "The only thing, of course, is for other EAs

open and close positions by conditions (trading criteria) only for appropriate Expert Advisors to magicians" - I got it, now I'm screwing magic to them :)))

 

Hm, I started to look into your Expert Advisor, I'm a bit confused, I want to overwrite it, should I set it in SaveANN - tru during optimization? What does parameter Parallel mean? DebugLevel?

 
marker:

Hm, I started to look into your Expert Advisor, I'm a bit confused, I want to overwrite it, should I set it in SaveANN - tru during optimization? What does parameter Parallel mean? DebugLevel?


Read the article - it has all the details... SaveANN - put True, Parallel - if your CPU supports parallel processing (whatever it is), then put True, otherwise - False. Please reread the article.
 

Who's interested, a demo test in three weeks.

Files:
 
marker:

Who's interested, a demo test in three weeks.


It's going beautifully, especially lately... :-)))
 

Yeah, 8 profitable deals in a row:))) But the last deal he did was really stupid, he sold at 3250 even though it was clear that there would be a stop, but I'm for the purity of the experiment:))