All Projects → hugocen → freqtrade-gym

hugocen / freqtrade-gym

Licence: GPL-3.0 license
A customized gym environment for developing and comparing reinforcement learning algorithms in crypto trading.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to freqtrade-gym

Algotrading
Algorithmic trading framework for cryptocurrencies.
Stars: ✭ 249 (+29.69%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Gtrader
a trading strategy trainer, back-tester and bot
Stars: ✭ 71 (-63.02%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Tai
A composable, real time, market data and trade execution toolkit. Built with Elixir, runs on the Erlang virtual machine
Stars: ✭ 264 (+37.5%)
Mutual labels:  trading, trading-bot, algorithmic-trading
AutoTrader
A Python-based development platform for automated trading systems - from backtesting to optimisation to livetrading.
Stars: ✭ 227 (+18.23%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Turingtrader
The Open-Source Backtesting Engine/ Market Simulator by Bertram Solutions.
Stars: ✭ 132 (-31.25%)
Mutual labels:  trading, trading-bot, algorithmic-trading
MoniGoMani
Isn't that what we all want? Our money to go many? Well that's what this framework/strategy hopes to do for you! By giving you & HyperOpt a lot of signals to alter the weights from.
Stars: ✭ 868 (+352.08%)
Mutual labels:  trading, trading-bot, freqtrade
Jesse
An advanced crypto trading bot written in Python
Stars: ✭ 1,038 (+440.63%)
Mutual labels:  trading, trading-bot, algorithmic-trading
51bitquant
51bitquant Python数字货币量化交易视频 CCXT框架 爬取交易所数据 比特币量化交易 交易机器人51bitquant tradingbot cryptocurrency quantitative trading btc trading
Stars: ✭ 284 (+47.92%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Pytrendfollow
PyTrendFollow - systematic futures trading using trend following
Stars: ✭ 127 (-33.85%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Aat
Asynchronous, event-driven algorithmic trading in Python and C++
Stars: ✭ 109 (-43.23%)
Mutual labels:  trading, trading-bot, algorithmic-trading
sdoosa-algo-trade-python
Algo trade project in python
Stars: ✭ 320 (+66.67%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Socktrader
🚀 Websocket based trading bot for 💰cryptocurrencies 📈
Stars: ✭ 152 (-20.83%)
Mutual labels:  trading, trading-bot, algorithmic-trading
quick trade
convenient script for trading with python.
Stars: ✭ 63 (-67.19%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Crypto Signal
Github.com/CryptoSignal - #1 Quant Trading & Technical Analysis Bot - 3,100+ stars, 900+ forks
Stars: ✭ 3,690 (+1821.88%)
Mutual labels:  trading, trading-bot, algorithmic-trading
roq-samples
How to use the Roq C++20 API for Live Cryptocurrency Algorithmic and High-Frequency Trading as well as for Back-Testing and Historical Simulation
Stars: ✭ 119 (-38.02%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Quant
Codera Quant is a Java framework for algorithmic trading strategies development, execution and backtesting via Interactive Brokers TWS API or other brokers API
Stars: ✭ 104 (-45.83%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Roq Api
API for algorithmic and high-frequency trading
Stars: ✭ 132 (-31.25%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (-0.52%)
Mutual labels:  trading, trading-bot, algorithmic-trading
Crypto Trading Bot
Automated Bittrex crypto-currency technical analysis and trading tool
Stars: ✭ 251 (+30.73%)
Mutual labels:  trading, trading-bot
Cryptotrader
A cryptocurrency trader for all famous exchanges
Stars: ✭ 228 (+18.75%)
Mutual labels:  trading, trading-bot

freqtrade-gym

This project is base on freqtrade

The project is in very early stage, so there are a lot of inconvenient part that you have to set up manually. I am working on the improvements.

Installation

1. freqtrade

Follow the freqtrade documentation to install freqtrade

Initialize the user_directory

freqtrade create-userdir --userdir user_data/

2. Pandas

pip install pandas

3. OpenAI Gym

pip install gym

4. Copy freqtrade-gym files

Baseline files

IndicatorforRL.py -> [freqtrade home]/user_data/strategies/IndicatorforRL.py
config_rl.json -> [freqtrade home]/config_rl.json
freqtradegym.py -> [freqtrade home]/freqtradegym.py
deep_rl.py -> [freqtrade home]/deep_rl.py

RLib

Copy first the baseline files.
LoadRLModel.py -> [freqtrade home]/user_data/strategies/LoadRLModel.py
rllib_example.py -> [freqtrade home]/rllib_example.py

Example Usage (baseline)

The usage example is deep_rl.py and the config for freqtrade and freqtrade-gym is config_rl.json and uses IndicatorforRL.py as feature extraction.
This demo is using openai baseline library to train reinforcement learning agents.
Baseline can install by

sudo apt-get update && sudo apt-get install cmake libopenmpi-dev python3-dev zlib1g-dev
pip install stable-baselines[mpi]

Download historical data
(Remember to download a little bit more data than the timerange in config file just in case.)

freqtrade download-data -c <config file> --days <Int> -t {1m,3m,5m...}

To match the example config_rl.json

freqtrade download-data -c config_rl.json --timerange 20201119-20201201 -t 15m

Move the IndicatorforRL.py into user_data/strategies (you should have user_data/strategies/IndicatorforRL.py)

Run the demo to train an agent.

python deep_rl.py

You can use tensorboard to monior the training process
logdir is defined in deep_rl.py when initializing the rl model

tensorboard --logdir <logdir>

This will look like
alt tensorboard

Example Usage (RLlib)

The usage example is rllib_example.py and the config for freqtrade and freqtrade-gym is config_rl.json and uses IndicatorforRL.py as feature extraction.
This demo is using RLlib to train reinforcement learning agents.
Baseline can install by

pip install 'ray[rllib]'

Run the demo to train an agent.

python rllib_example.py

Example of Loading model for backtesting or trading (baseline)

Move the LoadRLModel.py into user_data/strategies (you should have user_data/strategies/LoadRLModel.py)

Modified the class intial load model part to your model type and path.

Modified the populate_indicators and rl_model_redict method for your gym settings.

Run the backtesting

freqtrade backtesting -c config_rl.json -s LoadRLModel

Dry-run trading (remove --dry-run for real deal!)

freqtrade trade --dry-run -c config_rl.json -s LoadRLModelgProto

TODO

  • Update the strategy for loadinf the trained model for backtesting and real trading. (baseline)
  • The features name and total feature number(freqtradegym.py line 89) have to manually match in the indicator strategy and in freqtradegym. I would like to come up with a way to set up features in config file.
  • RLlib example.
  • Update the strategy for loadinf the trained model for backtesting and real trading (RLlib).
  • NEAT example.

DISCLAIMER

This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS.

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].