Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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]

    BertrandNinjaTrader Customer Service

    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!
            BertrandNinjaTrader Customer Service

            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 judysamnt7, 03-13-2023, 09:11 AM
                4 responses
                59 views
                0 likes
                Last Post DynamicTest  
                Started by ScottWalsh, Today, 06:52 PM
                4 responses
                36 views
                0 likes
                Last Post ScottWalsh  
                Started by olisav57, Today, 07:39 PM
                0 responses
                7 views
                0 likes
                Last Post olisav57  
                Started by trilliantrader, Today, 03:01 PM
                2 responses
                21 views
                0 likes
                Last Post helpwanted  
                Started by cre8able, Today, 07:24 PM
                0 responses
                10 views
                0 likes
                Last Post cre8able  
                Working...
                X