Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

It appears that the Optimizer runs one extra iteration than is necessary

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

    It appears that the Optimizer runs one extra iteration than is necessary

    Hello

    I am running 8.0.20.0 64-bit

    It appears that the Optimizer runs one extra iteration than is necessary, i.e. it duplicates one of the iterations.

    This can be seen by doing the following:

    1) Modify the SampleMACrossover Strategy by adding the following code to State.DataLoaded: Print(Fast);
    2) In the Optimizer, select a range for the Fast Property, and Run the Optimizer
    3) In the Output window you will see a second iteration for one of the Fast Properties

    I have not reviewed this close enough to see whether or not it skews the results for the run that is duplicated.

    This does not affect me since I use StreamWriter to record Optimizer data, which I import to other software where duplicate records are removed...just thought I'd report this to the team.

    #2
    Hello Zigfried,

    Thank you for your post.

    From looking at the code for the Optimizer, it appears that this would be expected - it will get information from the strategy before running the iteration, during which the strategy reaches State==State.SetDefaults, but does not actually complete the iteration if it's already completed the required number of iterations.

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hello Kate

      I'm not sure what you mean by a "complete" iteration, but if you move the Print statement to OnBarUpdate and copy the output to another program like a spreadsheet, you can sort/count records and see that the it runs all the way through the OnBarUpdate section for the duplicated iteration. For other team members like me who are recording the trades to file, the duplicate trades need to be deleted. Whether or not the Optimizer actually uses these trades...I guess you are telling me that it doesn't.

      Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      31 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      2 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,281 views
      0 likes
      Last Post Leafcutter  
      Started by WHICKED, Today, 12:45 PM
      2 responses
      19 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by Tim-c, Today, 02:10 PM
      1 response
      10 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X