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

Linear regression of data that is not Series data

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

    Linear regression of data that is not Series data

    Hello,

    I would like to do a linear regression plot & r-squared calculation of a collection of 5 or so data points I gathered (each an x,y as in time, price).

    Unfortunately, the occurrence of these points is not aligned with any regularity in comparison to the Series data of the chart. In other words, the x's are at somewhat random intervals.

    Would you have any suggested approaches that involve NT8 indicator scripts, or is it better to write out the linear regression calculations by hand?

    Thank you,

    #2
    Hi,

    for the r-squared part it would be worth a shot to use the same algorithm like in the RSquared indicator, replace barIndex with index and Period with N.

    Comment


      #3
      Hey, thanks - the R-Squared indicator is certainly a great launch point for this, as are the other related functions.

      I keep forgetting there are actual scripts available for these built-in functions that I can copy and modify as appropriate!

      Appreciate the help.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by geddyisodin, Today, 05:20 AM
      1 response
      11 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Max238, Today, 01:28 AM
      3 responses
      32 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by timko, Today, 06:45 AM
      2 responses
      13 views
      0 likes
      Last Post NinjaTrader_ChristopherJ  
      Started by habeebft, Today, 07:27 AM
      0 responses
      5 views
      0 likes
      Last Post habeebft  
      Started by Tim-c, Today, 03:54 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X