The idea and the simplest algorithm are provided in the articleΒ “
The library has advanced functionality allowing you to create an unlimited number of “Agents”.
In addition, variations of the “
Using the library:
#include <RL gmdh.mqh> CRLAgents *ag1=new CRLAgents("RlExp1iter",1,100,50,regularize,learn); //created 1 RL agent accepting 100 entries (predictor values) and containing 50 trees
An example of filling input values ββwith normalized close prices:
void calcSignal() Β Β { Β Β sig1=0; Β Β double arr[]; Β Β CopyClose(NULL,0,1,10000,arr); Β Β ArraySetAsSeries(arr,true); Β Β normalizeArrays(arr); Β Β for(int i=0;i<ArraySize(ag1.agent);i++) Β Β Β Β {Β Β Β Β Β Β Β Β ArrayCopy(ag1.agent[i].inpVector,arr,0,0,ArraySize(ag1.agent[i].inpVector)); Β Β Β Β } Β Β sig1=ag1.getTradeSignal(); Β Β }
Training takes place in the tester in one pass with the parameter learn=true. After training, we need to change it to false.
Demonstrating the trained “RL gmdh trader” EA operation on training and test samples.