My own neural network
#1
Hi
I wanted to build a strategy that could learn how to adjust. 
Parameters: ADA, 3 months with 60min candles
My first step was to test tried and tested indicators. I started with Tulip, ema.
Attachment: using indicators shows market -37% but strategy did 16%

Next step was to normalize inputs. NN doesn't like 0.00000567. So I normalized to 5.67. I also made sure that all inputs were of the same power(Math) so that no input would overwhelm the algorithm.
I used a feed forward neural network with backpropagation with several hidden layers.
For training, Backtest saved a json file with the results, then it takes the roundtrip data, sees profit % (- or +) and generates training data. This way I have automated the training cycle.
Same parameters with the NN is attachment using NN.
result is 26%

This was just an early test. Going to try add/remove inputs.
I couple of things I've seen. Overfitting the neural network is definitely an issue here. If I feed it too much data, results aren't as good, plus it will behave poorly on other assets. Current version behaves ok when switching assets, but I have seen that is better to train the neural network for each asset as they have distinct behaviours.


Attached Files
.png   using indicatores and candle size.png (Size: 264.55 KB / Downloads: 25)
.png   using NN.png (Size: 271.75 KB / Downloads: 16)
  Reply
#2
I'd lover to see how you implemented a neural net (did you use tensorflow ?)
As so far most gekko NN i found are not realy properly written
I worked quite a lot with NN's but that was python and c# not jscript.
PS normally in neural networks you keep values between -1 and 1 or 0 and 1
It has to do with relu /tanh they work best within that range.
[....Resistance is futile...]
  Reply
#3
Hello,

for information : you can find different NN strategies here. 

[url= https://www.reddit.com/r/algotrading/com...with/]link for NN strats comparison[/url]
one of the best commented code is neuralNetcode
Maily they use convnetjs as framework.

We don't know the code used by Lenny and the relative framework.

Diego
  Reply
#4
(10-07-2019, 09:12 AM)Dieguz Wrote: Hello,

for information : you can find different NN strategies here. 

[url= https://www.reddit.com/r/algotrading/com...with/]link for NN strats comparison[/url]
one of the best commented code is neuralNetcode
Maily they use convnetjs as framework.

We don't know the code used by Lenny and the relative framework.

Diego

There do exist many gekko clones of neural networks like that, single neuron logic (some tanh treshold to act upon).
Those are not todays neural networks, the example has no hidden layers and only one input, compare that some average simple networks in python.
They are more close to a self regulating fuzzy logic (without making use of hiden layers, and such minimal input).
Where with tensorflow one easily creates 20 inputs, and maybe 4 hidden layers of 80 nodes to a final regression node.
Such networks find patternin input, they're deep learners, or LSTM's, or GRU's.
[....Resistance is futile...]
  Reply
#5
(10-11-2019, 08:23 AM)Dieguz Wrote: Hello,

i have found a cool CNN implementation in tensorflow.js applied to stock markets.

https://github.com/Gago993/StockPredictionCNN

i think it is a good starting point to learn how to code in Tensorflow and adapt to crypto market.

PGTART: if you feel that it is a good implementation of CNN applicable to the crypto world, i can do my experimentations to adapt it to gekko or rewrite it  for that.

Diego
  Reply


Forum Jump:


Users browsing this thread: