"New Neural" is an Open Source neural network engine project for the MetaTrader 5 platform. - page 32

 
Urain:
You misunderstood a little bit.
You're the one who misunderstood :)
 
TheXpert:
You're the one who misunderstood :)
Go on, explain it to me.
 
<?xml version="1.0"?>
<NET>

  <!-- Слой входных нейронов --> 

  <LAYER CLASS="INDICATOR" NAME="IND">
    <NEURON NAME="NEURON:01.IND"> 
      <INDICATOR> IN\MAD</INDICATOR> 
      <SYMBOL> EURUSD</SYMBOL> 
      <TIMEFRAME> M15</TIMEFRAME> 
      <BUFFER> 0</BUFFER> 
      <OFFSET> 1</OFFSET> 
      <PARAM NAME="BAR_COMPLETE" TYPE="INT"> 2</PARAM> 
      <PARAM NAME="FAST_PERIOD" TYPE="INT"> 12</PARAM> 
      <PARAM NAME="SLOW_PERIOD" TYPE="INT"> 26</PARAM> 
      <PARAM NAME="APPLIED_PRICE" TYPE="APPLIED_PRICE"> PRICE_CLOSE</PARAM> 
    </NEURON> 
    <NEURON NAME="NEURON:02.IND"> 
      <INDICATOR> IN\RSI</INDICATOR> 
      <SYMBOL> EURUSD</SYMBOL> 
      <TIMEFRAME> M15</TIMEFRAME> 
      <BUFFER> 0</BUFFER> 
      <OFFSET> 1</OFFSET> 
      <PARAM NAME="PERIOD" TYPE="INT"> 3</PARAM> 
      <PARAM NAME="APPLIED_PRICE" TYPE="APPLIED_PRICE"> PRICE_CLOSE</PARAM> 
    </NEURON> 
    <NEURON NAME="NEURON:03.IND"> 
      <INDICATOR> IN\MAD</INDICATOR> 
      <SYMBOL> EURUSD</SYMBOL> 
      <TIMEFRAME> M15</TIMEFRAME> 
      <BUFFER> 0</BUFFER> 
      <OFFSET> 1</OFFSET> 
      <PARAM NAME="BAR_COMPLETE" TYPE="INT"> 2</PARAM> 
      <PARAM NAME="FAST_PERIOD" TYPE="INT"> 54</PARAM> 
      <PARAM NAME="SLOW_PERIOD" TYPE="INT"> 100</PARAM> 
      <PARAM NAME="APPLIED_PRICE" TYPE="APPLIED_PRICE"> PRICE_CLOSE</PARAM> 
    </NEURON> 
  </LAYER>

  <!-- Слой #1 нейронов на гип.тангенсе --> 

  <LAYER CLASS="TANH" NAME="HID:0"> 
    <NEURON NAME="NEURON:01.HID:0" BIAS="-0.552589"> 
      <LINK WEIGHT="0.816961" TO="NEURON:01.IND"/> 
      <LINK WEIGHT="0.653045" TO="NEURON:02.IND"/> 
      <LINK WEIGHT="0.619305" TO="NEURON:03.IND"/> 
    </NEURON> 
    <NEURON NAME="NEURON:02.HID:0" BIAS="-0.443185"> 
      <LINK WEIGHT="0.478712" TO="NEURON:01.IND"/> 
      <LINK WEIGHT="0.147732" TO="NEURON:02.IND"/> 
      <LINK WEIGHT="-0.207846" TO="NEURON:03.IND"/> 
    </NEURON> 
  </LAYER> 

  <!-- Слой #2 нейронов на гип.тангенсе --> 

  <LAYER CLASS="TANH" NAME="HID:1"> 
    <NEURON NAME="NEURON:01.HID:1" BIAS="0.390295"> 
      <LINK WEIGHT="-0.683868" TO="NEURON:01.HID:0"/> 
      <LINK WEIGHT="-0.91081" TO="NEURON:02.HID:0"/> 
    </NEURON> 
    <NEURON NAME="NEURON:02.HID:1" BIAS="0.0347438"> 
      <LINK WEIGHT="-0.00688827" TO="NEURON:01.HID:0"/> 
      <LINK WEIGHT="-0.262435" TO="NEURON:02.HID:0"/> 
    </NEURON>
  </LAYER> 

  <!-- Выходной слой нейронов на гип.тангенсе --> 
  <LAYER CLASS="TANH" NAME="OUT"> 
    <NEURON NAME="EURUSD:LOT.OUT" BIAS="0.586392"> 
      <LINK WEIGHT="-0.812841" TO="NEURON:01.HID:1"/> 
      <LINK WEIGHT="0.0548534" TO="NEURON:02.HID:1"/> 
    </NEURON> 
  </LAYER> 

</NET>

//-----------------------------------------------------------------------------
//                                  CNeuron                                   !
//-----------------------------------------------------------------------------

class CNeuron {

public:
  
  // Constructor procedures 
  
  void          CNeuron ();
  virtual void ~CNeuron ();
  
  virtual bool Init (CXmlElement *aXmlElement, CNet *aNet);
  virtual void Upload ();
  
  // Main procedures 

  virtual bool Run ();
  virtual float GetValue ();
  
};


CNeuron* CreateNeuron(string aClass) {

  CNeuron *n=NULL;
  
  if (aClass=="")           n = new CNeuron;           else
  if (aClass=="BIAS")       n = new CNeuronBias;       else
  if (aClass=="INDICATOR")  n = new CNeuronIndicator;  else 
  if (aClass=="EXTERN")     n = new CNeuronService;    else 
  if (aClass=="MSE")        n = new CNeuronMSE;        else
  if (aClass=="PROFIT")     n = new CNeuronProfit;     else
  if (aClass=="LINEAR")     n = new CNeuronLinear;     else
  if (aClass=="SIGMOID")    n = new CNeuronSigmoid;    else
  if (aClass=="TANH")       n = new CNeuronTanh;       else
  if (aClass=="SIN")        n = new CNeuronSin;        else
  if (aClass=="COS")        n = new CNeuronCos;        else
  if (aClass=="DISTANCE")   n = new CNeuronDistance;   else
  if (aClass=="WINNER")     n = new CNeuronWinner; 

  return(n);
};
 
Yu-sha:

Saving in XML is good. Is there an XML parser for MQL5?

You can't do dllki.

 
TheXpert:

Saving in XML is good. Is there an XML parser for MQL5?

You can't do that with dlls.

I did it once - there's something left over

it's "a job" for 2 days.

If you're too lazy, you can use msxml parser from the standard dll, but it is very resource intensive.

P.S.

every entity should be able to initialize / save itself from / to XML

 
yu-sha:

XML is a good idea, I support it. You can parse the grid through XSLT into canvas code and display it on the web. For example, put it into MQL5 forum engine. Uploaded the file to the comments, and the entire topology of the grid is at your fingertips.

If MQL5 had support for reg expressions, the parser would be written in half an hour.

 
Vigor:
XML is a good idea, I support it. You can parse grid into canvas code via XSLT and display it on the web. For example in MQL5 forum engine. Upload the file to the comments and the entire network topology is at your fingertips.

I did not come to this organization at once - I suffered a lot

That's why I recommend

Having xml, you can use visual editors of all sorts, you can write your own visualizers/configurators

 
Vigor:
XML is a good thing, I support it, .......

+10000.

I wish the developers made it as easy as possible to use them, without using additional DLL and Win API (or rather they hid it all in the depths of the language, and gave us the cleanest MQL).

 
yu-sha:

Each entity must be able to initialize/save itself from/to XML

It's probably better to use a factory