Neural networks programming with prorealtime

Forums ProRealTime English forum ProBuilder support Neural networks programming with prorealtime

Viewing 15 posts - 31 through 45 (of 127 total)
  • #79210
    Leo

    It will be great if some of you can help me with this project.

    I only wish I could Leo and I feel sad that only Nicolas is helping you, but you also need folks with more time than Nicolas can spare.

    Your work is ground breaking as far as most of us are concerned. I did read the reference you posted and broadly understood, but it’s the coding I struggle with.

    Tomorrow I will see if I can contact @Maz as he is a capable member who sticks in my mind as one who similarly tried to move forward with complex collaborative projects on here.

    thanks a lot, the little issue i have is m daughter is 2 weeks old 🙂

    #79227

    thanks a lot, the little issue i have is m daughter is 2 weeks old

    Oh Wow! You are a hero managing to achieve anything other than ‘survive’ … with a new precious little bundle to care for ! 🙂 Awww

    I’ve just emailed Maz as promised, his profile mentions … developing neural networks and machine-learning … so I feel sure any input from Maz will benefit this Thread.

    Cheers

     

    #79229

    Condition to BUY at line 5 was only a dummy test because of the required BUY instruction in ProBacktest. Anyway, do “GRAPH a” shows a value of 10k at first candlestick of the backtest?

    #79231
    Leo

    thanks a lot, the little issue i have is m daughter is 2 weeks old

    Oh Wow! You are a hero managing to achieve anything other than ‘survive’ … with a new precious little bundle to care for ! 🙂 Awww

    I’ve just emailed Maz as promised, his profile mentions … developing neural networks and machine-learning … so I feel sure any input from Maz will benefit this Thread.

    Cheers

    The truth is, now with a baby I feel more eager to succeed  in algorithmic trading rather that my paid-8-hours-job  🙂

    Thanks for email Maz, it will be great to get an inside opinion in this project

     

    1 user thanked author for this post.
    #79232
    Leo

    Condition to BUY at line 5 was only a dummy test because of the required BUY instruction in ProBacktest. Anyway, do “GRAPH a” shows a value of 10k at first candlestick of the backtest?

    yeah, first value to show in graph barindex is 10001.

    the condition of buying at 10000 doesn’t work but at 10001, I imagine due to the program reads the code after the first bar, then the next is in the market.

     

    #79496
    Leo

    Hi all,

    I almost complete the main body of the neural network.

    I made a modification, I don’t use a quadratic cost function but a cross-entropy cost function, and this is a very good thing because we do not have to worry about the initial values for the weights!

    Maybe someone can already complete the rest of the code and create an indicator out of it.

     

     

     

    #79502

    I think that it might be difficult for anyone to understand the whole concept of your project and the code. Could you please take some time to explain us?

    Defining what variables to inject into the neural networks is also something we should work on 😉 any idea?

    #79509
    Leo

    Hi Nicolas,

    I should be honest, is my first Neural Network. While I read about the topic I try to define for trading with prorealtime

    Basically:

    We give  4 input and get 2 outputs: the outputs are values from 0 to 1.

    output1= near to 1 and output2= near to 0  –> we go long and opposite for short ( what happend if both near to 1?  maybe open pending position maybe) , if both output near to 0 we don’t trade

    As inputs we define 4 data my ideas are: in fact, can be what ever as an input

    But first, The neural network must learn:

    so we look in the past for possible wining trades ( with the classifier) and get the values of inputs just in that moment. With and algorithm called “decent gradient” the neural network start to modifies all his values, the more data the more it learns, if data change the neural network change. The way it modify the values a11…a16, a21… a26, .. etc is for trying to find the minimums values of a cost function which measure the errors by using the partial derivates of this values (Dera11,…dera16, dera21… dera26…etc)

    Is like we make an optimisation of variable while running the code at the same time!!! The market changes, our neural network changes!!!

    Another part of the code is running again the neural network to predict and hopefully we get a winning trade.

    I will be glad if the code predicts more that 50%, If we want better predictions we need to increase the number of neurons and inputs. Or even go further like deep learning wich implicates more layer of neurons.

    Here I add again the video which inspired me,  the document that I found the easiest to follow, and the concept (attached) of the neural network which I am building

    http://neuralnetworksanddeeplearning.com/

    https://www.youtube.com/watch?v=ILsA4nyG7I0

     

    #79519
    Leo

    Hi all,

    My first neural network is working.

    I think I get hooked !

    please test it as much as possible and to see it in action in an strategy will be cool!

    Here my code and photo with some predictions

     

    6 users thanked author for this post.
    #79538

    Leo

    I found the theory and your work on it an eyeopener…

    As mentioned by Nicolas, the choice of variables is a crucial element.  Presently all your variables are correlated together as there are all issued from the price action. Why not incorporate a variable independent from the price action such as Volume ?

    Also I would try the DPO (Detrended Price Oscillator) indicator as it gives a better sense of a cycle’s typical high/low range as well as its duration.

    With these new variables you will have two momentum variables and 2 cyclic variables. Therefore the intermediate functions can be reduced from 4 to 2… This would accelerate the processing time.

    I cannot simulate it (trial version only..)

    Anyway, GREAT JOB!

     

    #79540
    Leo

    Hi didi059,

    Thanks for your motivation words.

    As input you can choose whatever, even (only in strategy) values in other timeframes.

    The initial values for the parameters, does’t matter anymore. In fact, that’s the beauty of the Neural Network: the algorithm find this values and optimise them continuously.

    Now that we implement Artificial Intelligent in ProRealTime the options are almost infinitive. Therefore, It is not possible for me to test your set of inputs.

     

    #79552

    Good input by @didi059 about Volume as an input (but still no Volumes on Forex pairs and CFD). About DPO, it uses future data in its default setting, so don’t count on it for trading systems. Anyway, thank you Leo for your last code, I’ll try to take time this week to get a better comprehension of it. I must admit that I’m still worried about the way you are using back propagation and its accuracy because of curve fitting.

    Did you try to load the indicator only until a date? To simulate a forward test of what it has learned? With an encapsulation of the code like this:

    EDIT: I know it doesn’t work like that because of learning continuously and each new signal is similar as an unique forward test, but it could be a good proof of concept.

    #79568
    Leo

    Hi Nicolas,

    Curve fitting? 43 parameters curved fitted! don’t have any doubt that is curve fitting… the thing is the code is curving fitting continuously and adapting continuously, and the more neurons the system have more and more “curve fitting packs” can be “store” in the neural network. That’s why I saw a great future for this way of working.

    But I am not naive, I know that the market will do whatever it wants and a prediction in recent data maybe is not valid.

    I do not implement the code yet in an strategy. In an strategy we can even set as input variable some other values in different time frame, for example. RSI[14] on 5 min, RSI[14] on 15 min, RSI[14] on 1 hour and RSI[14] on 4hours.

    About your opinion of the back propagation algorithm, I am not comfortable either (in line 131 I wrote “this have to be improved”). I am working in a new one.

    Let me finished the new code and then review it.

    by the way, I am not comfortable with the classifier either.

     

    #79577

    I have nearly got a System ready to post, but odd thing happened?

    I was optimising 4 variables over 100k bars (2 x TP and 2 x SL, one each for Long and Short) the Profit / result was over 6K.  I had one eye on the TV and entered 1 x TP as 100, but then realised it should have been 150.

    So just to make sure, I re-optimised on that 1 x TP only, but with value as 150 the profit was near 3K.

    Is this how the self-learning neural network is supposed to operate?? Optimise over 7000 of combinations and profit / result can work out more than  optimising over  14 combinations … even though same values are shown as optimum??

    The only explanation can be that Leo’s Neurals were self-learning and changing the variables within the neural network during the 7000 optimising combinations?? (echoes of Skynet / Terminator here … scary but exciting?? 🙂 🙂 )

    Hope above makes sense, just say or ask away if not?

    #79591
    Leo

    Hard to say GraHal,

    I would optimise hyperparameters, i.e. the parameters that control the learning algorithm like ETA… more that optimise is to find the correct one. For the data I choose as input ETA is around 0.1.

    Another parameter to be optimised is  the threshold for decision take, the output in order to predict like 0.6 or 0.7 (output is always values from 0 to 1 )

    The use of pending orders is highly recommended.

    You can also test different kind of inputs like Volume.

    Values for the classifier are irrelevant just set one combination and run.

    Test 100K should be taking ages or ?

     

    1 user thanked author for this post.
Viewing 15 posts - 31 through 45 (of 127 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login