Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is "thread management" needed when Optimizing and overriding "OnExecutionUpdate" ?

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

    Is "thread management" needed when Optimizing and overriding "OnExecutionUpdate" ?

    I just want to confirm that "OnExecutionUpdate" is works as expected while optimizing OR do I have to code something special in the way of thread management?


    Note: I do use "IsInstantiatedOnEachOptimizationIteration = true" and insure my collections are reset.

    I am attempting to determine why my optimization results are different for the same data & parameters each time I run.
    Sometimes the results are not too different but other times, very different so I think it my be "thread related" and the only "non-standard" override is "OnExecutionUpdate"

    Thanks!

    #2
    Hello, thanks for writing in. You do not need to manage anything differently if using OnExecutionUpdate. The difference in data is either nonmatching data or a lack of intrabar granularity. If your strategy does not add any extra series, you can set "Order Fill Resolution" to "High>1Tick" to improve order fill estimation. There is a more in-depth guide here:

    Citizens of the NinjaTrader Community, A common question we hear from clients is 'why are results from backtest different from real-time or from market replay?'. Live orders are filled on an exchange with a trading partner on an agreed upon price based on market dynamics. Backtest orders are not using these market dynamics.

    Comment


      #3
      Thanks Chris;
      with the normal optimizer, everything is great BUT the issue is the "walk forward optimizer".
      Run the "sampleMAcrossover" with the "optimization period" = 2 and "test period" = 1 and parameters of 10;11;1 & 24;25;1 (or any other values)
      Each run produces a different results which MAY match but can also be very different.
      >> There is already an open bug in the WFO and I notified them that is is also an issue...

      Comment


        #4
        Hi, You will notice in this walk forward optimization the parameter set with the start/end date, you’ll see they are often not the same between runs, so the result is expected to happen.

        Comment


          #5
          I agree, if I change the date, I would expect the results to change BUT when the dates are the same and the parameters are the same for each run, the results are NOT the same...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          51 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          128 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X