Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.RegressionChannel no deviation?

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

    Draw.RegressionChannel no deviation?

    When drawing a RegressionChannel on the chart, I would like to choose the standard deviation. It is an option when simply adding one to a chart but does not appear to be a parameter option for when drawing a custom one.
    Is this possible?
    Thank you

    #2
    Hello radar11,

    Thank you for your post.

    For clarification of your inquiry, is this drawing object something you created or is it modified from our System Built indicator; the Regression Channel?

    In other words, is this a self-coded Indicator?

    I look forward to your response.

    Comment


      #3
      Hello,

      I am using the System Build indicator. It's in the Draw library.
      Within my strategy I'm building, I use it like this:

      Code:
      Draw.RegressionChannel(this, last.currentBar.ToString() + "abc", CurrentBar - last.initialBar, CurrentBar - last.currentBar, Brushes.Magenta);
      This does draw the channel, however there is no way to set the standard deviation to two. I am assuming the default is set to 1.

      Comment


        #4
        Hello radar11,

        Thanks for your reply and welcome to the Ninjatrader forums!

        You are correct that the method overloads do not provide a means to specify the Standard Deviation value. There are a couple of ways to work through this:

        The regression channel drawing tool, like all drawing tools, has default settings that you can see and change when you draw it on the chart and double click to see/change the properties. By default, the standard deviation value is set to 2. You can change this if you always use the same value and want every regression channel is drawn with that value by changing it in the properties and then click "template" then "save", then "save as default". When the tool is used manually or by Ninjascript, these default settings will be used.
        Reference: https://ninjatrader.com/support/help...bjectTemplates

        If you want the ability to change the deviation(s) dynamically through ninjascript then you would need to work with the RegressionChannel interface: https://ninjatrader.com/support/help...ionchannel.htm

        I've attached an example you can apply to a chart (with real time or playback data). After the first real-time bar has closed, a channel is drawn. On each new bar, the deviation of just the lower line is incremented 0.1 to demonstrate.

        DrawRegressionChannel.zip
        Attached Files
        Last edited by NinjaTrader_PaulH; 11-25-2021, 09:21 AM. Reason: Added link to drawing tool template helpguide

        Comment

        Latest Posts

        Collapse

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