Neuro evolution agent to buy and sell stocks atumatically
Last updated Apr 23, 2026
34
Stars
18
Forks
0
Issues
0
Stars/day
Attention Score
67
Topics
Language breakdown
Jupyter Notebook 97.2%
Python 2.8%
Dockerfile 0.0%
Shell 0.0%
▸ Files
click to expand
README
Neuro Evolution Market Trader
Neuro evolution agent to tradeIf you like this project you can support me.
It took me several experiments to get to this agent. I tried several deep learning architectures and technical analysis parameters.
Agent v 3.0141
The agent has the following characteristics:
- Using neuro evolution
- Receives OHLC as parameters
- Generates RSI and MACD technical indicators to be used as parameters
- Also run through a pretrained CNN buy and sell classifier to get the last set of parameters
Running
# Building notebook docker build -t my-notebook -f docker/Dockerfile .
Running notebook
docker run --rm -p 8888:8888 -p 6006:6006 -e JUPYTERENABLELAB=yes -v "$PWD":/home/jovyan/work my-notebook
Optional: Tensorboard
docker exec -it <container_id> /bin/bash
tensorboard --logdir work/GA/tensorboardMarketv3.0141/
Results
Right now the best agent v3.0141, the agent uses OHLC, RSI and MACD inputs, as well as the output of a pretrained CNN buy and sell classifier. The agent has these results applied to EURUSD with 30M candles:- Mean over backtest returns: 14.17%
- Points above buy and hold mean: 12.26%
- Winning Percent mean: 80%
Training
Max fitness for each generation

Mean fitness for each generation
Backtesting
2016 15M candles
2017 30M candles
2018 30M candles
RUNINFO: v3.0141 - OHLC + CNN Classifier B/S w10 15x15 + RSI&MACD
Params
- layers: 16, 32, 64, 32, 16
- population_size: 256
- generations: 100
- episodes: 10
- mutation_variance: 0.005
- survival_ratio: 0.3
- bothparentpercentage: 0.8
- oneparentpercentage: 0.1
- reward_function: SimpleProfit
- initial_cash: 5.0
- profitwindowsize: 10
- close_col: 0
- largeholdingspenalty: 0
- lostallcash_penalty: -1e2
- inaction_penalty: 0
Results
- After 100 generations
- Backtesting:
Next Steps
- [x] Develop an API
- [ ] Develop a training API
- [ ] Use socket inside API
- [ ] Develop a front end to visualize the training
🔗 More in this category
