All Projects → harveybc → Gym Fx

harveybc / Gym Fx

Forex trading simulator environment for OpenAI Gym, observations contain the order status, performance and timeseries loaded from a CSV file containing rates and indicators. Work In Progress

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gym Fx

Hands On Reinforcement Learning With Python
Master Reinforcement and Deep Reinforcement Learning using OpenAI Gym and TensorFlow
Stars: ✭ 640 (+323.84%)
Mutual labels:  reinforcement-learning, openai-gym, q-learning, deep-q-network
Gym Anytrading
The most simple, flexible, and comprehensive OpenAI Gym trading environment (Approved by OpenAI Gym)
Stars: ✭ 627 (+315.23%)
Mutual labels:  forex, reinforcement-learning, openai-gym, q-learning
Crypto Dht
Blockchain over DHT in GO
Stars: ✭ 38 (-74.83%)
Mutual labels:  blockchain, distributed, decentralized
Coaty Js
Collaborative IoT framework in JavaScript/TypeScript for Node.js and browsers.
Stars: ✭ 39 (-74.17%)
Mutual labels:  agent, distributed, decentralized
Async Deeprl
Playing Atari games with TensorFlow implementation of Asynchronous Deep Q-Learning
Stars: ✭ 44 (-70.86%)
Mutual labels:  reinforcement-learning, openai-gym, q-learning
Particl Desktop
The GUI application for Particl Markeplace and PART coin wallet. A decentralized peer to peer marketplace –free, secure, private, untraceable.
Stars: ✭ 131 (-13.25%)
Mutual labels:  blockchain, p2p, decentralized
Subnode.org
SubNode: Social Media App
Stars: ✭ 25 (-83.44%)
Mutual labels:  blockchain, distributed, decentralized
Bitcoin Kit Ios
Full Bitcoin library for iOS, implemented on Swift. SPV wallet implementation for Bitcoin, Bitcoin Cash and Dash blockchains.
Stars: ✭ 134 (-11.26%)
Mutual labels:  blockchain, p2p, decentralized
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+4125.83%)
Mutual labels:  p2p, distributed, decentralized
Conceal Core
Conceal Core - Daemon & Wallets (CLI)
Stars: ✭ 72 (-52.32%)
Mutual labels:  blockchain, p2p, decentralized
Covenantsql
A decentralized, trusted, high performance, SQL database with blockchain features
Stars: ✭ 1,148 (+660.26%)
Mutual labels:  blockchain, p2p, decentralized
Js Dag Service
Library for storing and replicating hash-linked data over the IPFS network.
Stars: ✭ 81 (-46.36%)
Mutual labels:  p2p, distributed, decentralized
Basic reinforcement learning
An introductory series to Reinforcement Learning (RL) with comprehensive step-by-step tutorials.
Stars: ✭ 826 (+447.02%)
Mutual labels:  reinforcement-learning, openai-gym, q-learning
Reinforcement Learning With Tensorflow
Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学
Stars: ✭ 6,948 (+4501.32%)
Mutual labels:  reinforcement-learning, q-learning, deep-q-network
Enigma P2p
The Enigma Worker Peer-to-Peer (P2P) package written in Node.js based on libp2p-js
Stars: ✭ 31 (-79.47%)
Mutual labels:  blockchain, p2p, decentralized
Lbry Sdk
The LBRY SDK for building decentralized, censorship resistant, monetized, digital content apps.
Stars: ✭ 7,169 (+4647.68%)
Mutual labels:  blockchain, p2p, decentralized
Dawn
global hosting, financial automation, server-less web components
Stars: ✭ 40 (-73.51%)
Mutual labels:  blockchain, p2p, decentralized
Gym Electric Motor
Gym Electric Motor (GEM): An OpenAI Gym Environment for Electric Motors
Stars: ✭ 95 (-37.09%)
Mutual labels:  reinforcement-learning, machinelearning, openai-gym
Gym Minigrid
Minimalistic gridworld package for OpenAI Gym
Stars: ✭ 1,047 (+593.38%)
Mutual labels:  reinforcement-learning, openai-gym, agent
Clutter
Fully distributed twitter built on holochain
Stars: ✭ 84 (-44.37%)
Mutual labels:  blockchain, p2p, distributed

gym-forex

The Forex environment is a forex trading simulator featuring: configurable initial capital, dynamic or dataset-based spread, CSV history timeseries for trading currencies and observations for the agent, fixed or agent-controlled take-profit, stop-loss and order volume.

The environment features discrete action spaces and optionally continuous action spaces if the orders dont have fixed take-profit/stop-loss and order volume.

Observation Space

A concatenation of num_ticks vectors for the lastest: vector of values from timeseries, equity and its variation, order_status( -1=closed,1=opened),time_opened (normalized with max_order_time), order_profit and its variation, order_drawdown /order_volume_pips, consecutive_drawdown/max_consecutive_dd

Action Space

discrete action 0: 0=nop,1=close,2=buy,3=sell
discrete action 0 parameter: symbol
(optional) continuous action 0 parameter: percent_tp, percent_sl,percent_max

Reward Function

The reward function is the average of the area under the curve of equity and the balance variation.

MQL4 Dataset Generator

The datasets used for the tests were generated with a MQL4 program located in the agents folder (Pending documentation).

Installation

Step 1 - Setup Dependencies

Install Python, pip, OpenAI Gym and other dependencies:

sudo apt-get install -y python3-numpy python3-dev cmake zlib1g-dev libjpeg-dev xvfb ffmpeg libboost-all-dev libsdl2-dev python3-pip git gcc make perl

pip3 install graphviz neat-python gitpython gym neat-python matplotlib

Step 2 - Setup gym-forex from GitHub

git clone https://github.com/harveybc/gym-forex

Step 3 - Configure the NEAT parameters

Set the PYTHONPATH venvironment variable, you may add the following line to the .profile file in your home directory to export on start of sessions. Replace with your username.

export PYTHONPATH=/home/username/gym-forex/:${PYTHONPATH}

Step 4 - Configure the NEAT parameters

cd gym-forex
nano agents/config

Configure the population size and other parameters according to your computing capacity or requirements, start with the defaults.

Step 5 - Configure a startup/restart script

nano res

For example:

#!/bin/bash
git pull
python3 agents/agent_NEAT.py ./datasets/ts_5min_1w.CSV ./datasets/vs_5min_1w.CSV config_20

After editing, change the permission of the file to be executable:

chmod 777 res

Step 6 - Start your optimizer that uses the gym-forex environment and an agent.

./res

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].