Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

optimizing for a low correlation to another strategy

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

    optimizing for a low correlation to another strategy

    Suppose I have a strategy on 30-min bars with certain parameters that works fine. I want to optimize another strategy also over 30-min bars over a certain set of parameters such that I want to maximize for a function say (max net profit) * (1 - correlation to the P&L of the first strategy). How can I possibly implement this?

    #2
    Hello,

    Thank you for the question.

    I wanted to first confirm, are you asking to use the results of the first optimization to further guide a second optimization?

    If so there would be nothing internal in place to handle this type of test, the analyzer can only optimize one strategy at a time and its results are not shared to the other strategies.

    You could potentially write the settings used in each optimization to file and then read those settings from another strategy, but you would also need to come up with the logic to save the optimizations that are relevant instead of all iterations.

    Could you confirm if I have understood the question fully before further addressing this?

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello,

      Thank you for the question.

      I wanted to first confirm, are you asking to use the results of the first optimization to further guide a second optimization?

      If so there would be nothing internal in place to handle this type of test, the analyzer can only optimize one strategy at a time and its results are not shared to the other strategies.

      You could potentially write the settings used in each optimization to file and then read those settings from another strategy, but you would also need to come up with the logic to save the optimizations that are relevant instead of all iterations.

      Could you confirm if I have understood the question fully before further addressing this?

      I look forward to being of further assistance.
      Hi Jesse,

      Thanks for the reply. Yes, that's correct - you understood what I meant. I know that this can be outside of the standard help that you can provide. But would it be possible to give some pointers or hints on how I might be able to do this?

      For instance, would it be possible to write out (i) 30-min returns and (ii) the executions from applying a strategy, then write a custom optimization that loads this information and creates a statistics based on mix of low correlation and performance?

      Comment


        #4
        Hello,

        Thank you for the reply.

        What you are asking may be possible, at least the Writing to file portion would be. You could set up logic in your strategy in anyway you see fit and then write any data you need to a file, the prior examples provided would show that already to help you in that sense.

        Regarding the remainder, I would have no additional clues on what you may need to do as far as writing a custom optimizer type as these are not documented at all. You could see the existing types and make your own if you wish, you could also load data from file as you are still just using C#. Regarding the logic or how that would work to your advantage would rely on what data you export and what logic you come up with in the optimizer type.

        To see a existing optimizer to see what may be required, you could view the file: Documents\NinjaTrader 7\bin\Custom\Type\@DefaultOptimizationMethod.cs

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        647 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        369 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        108 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        572 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        573 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X