Laziest trading project with Neural Networks

These were some hectic months :slight_smile: No time to work on Bob (and posting).
One major update, which gave me slightly better results was the change of fitness function

  • average_realized = total_realized / num_of_trades
  • recovery_factor = average_realized / max_drawdown (how many average trades I need to get out of max draw down
  • activity = num_of_candles_in_testing / num_of_trades (how many candles I need to wait for a trade on average)

recovery factor and activity are normalized to be between 0-1
fitness function = (1-normalized_activity) * normalized_recovery_factor

This gives nice value between 0-1 where 1 is very frequent and very profitable :stuck_out_tongue:

hello, thank tou for sharing your wonderful project with everyone. I am very interested in your project because i am trying to do the same with crypto since the data is free and has the best quality i saw so far. binance data is far better than forex or futures data from Interactive broker. I tried the algo you talked about, the alphago, you can find it on github, the name is stable baseline, and the algo is ppo2. but its very slow to train so this is why i perfer using NEAT now. i still have some ovefitting problem and régularisation is not as good as I expected, but it its still way fater than ppo. I am wondering how do you normalize you fitness function, do you normalize on the past rewards or on the whole training dataset?
since you are using one hour timeframe, do you open trade all day long, or you you only trade during a certain time of the day, for example from 10am to 10pm?
do you include some stop loss to have a total control of the losing position? for exemple 1% of the account every trade.
For myself i dont like to divide the pnl from the number of trades, because the bob will try to make as few trades as possible in my opinion.

Hi, for months I have had no time at all to look at the project, so it’s on hold now :slight_smile:

I don’t limit trades in any way - 24h, no stop loss, no take profit - network decide when to open and when to close.

I have not found perfect normalization method. I tend to stay with 1H and set the boundaries manually.

  • Activity is normalized 0-1 between >480 - 0 (if on average I need to wait more than 480 candles for trade it’s scored as zero)
  • Recovery factor is normalized 0-1 between >40-0 (if I need to have more than 40 average trades to get back from max drawdown it’s scored as zero)

480 candles for 1H means around 1 trade per month for 1D. This does not translate very well between timeframes and (in my opinion) needs some manual touch to set correct value.
For recovery factor you may relate it with activity eg. “I want to get back from max dd in 800 candles the latest”, having average trade return and average frequency you can calculate your “zero point” for recovery factor normalization.

Cheers!