PDA

View Full Version : Use Optimizer in Strategy


BobSk
06-25-2010, 08:23 AM
Hello,

Is it possible to create Optimizer object and use Optimizer results within Strategy?

Thanks.

NinjaTrader_RyanM
06-25-2010, 08:32 AM
Hello BobSk,

Welcome to the NinjaTrader forums!

Not sure I follow. You can optimize variables with numeric values. The optimization object must be a user defined input (public property). You can create these through the wizard when creating your strategy (http://www.ninjatrader-support.com/HelpGuideV6/WizardScreens.html).

The link below can also help adding these inputs to code.
http://www.ninjatrader.com/support/forum/showthread.php?t=5782

See here for the help guide article on strategy optimization. (http://www.ninjatrader-support.com/HelpGuideV6/OptimizeAStrategy.html)

BobSk
06-25-2010, 09:02 AM
Thank you, I know and use Optimizer Wizard.
But Optimizer give me results from old data.
But Market is still changing and I would like to try calculate fresh Optimizer results from last data.
Can I create such Strategy:
1. Create instance of Optimizer in Initialize of Strategy
2. Create instance of Strategy in Initialize of Strategy (instance of the same strategy class)
3. Link Optimizer and Strategy instance, fill Optimizer parameters and run Optimizer over actual data - all in runtime, in strategy
4. Get Best Optimizer results and use it in Strategy ( in OnBarUpdate)

Or is it possible run Optimizer cyclic like Strategy?
Then Optimizer would calculate fresh optimal parameters over last data and write them somewhere for running Strategy instance.

NinjaTrader_RyanM
06-25-2010, 09:08 AM
Unfortunately this is not supported. Optimization can only be done through the strategy analyzer on an historical basis.