NinjaTrader Genetic Optimizer - NinjaTrader Programming | futures io social day trading
futures io futures trading


NinjaTrader Genetic Optimizer
Updated: Views / Replies:54,018 / 197
Created: by piersh Attachments:19

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

Reply
 19  
 
Thread Tools Search this Thread
 

NinjaTrader Genetic Optimizer

  #21 (permalink)
Member
Panama!
 
Futures Experience: None
Platform: Hit the Bid!
 
Posts: 44 since Jun 2009
Thanks: 1 given, 22 received

Piersh, is there anyway you can add an option to specify minimum # of trades so that it only returns the best results of values that trade more than the min? this has helped me in the past to avoid curve fitting.


Last edited by tortexal; July 1st, 2009 at 12:02 AM.
Reply With Quote
 
  #22 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received


tortexal View Post
Piersh, is there anyway you can add an option to specify minimum # of trades so that it only returns the best results of values that trade more than the min?

Unfortunately, NT's optimization API doesn't provide this information (at least, I couldn't find a way to retrieve it).

In order to do what you want, you'll have to write a custom OptimizationType. I'd recommend doing this since it gives you much greater control over the results.

- take a look in your "My Documents\NinjaTrader 6.5\bin\Custom\Type" directory. you'll see the classes for the various built-in optimization types (eg. 'max. avg. profit' is in @MaxAvgProfit.cs.
- make a copy of one of these files, change the file name, the class name (to match) and the 'DisplayName' attribute, and have at it!

I have been using a custom method that limits the min/max avg. trades per day (it returns double.NegativeInifinity when there are too many or too few trades), and tries to maximize the expectancy per trade while minimizing the draw-down.

you can get the average number of trades per day like this:
 
Code
systemPerformance.AllTrades.Count / (Strategy.BackTestTo - Strategy.BackTestFrom).TotalDays

Reply With Quote
The following 2 users say Thank You to piersh for this post:
 
  #23 (permalink)
Just starting out...
Norway
 
Futures Experience: Beginner
Platform: Ninja
 
Posts: 6 since Jun 2009
Thanks: 1 given, 1 received

Crossover


I tried to find crossover method in your GA optimizer but could'nt find. I think it's very important function to find solutions fast. I just saw reproduce. but there is no method which crossovers parents values.
Maybe I am just blind.


regards.

Reply With Quote
 
  #24 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received


kekkis View Post
I tried to find crossover method in your GA optimizer but could'nt find. I think it's very important function to find solutions fast. I just saw reproduce. but there is no method which crossovers parents values.
Maybe I am just blind.


regards.

is this the bit you mean?

 
Code
// Take an attribute from parents
DNA parent = (_rand.Next (100) < 50) ? parentA : parentB;
rgParams [iParam] = parent.GetParam (iParam);

Reply With Quote
 
  #25 (permalink)
Just starting out...
Norway
 
Futures Experience: Beginner
Platform: Ninja
 
Posts: 6 since Jun 2009
Thanks: 1 given, 1 received

For me this looks like, it just takes parents values, but not make crossover for values. I have to read your code again.

Reply With Quote
 
  #26 (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,238 since Jun 2009
Thanks: 29,350 given, 83,215 received

piersh,

Fantastic work. I'm just using it today for the first time as I've been focused on discretionary stuff, but I wanted to do a bit of optimization today on my rules set.

I have a request: could you make the GO spit out the variable name and the most optimized setting, at the end of the run (output dialog). ie:

Optimized results:
(Parameter, value)
JMA, 14
ZL, 28
Stop, 8
Target, 8

etc.

Mike

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.
6)
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
 
  #27 (permalink)
Just starting out...
NY State
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Mirus/Zen-Fire
Favorite Futures: Futures, Options
 
Posts: 3 since Jul 2009
Thanks: 0 given, 0 received


piersh View Post
Hi All,

I've created a new Genetic Strategy Optimizer based loosely on Peter's GAOptimizer.


Installation Instructions:
- back up the file ""My Documents\NinjaTrader 6.5\bin\Custom\Strategy\@Strategy.cs" first (call it @Strategy.cs.bak)
- copy the enclosed .cs files to your "My Documents\NinjaTrader 6.5\bin\Custom\Strategy" directory.
- edit an indicator or strategy and build it (F5).
- in your strategy analyzer optimize dialog choose "PH Genetic" as the Optimizer.
- you can select whichever "Optimize on..." metric you like.
- when the "PH Genetic Options" dialog appears, hover over the controls to get a short description of what each option does.

like most GA optimizers it does like to find a local maximum, although it'll attempt to kick out if it notices stability.

let me know if you have any problems/questions. i'll write some documentation soon, honest ;-)


If possible, please detail what you mean by "edit an indicator or strategy and build it (F5)"

Thank-you!

Reply With Quote
 
  #28 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received


CRCTrader View Post
If possible, please detail what you mean by "edit an indicator or strategy and build it (F5)"

Thank-you!

certainly, i have updated the original post at the top of this thread to include more detail on this step.

Reply With Quote
 
  #29 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received


Big Mike View Post
piersh,

Fantastic work. I'm just using it today for the first time as I've been focused on discretionary stuff, but I wanted to do a bit of optimization today on my rules set.

I have a request: could you make the GO spit out the variable name and the most optimized setting, at the end of the run (output dialog). ie:

Optimized results:
(Parameter, value)
JMA, 14
ZL, 28
Stop, 8
Target, 8

etc.

Mike

sure. until then, though. you can select the best performing result in the strategy analyzer and see the parameter in the grid (see attachment).

Attached Thumbnails
NinjaTrader Genetic Optimizer-untitled.png  
Reply With Quote
The following user says Thank You to piersh for this post:
 
  #30 (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,238 since Jun 2009
Thanks: 29,350 given, 83,215 received



piersh View Post
sure. until then, though. you can select the best performing result in the strategy analyzer and see the parameter in the grid (see attachment).

Yeah I know, but with a lot of parms it gets real messy real fast. If you can add it great, if not I can live.

Mike

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.
6)
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

Reply



futures io > > > > > NinjaTrader Genetic Optimizer

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
MoGo Genetic Optimizer for NT7 TraderDJB NinjaTrader Programming 6 April 19th, 2012 09:52 AM
Index to Genetic Optimizers for NinjaTrader jdfagan NinjaTrader Programming 2 June 24th, 2010 06:09 AM
NinjaTrader 7.0 Strategy Analyzer and Optimizer tutorials? sev888 Traders Hideout 3 April 2nd, 2010 10:42 AM
How i use genetic optimizer in 10 steps wh NinjaTrader 6 June 15th, 2009 03:23 PM


All times are GMT -4. The time now is 01:30 PM.

Copyright © 2017 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 2017-12-11 in 0.11 seconds with 20 queries on phoenix via your IP 54.145.16.43