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

Accessing Draw.RegressionChannel values

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

    Accessing Draw.RegressionChannel values

    Hi,

    I'm drawing a regression channel on a price series using Draw.RegressionChannel(), but then getting the data for the same from RegressionChannel() in order to do calculations. It occurred to me when I added this to a chart with several hundred bars, that it takes quite a long time to calculate and draw the channels. By using the 2 different calls, I am likely doubling the amount of work as the calculation is likely being done twice.

    Is there a way for me to use draw.regressionchannel() and simply retrieve the last values for the upper and lower channel, like I could with the series from RegressionChannel() ?

    Thanks.

    #2
    Hello pjsmith,

    Thank you for the post.

    The performance hit is likely coming from the multiple chart drawings and not the series calculation. Notice how the Regression Channel indicator only draws during real-time data and it employs the OnRender method to render the channel to the screen. One option is to ignore the historical data when drawing the Regression Chanel and only draw it in real time. The other option is to do what the Regression Channel does and use OnRender to draw only between the visible bars on the chart.

    Please let me know if you have any questions on these topics.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello pjsmith,

      Thanks for your post.

      The Regression Channel drawing tool exposes StandardDeviationLowerDistance and StandardDeviationUpperDistance which give the distance in standard deviations from the center line. This information could be used to calculate the price level where the Upper and Lower bands reside, but the price level is not provided directly.

      Publicly available documentation on the Regression Channel drawing object and available properties can be found here - https://ninjatrader.com/support/help...ionchannel.htm

      Please let us known if you have any additional questions.
      JimNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CortexZenUSA, Today, 12:53 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by CortexZenUSA, Today, 12:46 AM
      0 responses
      1 view
      0 likes
      Last Post CortexZenUSA  
      Started by usazencortex, Today, 12:43 AM
      0 responses
      5 views
      0 likes
      Last Post usazencortex  
      Started by sidlercom80, 10-28-2023, 08:49 AM
      168 responses
      2,265 views
      0 likes
      Last Post sidlercom80  
      Started by Barry Milan, Yesterday, 10:35 PM
      3 responses
      11 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X