OptimizationMethod.Iterations is always 1 - NinjaTrader Programming | futures io social day trading
futures io futures trading

OptimizationMethod.Iterations is always 1
Updated: Views / Replies:747 / 3
Created: by dnof Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Thread Tools Search this Thread

OptimizationMethod.Iterations is always 1

  #1 (permalink)
Elite Member
san francisco, ca
Futures Experience: Intermediate
Platform: NinjaTrader
Posts: 45 since Nov 2009
Thanks: 41 given, 26 received

OptimizationMethod.Iterations is always 1

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??

Reply With Quote
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

  #3 (permalink)
Site Administrator
Manta, Ecuador
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
Big Mike's Avatar
Posts: 46,336 since Jun 2009
Thanks: 29,452 given, 83,952 received

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.


Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.

Need help?
1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first.
2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses.
3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make.
4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance.
5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers.
Help using the forum? Watch this video to learn general tips on using the site.

If you want
to support our community, become an Elite Member.

Reply With Quote
The following user says Thank You to Big Mike for this post:
  #4 (permalink)
Elite Member
san francisco, ca
Futures Experience: Intermediate
Platform: NinjaTrader
Posts: 45 since Nov 2009
Thanks: 41 given, 26 received

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.

Reply With Quote


futures io > > > > > OptimizationMethod.Iterations is always 1

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

Wyckoff Hunting for Great Risk/Reward Ratio w/Gary Fullett

Elite only

Digging into the Details of iSystems w/Stage 5 & iSystems

Jun 5

All times are GMT -4. The time now is 11:49 AM.

Copyright © 2018 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2018-05-27 in 0.08 seconds with 18 queries on phoenix via your IP