Pine Scipt conversion – Polynomial Regression Extrapolation

Forums ProRealTime English forum ProBuilder support Pine Scipt conversion – Polynomial Regression Extrapolation

Viewing 15 posts - 1 through 15 (of 23 total)
  • #201933

    Hello, can someone please help converting this code?

    I’m aware we don’t have multidimentional Arrays in PRT yet. I suspect, we can come over by splitting into multiple Arrays.

    Thank you in advance

     

    #219832

    If you want to come over multidimentional Arrays in PRT, the solution is not to split it into multiple Arrays, because this would mean changing the code of the script each time one or both size of the multidimentional Arrays will change… which is not possible!

    In reality, coming over 2 dimensions arrays (in PRT) with only 1 dimension array is not a big deal. It has ben done for years since early stage of computer science. What you see on your screen can be compared to a 2 dimentional array (rows and columns of the screen) and it is simply stored in the memory of the computer in a one dimention array… It is possible as far as you know how much rows and columns you need to store in your 1 dimension array.

    I did the conversion of the begining of Polynomial Regression Extrapolation by LuxAlgo. You can find it below.

    The biggest deal here is to come over those built-in function for multidimentional Arrays that come with pine script.

    For example “matrix.inv” calculate the inverse of a square matrix, which is not easy to code and will require several lines of code and take long time to calculate if it is not done in a built-in function…

     

    1 user thanked author for this post.
    #219834

    @LucasBest Bravo. It’s clear, you’re talented. How can I finish translating the remaining part so that I can get the full code working? Thanks

    #219835

    I am trying to found a way to code simply the calculation of the inverse of a square matrix.

    If someone can help me to do so, it would be appreciate, because all i learned in school about matrix is very far now… 🙂

    The rest of LuxAlgo pine script will be quit easy to translate then.

    For example, in the link below the script in c++ for inverse matrix calculation…

    https://www.tutorialspoint.com/cplusplus-program-to-find-inverse-of-a-graph-matrix

     

    1 user thanked author for this post.
    #219836

    Lucas, can i suggest that you replace this inverse matrix by whatever pleases you to get over this step (for now until we find a solution) and continue the rest with an alternative option to this inverse matrix? Thanks

    #219839

    Impossible! It would be like cooking a sauerkraut without cabbage or a couscous without semolina…
    We need this matrix inversion to calculate Matrix a, then Matrix b, and everything that come after!

    #219841

    Fair enough! Bravo anyway! France has talents.

    #219846

    will require several lines of code and take long time to calculate

     

    like cooking a sauerkraut without cabbage

    The latter can be overwon by a. growing the gabbage and b. ferment it. Yes, take many months for that indeed. The semolina needs further investigation.

    #219847

    The latter can be overwon by a. growing the gabbage and b. ferment it. Yes, take many months for that indeed. The semolina needs further investigation.

    Hey Peter,

    this is funny, but it does not help me to code the inverse function of a matrix… 😉

    #219882

    Lucas, can i suggest that you replace this inverse matrix by whatever pleases you to get over this step (for now until we find a solution) and continue the rest with an alternative option to this inverse matrix? Thanks

    Ok, i did not replace, but i found a solution for calculating the inverse of the matrix, until degree 4… Now i can finish and will found a solution later for inversing bigger square matrix

    1 user thanked author for this post.
    #219918

    It is working now, but there is still some bugs…

    #219923

    With 3 and 4 degree and a different lngth… forecast can be completly different while increasing/decreasing degree or length.
    I think this kind of indicator, that repaint, and only shows what we want to see are completly useless for trading.

    #219927

    There is still some bugs/issues, but i add here the last itf i have. I will try to found the bugs later wheni will have time.

    2 users thanked author for this post.
    #219930

    Bravo Lucas. Yes, it repaints like the Center of Gravity. But anyway, bravo for having solved such a complex mathematical/coding problem. We can have separate discussion on the relevance of Indicators in general for a Retail Trader. After a few yers of observation of the Futures markets (never trader Forex), the Indicators do offer very limited success for day trading. They might be uselful on higher timeframe, but up to 30 minutes, what matters is Order Flow and Price Action, which unless you have access to sophisticated tools and an army of quants and programmers can be a huge task for a Retail Trader. The HFT Algos use the information available in the DOM to grab a few ticks and play games of manipulation and spoofing. Merci encore!

    #219955

    Hi, I tried to put it on but it doesn’ show anything. Very strange!

Viewing 15 posts - 1 through 15 (of 23 total)

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