Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using LinReg Slope as a discriminator

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

    Using LinReg Slope as a discriminator

    I created a working LinReg MultiPlot indicator which paints the indicator green if it is rising, red if it is falling, and yellow if it is neither. Unfortunately I almost never get any yellow line segment and if I do it only lasts for one bar. I want to make the definition of rising and falling a little wider so if the LinReg line is truly not going up or down very much it would paint yellow. I decided to use slope for the discriminator but the expression for slope (which I think is valid, will not compile. Here's what I have:

    // Plot green if the LinReg is rising
    // If slope > 30 then trend is up, paint LinReg Green
    if (Slope(LinReg(Period), 5, 0) > 30)
    {
    // Connects the rising plot segment with the other plots
    RisingPlot.Set(1, LinReg(Period)[1]);

    // Adds the new rising plot line segment to the line
    RisingPlot.Set(LinReg(Period)[0]);
    }

    The code line in bold doesn't compile and I get the following message (by the way, LinRegMultiplot is the name of the new indicator I am tryng to create.

    No overload for method 'LinReg'MultiPlot' takes '1' arguments.

    I'm stumped, cany anyone help?
    Thanks
    DaveN

    #2
    Hi DaveN, can you post more of the code? Everything you posted looks like it should compile, but without a full sample, I can't say why it doesn't compile.

    If you'd like, you can email the code to support at ninjatrader dot com with Attention: Austin in the subject line.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Hi DaveN, you may have to reinstall your NinjaTrader. Let me consult with a coworker to determine the proper course of action.

      I'm pretty sure I know where the original issue lies in your indicator, but that isn't the problem anymore.
      AustinNinjaTrader Customer Service

      Comment


        #4
        I don't know where I got this but it may be what you're looking for.
        Attached Files

        Comment


          #5
          Mike, thanks for the contribution!
          AustinNinjaTrader Customer Service

          Comment


            #6
            Thanks Mike

            I really appreciate your help. It is working, though the math is a little complicated for me to follow, (I didn't do too well in geometry and radians are apparenly beyond my comprehension).
            Thanks again
            DaveN

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            574 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            332 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
            553 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            551 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X