匿名用户2021年11月11日
110阅读

技术信息

授权协议
Readme

作品详情

gym-forex

TheForexevirometisaforextradigsimulatorfeaturig:cofigurableiitialcapital,dyamicordataset-basedspread,CSVhistorytimeseriesfortradigcurreciesadobservatiosfortheaget,fixedoraget-cotrolledtake-profit,stop-lossadordervolume.

Theevirometfeaturesdiscreteactiospacesadoptioallycotiuousactiospacesiftheordersdothavefixedtake-profit/stop-lossadordervolume.

ObservatioSpace

Acocateatioofum_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

ActioSpace

discreteactio0:0=op,1=close,2=buy,3=selldiscreteactio0parameter:symbol(optioal)cotiuousactio0parameter:percet_tp,percet_sl,percet_max

RewardFuctio

Therewardfuctioistheaverageoftheareauderthecurveofequityadthebalacevariatio.

MQL4DatasetGeerator

ThedatasetsusedforthetestsweregeeratedwithaMQL4programlocateditheagetsfolder(Pedigdocumetatio).

IstallatioStep1-SetupDepedecies

IstallPytho,pip,OpeAIGymadotherdepedecies:

sudoapt-getistall-ypytho3-umpypytho3-devcmakezlib1g-devlibjpeg-devxvfbffmpeglibboost-all-devlibsdl2-devpytho3-pipgitgccmakeperl

pip3istallgraphvizeat-pythogitpythogymeat-pythomatplotlib

Step2-Setupgym-forexfromGitHub

gitcloehttps://github.com/harveybc/gym-forex

Step3-CofiguretheNEATparameters

SetthePYTHONPATHvevirometvariable,youmayaddthefollowiglietothe.profilefileiyourhomedirectorytoexportostartofsessios.Replacewithyouruserame.

exportPYTHONPATH=/home/userame/gym-forex/:${PYTHONPATH}

Step4-CofiguretheNEATparameters

cdgym-forexaoagets/cofig

Cofigurethepopulatiosizeadotherparametersaccordigtoyourcomputigcapacityorrequiremets,startwiththedefaults.

Step5-Cofigureastartup/restartscript

aores

Forexample:

#!/bi/bashgitpullpytho3agets/aget_NEAT.py./datasets/ts_5mi_1w.CSV./datasets/vs_5mi_1w.CSVcofig_20

Aftereditig,chagethepermissioofthefiletobeexecutable:

chmod777res

Step6-Startyouroptimizerthatusesthegym-forexevirometadaaget.

./res

功能介绍

gym-forex The Forex environment is a forex trading simulator featuring: configurable initial capi...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论