NexusFi: Find Your Edge


Home Menu

 





OptimizationMethod.Iterations is always 1


Discussion in NinjaTrader

Updated
    1. trending_up 1,503 views
    2. thumb_up 1 thanks given
    3. group 1 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread

OptimizationMethod.Iterations is always 1

  #1 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 45 since Nov 2009
Thanks Given: 42
Thanks Received: 27

So I have a related question I am trying to solve.

With my strategy I am exporting trade records and performance metrics automatically to two csv files. I have it setup for multi-threaded support and it is works great running in the optimizer. To support ppart of this, I am using some "static" variables for the output file names. These file names are automatically calculated based on instrument and time etc.

The issue I have is that because of the use of statics, the filename does not reset for each new optimization run so I have to manually "move them out of the way".

What I was hoping to do was detect when an optimization was being performed and then using the expected number of iterations (using the base.OptimizationMethod.Iterations) track until I am complete and then reset the static file name.

I would have thought that this OptimizationMethod.iterations property (at least looking at the defaultOptimization code should represent the number of iterations that are required to be performed (i.e. a total count), but when I look at this variable it is always one from within a strategy instances.

Anyone have any ideas on if I am being boneheaded or is there something else I am do instead??

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
NexusFi Journal Challenge - May 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
38 thanks
Just another trading journal: PA, Wyckoff & Trends
30 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
21 thanks
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,608


I can't offer much help, other than to point you towards some other extensive work with optimizers:



Now that code is for 6.5, and is useless for 7 in terms that it won't work. But, you could still analyze the code and possibly learn a few things to do with using your own optimizer.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
 dnof 
san francisco, ca
 
Experience: Intermediate
Platform: NinjaTrader
Posts: 45 since Nov 2009
Thanks Given: 42
Thanks Received: 27

Thanks Mike,

I emailed NT also, but it does not seem like there is an easy method inside a Strategy. I could extend/write my own optimizer, which is likely the easiest at stage.

In the interim what I have done is created a "static" that tracks whether a "file name reset" is required, and then just set that to the true in the UI. This works fine, the only issue being that if you forget, you add/overwrite the last files.

Started this thread Reply With Quote




Last Updated on October 5, 2011


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts