Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Rolling optimization and output?

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

    Rolling optimization and output?

    Is there a way in which one can say, optimize on a pre-defined period and use the top value for live trading the next day, then roll it one day forward and repeat? It is not exactly a walk forward because I want to see the results of the live trading day separately from the previous values.

    So for example, if one wants to have an optimization period of 5 trading days so 9/3 to 9/7, use the top optimized values to trade for 9/10, see the result on 9/10, then optimize from 9/4 to 9/10, use the optimized values to trade on 9/11, print the results, etc. etc...

    Is there an automated way to do this? Customized code for example? if so how?

    #2
    Thank you for your question Boonfly8. I'd like to take a moment to make sure I fully understand your request.

    Our Help Guide (linked) has this diagram detailing how Walk Forward Optimization typically works.





    Would this image accurately describe what we are after for the week starting September 18th?




    If that is not quite what we are after, can you let me know what to correct in the above diagram?


    Is there anything I can clarify in that image, or are there any other questions we can answer?


    Thanks for your suggestion, I am looking forward to assisting further.
    Attached Files
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Is there an automated way to do this? Customized code for example? if so how?

      This is likely to be a feature request, for the following reasons.


      As the threading model of the walk forward optimizer isn't exposed or supported, simply using WFO and tracking state (e.g. skipping overlapping optimizations and sending data from one optimization to another through an add on with global singletons) is not an approach that is likely to be successful; Ninja retains the capability to launch several optimization runs in parallel.


      If we avoid the strategy analyzer completely, tracking how well variables perform and re-using them is possible through NinjaScript. Although this is an advanced computer science topic, this is the best publicly available resource I have found for this, http://www.ecs.umass.edu/mie/labs/md...s/genetic.html


      Because a complete NinjaScript solution is a nontrivial undertaking, as is building off what Ninja already does in an add-on, this is therefore best handled by adding this capacity to NinjaTrader directly.
      Jessica P.NinjaTrader Customer Service

      Comment


        #4
        Hi Jessica,

        Thank you for your reply and the article link. Genetic algorithms is the best for several reasons not just for WFO but also any optimization. But let's set aside the theoretical discussion and help me understand and answer my question.

        I have attached a screenshot of the WFO for the purpose of this discussion. As one can see, this is a WFO optimization done with a genetic algorithm from 8/1 to 8/31. The "Optimization period" is set to 5 days and "Test period" is set to 1. As described in the initiating post, I want to do a schedule such that I want to use previous 5 days of optimization to trade the following day.

        From looking at the output, I want to confirm with you that in the Parameters column, the process is as such:

        1. Start day 8/6 comes from that 8/1 to 8/5 is 5 days (doesn't matter that its trading day or weekend), and that is the optimization period used to calculate parameter values used to trade on 8/6.

        8/7 is optimizing from optimization period 8/2 to 8/6 (moving over 1 day from previous iteration), and the result (displayed in the parameters column) is used to trade on 8/7. etc..

        2. Because in the settings I have "Keep best results set to 10", the values in the parameters column used to trade are, I assume, the #1 value from those 10 best results?
        Attached Files

        Comment


          #5
          You are correct on all points, but I need to add that one important note from our help guide that is relevant, emphasis mine





          Note: NinjaTrader does save the "Keep best # results" for each Optimization period, if you want to see each individual optimization results you can right click on the walk forward result and select "Open Optimization Results".
          Jessica P.NinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by algospoke, 04-17-2024, 06:40 PM
          6 responses
          49 views
          0 likes
          Last Post algospoke  
          Started by arvidvanstaey, Today, 02:19 PM
          4 responses
          11 views
          0 likes
          Last Post arvidvanstaey  
          Started by samish18, 04-17-2024, 08:57 AM
          16 responses
          61 views
          0 likes
          Last Post samish18  
          Started by jordanq2, Today, 03:10 PM
          2 responses
          9 views
          0 likes
          Last Post jordanq2  
          Started by traderqz, Today, 12:06 AM
          10 responses
          21 views
          0 likes
          Last Post traderqz  
          Working...
          X