DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.22k stars 2.04k forks source link

Neural genetic_backtester bugs #792

Open vea45 opened 6 years ago

vea45 commented 6 years ago

I tried the genetic backtester with the new neural strategy and during the process the simulations performed by the algorithm never performs any trade or any profit.

So I modified the 'darwin.js' file to correct a couple of things that I think was wrong: [Neural strategy] -Changed the 'momentum' and 'decay' range of values to float values between 0 and 1. -Added the '--selector' option on the runCommand (it is specified on the neural strategy).

[Backfilling] -This script didn't backfilled the data so I fixed the command order.

I attached the fixed file (in .txt...). It now performs the backtesting on neural correctly. If someone can validate my changes... Thank you! darwin.js.txt

DeviaVir commented 6 years ago

Please send a PR with the changes so we can review.

BARBARIN-Michael commented 6 years ago

Why add selector when it automaticaly set by commonArgs?

vea45 commented 6 years ago

Ok sorry I will do the PR.

Inside the "neural" strategy js module the "selector" is reincluded... so I didn't checked if it really does something important but just in case I respected it. This is a fragment of the neural strategy module (zenbot/extensions/strategies/neural/strategy.js): return { name: 'neural', description: 'Use neural learning to predict future price. Buy = mean(last 3 real prices) < mean(current & last prediction)', getOptions: function () { this.option('period', 'period length - make sure to lower your poll trades time to lower than this value', String, '1m') this.option('activation_1_type', "Neuron Activation Type: sigmoid, tanh, relu", String, 'sigmoid') this.option('neurons_1', "Neurons in layer 1 Shoot for atleast 100", Number, 1) this.option('depth', "Rows of data to predict ahead for matches/learning", Number, 5) this.option('selector', "Selector", String, 'Gdax.BTC-USD') this.option('min_periods', "Periods to calculate learn from", Number, 300) this.option('min_predict', "Periods to predict next number from", Number, 100) this.option('momentum', "momentum of prediction", Number, 0.9) this.option('decay', "decay of prediction, use teeny tiny increments", Number, 0) this.option('threads', "Number of processing threads you'd like to run (best for sim)", Number, 1) this.option('learns', "Number of times to 'learn' the neural network with past data", Number, 10) this.option('markup_pct', "Defaulting a markup percent", Number, 0.05) },