Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

non-linear regression, Cubic Spline and Least S

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    non-linear regression, Cubic Spline and Least S

    Hi,

    Does anyone has any of those functions below , that could share ?

    non-linear regression
    Newton Interpolation
    Cubic Spline Interpolation
    Least Squares Fitting .


    I found the lib on the link below, however, I do not know how to make those work in NT.


    http://code.google.com/p/tspl/


    Thank you so much,

    #2
    Look for a C# library not C++.

    Originally posted by cbahia View Post
    Hi,

    Does anyone has any of those functions below , that could share ?

    non-linear regression
    Newton Interpolation
    Cubic Spline Interpolation
    Least Squares Fitting .


    I found the lib on the link below, however, I do not know how to make those work in NT.


    http://code.google.com/p/tspl/


    Thank you so much,

    Comment


      #3
      Originally posted by Harry View Post
      Look for a C# library not C++.
      Hi Harry,

      Thank you, however, I am stuck, I do not know how to programming.
      Could you help to develop those indicator ?

      non-linear regression
      Newton Interpolation
      Akima Interpolation
      Kriging or Gaussian process regression
      Least Squares Fitting .

      Thank you

      Comment


        #4
        Originally posted by cbahia View Post
        Hi Harry,

        Thank you, however, I am stuck, I do not know how to programming.
        Could you help to develop those indicator ?

        non-linear regression
        Newton Interpolation
        Akima Interpolation
        Kriging or Gaussian process regression
        Least Squares Fitting .

        Thank you

        What are these indicators good for.

        I mean once you have them, what are you going to do with them?

        Comment


          #5
          Let´s say that you trade futures instrument that is very volatile like Russel 2000 or FB, you can use the Akima interpolation to clarify where the market goes, (please see.). Akima and Kriging cuts off all peek and valley like no other


          Akima interpolation at page 3


          Kriging


          Thank you for help,

          Carlos

          Comment


            #6
            Originally posted by cbahia View Post
            Let´s say that you trade futures instrument that is very volatile like Russel 2000 or FB, you can use the Akima interpolation to clarify where the market goes, (please see.). Akima and Kriging cuts off all peek and valley like no other


            Akima interpolation at page 3


            Kriging


            Thank you for help,

            Carlos
            If I understand correctly Akima interpolation is a piecewise polynomial interpolation. For predicting prices extrapolation is needed. Prices are fractal by nature, further they are subject to news releases and sudden shifts. How can you use Akima interpolation to predict prices? The only application that I can see is the interpolation of the yield curve. Is that what you look for?

            Also I do not see how I could use kriging for an indicator. Maybe the method could be used to develop a genetic optimizer for backtesting. Do you plan to develop a genetic optimizer?

            Comment


              #7
              Hi Carlos

              Just to say very quickly that I know a bit about non-linear regression, by which you mean quadratic, cubic regression, etc.

              Years ago, I was working in Excel, and worked the formulas out for myself. Just looking at quadratic regression (which is finding the best second-degree curve ( Ax^2 + Bx + C: a parabola) to fit a set of points, I rejected the idea as an indicator for trading.

              Two reasons:

              - like all moving averages, and this is a kind of MA but different in many ways, there is significant lag.

              - the best fit comes within the center of the range, never at the extremes, whereas what matters in trading, is what's happening on the extreme right of the chart (i.e. now).

              I wouldn't use it.

              Least-squares fitting is exactly the same as regression (just different words).

              I'd imagine all the others have similar drawbacks. I studied math and I know the theory behind this and why it doesn't work well in trading (in my humble opinion!).

              What I do now is stick exclusively to price action. For example, look at the LineAlert indicator, downloadable from the indicators part of this site.

              Hope it all works out.
              Last edited by arbuthnot; 12-16-2014, 03:51 PM.

              Comment


                #8
                Hi Harry,

                Yes, I would like to use Akimaand kriging to interpolation of the yield curve.
                The instrument that I am trading is so volatile.

                I am would like to test the non-linear regression and Least Squares Fitting too.

                Can you help develop those codes ?

                ThanK you so much,

                Comment


                  #9
                  Hi Arbuthnot,

                  Take a look at those links, to see how well those functions fit the points.
                  I am trading a so volatile instrument.
                  I uploaded your indicator, and did the changes for the WAF files, however, does not work using the Market Replay connection. Does only work with RT feed ?

                  One suggestion: Instead of using only sounds to give the buy/sell signal, what about we have the option to have a Arrow Up/Down ?


                  Akima interpolation at page 3
                  http://www.jive.nl/jivewiki/lib/exe/...erpolation.pdf

                  Kriging
                  http://en.wikipedia.org/wiki/Kriging

                  Could you help develop those functions that I mentioned ?

                  Any how, thank you so much for your time.

                  Carlos

                  Comment


                    #10
                    Hi again Carlos

                    It's getting very late here in the UK and I'll try my best to study your points in detail tomorrow Wednesday, when I may be without electricity for up to four hours - which won't help - because of some work being done.

                    Bring back horse-power - all is forgiven!!!

                    Cheers,

                    Ed

                    Comment


                      #11
                      Thank you Ed,

                      Good night....

                      Comment


                        #12
                        Originally posted by arbuthnot View Post
                        Hi Carlos

                        Just to say very quickly that I know a bit about non-linear regression, by which you mean quadratic, cubic regression, etc.

                        Years ago, I was working in Excel, and worked the formulas out for myself. Just looking at quadratic regression (which is finding the best second-degree curve ( Ax^2 + Bx + C: a parabola) to fit a set of points, I rejected the idea as an indicator for trading.

                        Two reasons:

                        - like all moving averages, and this is a kind of MA but different in many ways, there is significant lag.

                        - the best fit comes within the center of the range, never at the extremes, whereas what matters in trading, is what's happening on the extreme right of the chart (i.e. now).

                        I wouldn't use it.

                        Least-squares fitting is exactly the same as regression (just different words).

                        I'd imagine all the others have similar drawbacks. I studied math and I know the theory behind this and why it doesn't work well in trading (in my humble opinion!).

                        What I do now is stick exclusively to price action. For example, look at the LineAlert indicator, downloadable from the indicators part of this site.

                        Hope it all works out.
                        "Price Action" has been used so often, in so many different contexts, that to me the term has become nebulous.

                        Apart from which, a lot of folks (I am not casting aspersions at you), who claim that indicators lag, yada yada yada, then say something like: "I trade price action. When the price rises above the mid-point of the range of the last 5 candles I will go long." Guess what? That is the same as saying that: "I will go long when the 5-period Fast Stochastics line rises above 50." Yet, they will then assert with all their might, "All indicators lag, so I do not use them." LOL.

                        Comment


                          #13
                          Hi Carlos and Koganam

                          I've read both your posts with great interest.

                          I'll of course reply to both but I'd prefer to wait till the weekend as I've got some urgent coding to be done as I'd like my strategy to be fixed by the end of this week.

                          Just to say, Carlos, very briefly, that non-linear regression is almost meaningless as regards end points of a data set. The price now (the extreme right) is necessarily an end point and analysis of this type is not only useless but worse than useless, i.e. it will lead to you losing money.

                          The links you showed me were of central data but this analysis is simply not possible in real time.

                          Technically, this is because all second degree or higher polynomial equations tend to infinity* outside of the neighbourhood of their set of inflections (maxima and minima).

                          I'll try and let you have more information next time.

                          Cheers,

                          Ed

                          * more accurately, their derivatives do.
                          Last edited by arbuthnot; 12-17-2014, 03:13 PM.

                          Comment


                            #14
                            Originally posted by cbahia View Post
                            Hi,

                            Does anyone has any of those functions below , that could share ?

                            non-linear regression
                            Newton Interpolation
                            Cubic Spline Interpolation
                            Least Squares Fitting .


                            I found the lib on the link below, however, I do not know how to make those work in NT.


                            http://code.google.com/p/tspl/


                            Thank you so much,
                            I learned some of these topics in my university years (telecom major), but remember almost nothing about them now

                            Do you need an indicator or a strategy, cbahia?

                            Thanks.
                            Pi
                            ninZa
                            NinjaTrader Ecosystem Vendor - ninZa.co

                            Comment


                              #15
                              Hi NinZa,

                              Thank you so much for your kindly reply.
                              I need the indicators.

                              Thanks for help,

                              Carlos

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              571 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              331 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              549 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              549 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X