Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Corelation Indicator

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

    Corelation Indicator

    Hi
    What is the "count" field in the correlation indicator parameters?
    Thanks
    Swing

    #2
    Hello Swing123,

    The Count property is used as the display name only, in the code of the indicator this is the Period property. This is used for the indicators SMA period.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse
      Thanks for the quick reply. Do you have (or can you point me) the equation so i can see what I want to set the SMA period to please?
      Thanks
      Swing

      Comment


        #4
        Hello Swing123,

        You can view the actual code for this indicator in the NinjaScript editor by clicking New -> NinjaScript editor and then expand the indicators folder. There are generally not any specific mathematical equations shown for the indicators unless there is one listed in the help guide for that indicator. I don't see this has a specific mathematical explanation provided as a formula so looking over the logic would likely be the best solution for this question.

        The description of this item is here: https://ninjatrader.com/support/help...ub=correlation

        The standard indicators can also be duplicated and edited if there were any other modifications you wanted to do such as plotting the SMA's it uses to visualize them.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi Jessie
          Thanks very much for your help.
          Cheers
          Swing.

          Comment


            #6
            Hi

            I find the instructions that Ninjatrader has provided that describes how the new correlation must be used confusing. I am referring to these pages: https://ninjatrader.com/support/help...orrelation.htm and https://ninjatrader.com/blog/track-r...ion-indicator/

            I find them confusing because the indicator itself requests data that is labeled "instrument" - which I assume is one of the two data series? In what format must this be captured? Does it map to "correlationSeries"?

            My second question is about the "period" - which I assume maps to "count"? The description on the help page is "Number of bars used in the calculation" - but you refer to a SMA above. What SMA? As far as I can see there is no simple moving average being calculated?

            Comment


              #7
              Hello verge,

              The correlation indicator and its Instrument parameter expects you to type in a symbol in the field. That is used in the AddDataSeries statement in the script.

              The SMA is simple moving average, that is used in the correlation indicators calculations along with the Period you input. You can look at the code for the indicator using the NinjaScript editor to see how that is used in the logic. The following line is how the SMA is used:
              Code:
              avg1 = SMA(BarsArray[1], Period)[0];

              I look forward to being of further assistance.

              JesseNinjaTrader Customer Service

              Comment


                #8
                Thank you for the quick response.

                Is the correlation indicator supposed to do the same calculation as the correlation formula in Excel - as described here https://support.microsoft.com/en-us/...b-239d7b68ca92

                I would imagine that it would be the same - since there is a standard way of calculating correlation.

                The problem is that I exported some bar data to excel from NT - and tried to replicate the result of the NT correlation indicator. I do not get the same answers. Could I perhaps mail my spreadsheet to someone at NT to have a look to see if I am doing it right?

                Comment


                  #9
                  Hello verge,

                  If you were unable to replicate the same value in excel with their standard function it may be using a different formula than how the indicator calculates.

                  The correlation indicator that comes with NinjaTrader has no mention in the help guide from where that was derived from so I would be unable to say if that is or is not like the excel function. You can review the code used in the indicator and see if the math works out the same as what you are doing in excel. Our support otherwise would not be able to try and replicate an indicator value in excel.

                  To know how the two differ you would need to go through the steps to work out what differences are being observed to find how the two deviate. That would involve manually calculating how the indicator processed the data and also manually calculating the way the excel formula is described, based on those two observations you could know what part was different between the two calculations.

                  Please let me know if I may be of further assistance.


                  JesseNinjaTrader Customer Service

                  Comment


                    #10
                    Jesse

                    I can manually calculate all the steps in Excel since I know Excel. The values that must be calculated is quite simple. I basically need the rolling average for the two data sets - and the respective values.

                    The NT indicator only provides the final result - how will know what the NT indicator calculated the average rolling values to be?

                    Comment


                      #11
                      Hello verge,

                      If you wanted to do more exploration on the individual bars being processed you would need to duplicate that indicator and add prints into the logic for whatever data you wanted to see on a bar by bar basis.

                      The indicator is otherwise intended to display the final result of the logic contained in that indicator, it does not specify in the help guide that it should match any external functions like excel or any other external programs specific math.


                      Please let me know if I may be of further assistance.
                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        Hello Jesse

                        I have not yet tried to change the correlation indicator to enable what you have suggested - I may still do so.

                        There are some new aspects of the NT8 correlation indicator that I would like to check with you. Please see attached screen shot. I know that there is a 15 minutes break in trading for ES every day. Why does the correlation indicator continue to calculate its value for 5 bars after the ES contract has stopped trading - and the only have a break of one bar? What data is being used to calculate the values of the indicator if there are no values for ES?
                        Click image for larger version

Name:	Correlation indicator gap.JPG
Views:	591
Size:	208.9 KB
ID:	1155427

                        Comment


                          #13
                          Hello verge,

                          Thank you for the post.

                          That appears to be an artifact from displaying the two different instruments in the same scale. If you have applied the indicator to an ES or primary instrument chart without the added secondary it will line up with the primary bars as intended. You can see a similar outcome when applying other indicators like the SMA which has a constant value, it will span the time of the gap. The correlation indicator breaks at the session in its calculation and starts over which creates the gap instead of a constant line across the timespan.


                          I look forward to being of further assistance.
                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by RookieTrader, Today, 09:37 AM
                          1 response
                          10 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Started by alifarahani, Today, 09:40 AM
                          0 responses
                          5 views
                          0 likes
                          Last Post alifarahani  
                          Started by Gerik, Today, 09:40 AM
                          0 responses
                          5 views
                          0 likes
                          Last Post Gerik
                          by Gerik
                           
                          Started by KennyK, 05-29-2017, 02:02 AM
                          3 responses
                          1,284 views
                          0 likes
                          Last Post NinjaTrader_Clayton  
                          Started by AttiM, 02-14-2024, 05:20 PM
                          11 responses
                          185 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Working...
                          X