NexusFi: Find Your Edge


Home Menu

 





NinjaTrader Genetic Optimizer


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one piersh with 49 posts (94 thanks)
    2. looks_two Big Mike with 26 posts (10 thanks)
    3. looks_3 TraderDJB with 13 posts (18 thanks)
    4. looks_4 dsraider with 10 posts (0 thanks)
      Best Posters
    1. looks_one piersh with 1.9 thanks per post
    2. looks_two TraderDJB with 1.4 thanks per post
    3. looks_3 sam028 with 0.5 thanks per post
    4. looks_4 Big Mike with 0.4 thanks per post
    1. trending_up 92,846 views
    2. thumb_up 134 thanks given
    3. group 47 followers
    1. forum 197 posts
    2. attach_file 19 attachments




 
Search this Thread

NinjaTrader Genetic Optimizer

  #151 (permalink)
Anagoge
Missouri, USA
 
Posts: 2 since Jun 2009
Thanks Given: 3
Thanks Received: 1

I'm getting this error as the optimizer starts on one strategy:

There are no optimization results available, since the strategy has no parameters to optimize.
GSPC: PH Genetic Optimizer Start @ 5/1/2010 3:10:06 PM, combinations: 0
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at NinjaTrader.Strategy.PH.PHGenetic.Optimize()

The strategy has a boolean param as the first one in the property list. That boolean comes up in the PH optimizer list of potential enums to optimize on. If I leave everything unchecked there, I get the above error. If I check true, I don't see the error, and the optimization completes just fine.

I can duplicate this every time, and even after restarting NT 7 B15 32-bit.

Attached Thumbnails
Click image for larger version

Name:	Params.png
Views:	217
Size:	22.8 KB
ID:	12570  
Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
How to apply profiles
Traders Hideout
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
22 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #152 (permalink)
piersh
California
 
Posts: 87 since Jun 2009
Thanks Given: 5
Thanks Received: 120


Anagoge View Post
That boolean comes up in the PH optimizer list of potential enums to optimize on. If I leave everything unchecked there, I get the above error.

yes, sorry, that's a UI issue - it shouldn't let you uncheck all of the options for a bool/enum parameter. the number of combinations is zero because you're telling the optimizer that your bool can neither be true nor false. the error is correct, however the UI shouldn't allow you to get into that state...

please make sure that you check one or more values for each of the parameters listed in the dialog.

Reply With Quote
  #153 (permalink)
 Trumumflu 
Belgium
 
Experience: Intermediate
Platform: NinjaTrader , ThinkOrSwim
Broker: Zen-Fire
Trading: futures
Posts: 1 since Feb 2010
Thanks Given: 0
Thanks Received: 0


Hi ,

first thanks you very much for all of that wonderful work...

I'm an analyst programmer in ?NEt and I already wrote some genetics algorithm (not in the trading stuff) and I know how it's difficult to write that.

I just begin to test your Optimizer , do you use some 'cross over' evolution between genomes ?

There are other research algorithm that I used before...

I compared solutions between Genetics optimizations (GO) and Ant Colony optimizations (ACO)...

and I often found best solutions quicker with ACO...

I wrote a framework in C# to develop my research...

I would try to move it to try on Ninja Trader...

Can you give me somes links about the API and some tips to avoid loosing to much time

Of course , If I succeed in that developpment , I will post the solution here

thanks again for your contribution !!!

Reply With Quote
  #154 (permalink)
 
TraderDJB's Avatar
 TraderDJB 
Michigan
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker: MB Trading
Trading: Forex
Posts: 46 since Jan 2010
Thanks Given: 7
Thanks Received: 28

@ Trumumflu: If you posted the source to your C# ACO work, we could help implement it.

On longer optimizations it is easy to get distracted with other things on my computer, and then discover that the optimization finished 5-10 minutes ago and I didn't notice. So, I added sound notification to the Genetic and Stochastic (version 1.12).

While it doesn't have a toggle for the sound, I hope that piersh will keep it in future versions and perhaps add the toggle for those of us that want that feature.

- TFX/DJB

Do or do not, there is no try. - Yoda
Attached Files
Elite Membership required to download: PHGenetic_v1.12_DJBSound.zip
Reply With Quote
  #155 (permalink)
 
TraderDJB's Avatar
 TraderDJB 
Michigan
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker: MB Trading
Trading: Forex
Posts: 46 since Jan 2010
Thanks Given: 7
Thanks Received: 28

Here are some more changes and one bug fix (that was present in 1.12):

PH Genetic/Stochastic:
  1. Emit sound when optimizations run to completion, but not when optimization was aborted.
  2. Options box is now re-sizeable, larger by default, and is reformatted to not have as much empty space.
  3. Fixed: It used to be that hitting the Cancel button for Stochastics type would indefinitely hang NT without aborting the optimization.

Do or do not, there is no try. - Yoda
Attached Files
Elite Membership required to download: PHGenetic_v1.12_2_DJBSound.zip
Reply With Quote
Thanked by:
  #156 (permalink)
 verge 
Cape Town, South Africa
 
Experience: Beginner
Platform: NinjaTrader
Broker: Zen-fire
Trading: EUR/USD
Posts: 41 since Aug 2009
Thanks Given: 22
Thanks Received: 12

Is there a way that an enum could be used to control the minimum and maximum number of trades? Controlling the minimum number of trades is more important for me - otherwise my systems (before I include a stoploss only trades once)

I would also appreciate it if the parameter values printed to the output window could have more decimals as described here

Verge

Reply With Quote
  #157 (permalink)
 
TraderDJB's Avatar
 TraderDJB 
Michigan
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker: MB Trading
Trading: Forex
Posts: 46 since Jan 2010
Thanks Given: 7
Thanks Received: 28

Verge, here I changed it as you requested to display up to 5 decimal places if it's a double or a long type value. See the screenshot. Also, I fixed the window box being really narrow if there weren't any enum types to optimize (I had made the window size resizeable but hadn't set a very big 'minimum' size to it.) The only bugger is that it does still make the sound even when aborting, where last night it wasn't. Oh well.

As for minimum trades or maximum trades, what you'd want to do is create a custom optimization type (as opposed to Max Profit Factor, etc.) that favors the number of trades to the number that you want. Setting the optimizer to discard results of less than a certain number will likely not produce the results that you are expecting and not function properly.

- DJB/TSX

Do or do not, there is no try. - Yoda
Attached Thumbnails
Click image for larger version

Name:	Capture.JPG
Views:	262
Size:	12.5 KB
ID:	13314  
Attached Files
Elite Membership required to download: PHGenetic_v1.12_3_DJBSound.zip
Reply With Quote
  #158 (permalink)
 
TraderDJB's Avatar
 TraderDJB 
Michigan
 
Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker: MB Trading
Trading: Forex
Posts: 46 since Jan 2010
Thanks Given: 7
Thanks Received: 28

Here's another update: Now it correctly only does the "Cha ching!" sound when it runs to completion and not when an optimization is aborted. Also, the dialogue box that pops up automatically sizes to the number of options available. (though it won't get smaller again after doing a strategy with lots of options, it seems to be the way NT handles it, until a restart.)

- DJB/TFX

Do or do not, there is no try. - Yoda
Attached Files
Elite Membership required to download: PHGenetic_v1.12_4_DJBSound.zip
Reply With Quote
Thanked by:
  #159 (permalink)
 verge 
Cape Town, South Africa
 
Experience: Beginner
Platform: NinjaTrader
Broker: Zen-fire
Trading: EUR/USD
Posts: 41 since Aug 2009
Thanks Given: 22
Thanks Received: 12

Thank you traderfx!

To confirm - I checked the info.xml file of PHGenetic_v1.12_4_DJBSound.zip - it says version <Version>6.5.1000.11</Version> which I assume is incorrect. I assume you made your updates to version 6.5.1000.12 - it may actually be that the actual version 12's info file was not updated.

Edit - I checked - the info file of version 12 in the download section also says version 11.

Reply With Quote
  #160 (permalink)
 verge 
Cape Town, South Africa
 
Experience: Beginner
Platform: NinjaTrader
Broker: Zen-fire
Trading: EUR/USD
Posts: 41 since Aug 2009
Thanks Given: 22
Thanks Received: 12



TraderFX View Post
Verge, here I changed it as you requested to display up to 5 decimal places if it's a double or a long type value. See the screenshot. Also, I fixed the window box being really narrow if there weren't any enum types to optimize (I had made the window size resizeable but hadn't set a very big 'minimum' size to it.) The only bugger is that it does still make the sound even when aborting, where last night it wasn't. Oh well.

As for minimum trades or maximum trades, what you'd want to do is create a custom optimization type (as opposed to Max Profit Factor, etc.) that favors the number of trades to the number that you want. Setting the optimizer to discard results of less than a certain number will likely not produce the results that you are expecting and not function properly.

- DJB/TSX

The 5 decimal places works great.

I have used the MOGO GO with NT6.5 - and liked it a lot. It has a setting that could be used to set the minimum number of trades. I used it because one of the optimization functions I use is "maximum profit factor". If I cannot cannot specify the minimum number of trades the result of the optimization often is 1 trade only - with a max profit factor of 99 (I do not use close at end of session).

The reason for the maximum number of trades are I would like a system to trade around twice a day (for example). I am unfortunately not skilled enough in C# to write an optimization function to control this.

Any suggestions from anyone on how I can achieve the above will be appreciated.

Reply With Quote




Last Updated on December 16, 2010


© 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