gym-forex
TheForexevirometisaforextradigsimulatorfeaturig:cofigurableiitialcapital,dyamicordataset-basedspread,CSVhistorytimeseriesfortradigcurreciesadobservatiosfortheaget,fixedoraget-cotrolledtake-profit,stop-lossadordervolume.
Theevirometfeaturesdiscreteactiospacesadoptioallycotiuousactiospacesiftheordersdothavefixedtake-profit/stop-lossadordervolume.
ObservatioSpaceAcocateatioofum_ticksvectorsforthelastest:vectorofvaluesfromtimeseries,equityaditsvariatio,order_status(-1=closed,1=opeed),time_opeed(ormalizedwithmax_order_time),order_profitaditsvariatio,order_drawdow/order_volume_pips,cosecutive_drawdow/max_cosecutive_dd
ActioSpacediscreteactio0:0=op,1=close,2=buy,3=selldiscreteactio0parameter:symbol(optioal)cotiuousactio0parameter:percet_tp,percet_sl,percet_max
RewardFuctioTherewardfuctioistheaverageoftheareauderthecurveofequityadthebalacevariatio.
MQL4DatasetGeeratorThedatasetsusedforthetestsweregeeratedwithaMQL4programlocateditheagetsfolder(Pedigdocumetatio).
IstallatioStep1-SetupDepedeciesIstallPytho,pip,OpeAIGymadotherdepedecies:
sudoapt-getistall-ypytho3-umpypytho3-devcmakezlib1g-devlibjpeg-devxvfbffmpeglibboost-all-devlibsdl2-devpytho3-pipgitgccmakeperl
pip3istallgraphvizeat-pythogitpythogymeat-pythomatplotlib
Step2-Setupgym-forexfromGitHubgitcloehttps://github.com/harveybc/gym-forex
Step3-CofiguretheNEATparametersSetthePYTHONPATHvevirometvariable,youmayaddthefollowiglietothe.profilefileiyourhomedirectorytoexportostartofsessios.Replacewithyouruserame.
exportPYTHONPATH=/home/userame/gym-forex/:${PYTHONPATH}
Step4-CofiguretheNEATparameterscdgym-forexaoagets/cofig
Cofigurethepopulatiosizeadotherparametersaccordigtoyourcomputigcapacityorrequiremets,startwiththedefaults.
Step5-Cofigureastartup/restartscriptaores
Forexample:
#!/bi/bashgitpullpytho3agets/aget_NEAT.py./datasets/ts_5mi_1w.CSV./datasets/vs_5mi_1w.CSVcofig_20
Aftereditig,chagethepermissioofthefiletobeexecutable:
chmod777res
Step6-Startyouroptimizerthatusesthegym-forexevirometadaaget../res







评论