Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Linear Regression Forecast (LRF)

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

    Linear Regression Forecast (LRF)

    Has anyone seen an Indicator on NT that use a regression on a moving average, typically titled as LRF?

    LRF = Regression(MA(PRICE, Z), X) + Slope * Y

    where
    Z = MA period
    X = Regression Period
    Y = Forecast Period (optional)
    Slope = Slope of the regression line

    #2
    Hi CRCatNinja, I'm not aware of this for NinjaTrader already. But you can easily create this by feeding the MA into the Linear Regression as input -
    Code:
    [SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]double[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2] myLRF = LinReg(SMA(Close, [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]20[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]), [/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]20[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2])[[/SIZE][/SIZE][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][SIZE=2]];[/SIZE][/SIZE]
    [SIZE=2][SIZE=2][/SIZE][/SIZE]

    Comment


      #3
      Thank you, Bertrand!

      Comment


        #4
        For those of us that don't know how to code, could some nice person post the completed code after they modify it. It would be greatly appreciated.

        Comment


          #5
          Dandxg

          Here you go.

          Edit - please see above updated version
          Attached Files
          Last edited by Mindset; 04-08-2009, 04:56 AM. Reason: Newer version info

          Comment


            #6
            Thanks for sharing Mindset!

            Comment


              #7
              Tidied up version

              Rushed it a little and left a rogue dataseries in there.
              Now removed.
              Attached Files

              Comment


                #8
                Thank you Mind.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by cmoran13, 04-16-2026, 01:02 PM
                0 responses
                43 views
                0 likes
                Last Post cmoran13  
                Started by PaulMohn, 04-10-2026, 11:11 AM
                0 responses
                25 views
                0 likes
                Last Post PaulMohn  
                Started by CarlTrading, 03-31-2026, 09:41 PM
                1 response
                163 views
                1 like
                Last Post NinjaTrader_ChelseaB  
                Started by CarlTrading, 04-01-2026, 02:41 AM
                0 responses
                98 views
                1 like
                Last Post CarlTrading  
                Started by CaptainJack, 03-31-2026, 11:44 PM
                0 responses
                158 views
                2 likes
                Last Post CaptainJack  
                Working...
                X