I have converted my BUY/SELL Pine Script indicator into Python.
The indicator has a large number of inputs which are arranged as a neural network.
I have the historical data for back testing my indicator.
I need to adjust the inputs and the neural network weights automatically to result the highest net profit possible.
The back testing structure has already been coded, I just need a set of equations which can automatically optimize a set of inputs on command.
If the answer is more complicated that "a set of equations", then please give a general explanation of the process I have to go through.
I have only been coding for 4 months so please be nice... lol
Optimisation of neural network is performed by many methods, the simplest of which is stochastic gradient descent via backpropagation . Summarily, this is an iterative optimisation procedure that updates network parameters by subtracting a term proportional to the gradient of a loss with respect to each parameter until parameter convergence.
The best solution would be to use a framework like PyTorch or TensorFlow , which provide libraries that automatically compute these gradients and perform optimisation of neural networks for you, possibly with (very) high-level APIs like Keras that abstract away the details.
Alternatively, if the network itself is not already implemented in a language like Python in which frameworks are available, and if the network is very simple , the procedure would be to:
This alternative solution is not desirable and you should either ask for the network code (it's likely already written in such a framework.) or re-implement it yourself in PyTorch or TensorFlow.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.