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.