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, 09: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 Waxavi, Today, 02:00 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by alifarahani, Today, 09:40 AM
        5 responses
        23 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Kaledus, Today, 01:29 PM
        4 responses
        12 views
        0 likes
        Last Post Kaledus
        by Kaledus
         
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        16 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by PhillT, Today, 02:16 PM
        2 responses
        7 views
        0 likes
        Last Post PhillT
        by PhillT
         
        Working...
        X