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

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, 08:21 AM. Reason: Added link to drawing tool template helpguide
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by KirkHammett, Today, 03:23 AM
        0 responses
        2 views
        0 likes
        Last Post KirkHammett  
        Started by eleven, Yesterday, 10:06 PM
        0 responses
        35 views
        0 likes
        Last Post eleven
        by eleven
         
        Started by ezrollin, Yesterday, 08:12 PM
        7 responses
        72 views
        0 likes
        Last Post bltdavid  
        Started by kyamato, 11-23-2021, 10:51 PM
        6 responses
        91 views
        0 likes
        Last Post jeronymite  
        Started by fscabrera03, Yesterday, 07:14 PM
        0 responses
        49 views
        0 likes
        Last Post fscabrera03  
        Working...
        X