Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

enabling Correlation test

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

    enabling Correlation test

    Hello NinjaTrader

    I would like to test for Pearson Correlation between any open position I have and the next instrument added to my multi-instrument strategy. And so allow the next trade only if the Correlation between open position and the next strategy suggested instrument is below 0.2.

    I've found this Correlation indicator and wonder how to add to my conditions (attached code below) so that I could test for the above?
    Attached Files

    #2
    ionaz, would not really have a best practice approach on this uncharted territory, you would need to experiment and play with it. Generally you would want to run correlation calculations for each instrument combination you're trading and want to reference in your strategy multi series script. I would suggest also closely paying attention to the sync considerations discussed in the code for the realtime instrument updates, as if there is no tick for example for one instrument > then NT would not call your OnBarUpdate() its event based framework, so this could influence the bars you compare in the calcs.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Bertrand, I presume if I only want to implement this on the EOD Kinetick data, then I don't need to worry about sync considerations as there always be ticks required and NT would call OnBarUpdate() no probs, correct?

      Comment


        #4
        Correct Ionaz, you would get at least the settlement tick consistently.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by trilliantrader, Yesterday, 03:01 PM
        3 responses
        29 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by cmtjoancolmenero, Yesterday, 03:58 PM
        4 responses
        24 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Brevo, Today, 01:45 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by rjbtrade1, 11-30-2023, 04:38 PM
        2 responses
        74 views
        0 likes
        Last Post DavidHP
        by DavidHP
         
        Started by suroot, 04-10-2017, 02:18 AM
        5 responses
        3,022 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Working...
        X