• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 Kelsoner, Today, 11:31 AM
      0 responses
      3 views
      0 likes
      Last Post Kelsoner  
      Started by srbdoc, Today, 10:48 AM
      2 responses
      5 views
      0 likes
      Last Post srbdoc
      by srbdoc
       
      Started by Mttzern, Today, 10:42 AM
      0 responses
      9 views
      0 likes
      Last Post Mttzern
      by Mttzern
       
      Started by markbb10, Today, 06:55 AM
      2 responses
      8 views
      0 likes
      Last Post markbb10  
      Started by sgordet, Today, 09:58 AM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_ShawnB  
      Working...
      X