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


NinjaTrader Genetic Optimizer
Updated: Views / Replies:54,049 / 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

  #31 (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:
- in the main NT window, go to the 'Tools->Edit Ninjascript->Indicator' menu
- select any indicator, and click OK
- click the 'compile' button (in the toolbar, to the right of the binoculars). alternatively, hit F5
- click 'OK' when the 'Indicator successfully generated' dialog appears.
- 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 ;-)

I backed up @strategy.cs simply by copying and pasting and renaming file to @strategy.cs.bk IS THAT CORRECT
Saved PHGo to proper file
Then when to Utilities and >Import Ninja Strategy. That is when it blew up again. Doesn't allow.
Suggestions?

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


CRCTrader View Post
I backed up @strategy.cs simply by copying and pasting and renaming file to @strategy.cs.bk IS THAT CORRECT
Saved PHGo to proper file
Then when to Utilities and >Import Ninja Strategy. That is when it blew up again. Doesn't allow.
Suggestions?

oh, sorry. please check the updated instructions. they now detail how to install.

one day i'll get around to improving this...

Reply With Quote
 
  #33 (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,220 received


piersh,

1.04 doesn't properly list the # of combinations it would seem. 1.03 was fine. For combinations, 1.04 is just outputting the instrument name.

ZN 09-09: PH Optimizer Start @ 7/23/2009 12:14:37 AM, combinations: ZN 09-09

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
 
  #34 (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,220 received

Hi piersh,

Also at some point of combinations, the error "Failed to call method Optimize for optimizer 'PHGenetic': Index was out of range." occurs.

I am not sure at what point this happens, but I have run into it a couple of times on a very complex money management strategy I am writing that auto adjusts multiple stops and targets, it has about 30 parameters to optimize, and some of those have a wide variety of values.

It is easy to work around, I just reduce the set of combinations, but wanted to make you aware of it incase you weren't. It may just be a limitation.

Last, I was wondering if you would consider adding a Stop time to the Output box, or an ETA so we know how long the job took to complete.

On a wish list, I'd like to see your own Window (like the options window) stay open during the optimization job and update with stats on-the-fly, would be very cool.

BTW, do you have a website? Are you accepting donations for your hard work?

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
 
  #35 (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,220 received

Oops - I just noticed you updated the first post to include the # of combinations fix. I will install it soon (in middle of a large job) and then I can report back some better figures perhaps to my last post.

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
 
  #36 (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,220 received

It seems to break when it goes above 4,096,xxx,xxx,xxx,xxx,xxx,xxx. I think that is understandable and clearly an enormous number. I will rewrite some of my logic so I can do with fewer optimization variables.

Here is the last one that was successful for me:

ZN 09-09: PH Optimizer Start @ 7/25/2009 5:34:42 AM, combinations: 3,976,005,110,290,448,384

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
 
  #37 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received


Big Mike View Post
It seems to break when it goes above 4,096,xxx,xxx,xxx,xxx,xxx,xxx. I think that is understandable and clearly an enormous number. I will rewrite some of my logic so I can do with fewer optimization variables.

Here is the last one that was successful for me:

ZN 09-09: PH Optimizer Start @ 7/25/2009 5:34:42 AM, combinations: 3,976,005,110,290,448,384

Mike

ok, the new limit is 79,228,162,514,264,337,593,543,950,335

if you hit that then you're out of luck ;-)

Reply With Quote
 
  #38 (permalink)
Elite Member
USA
 
Futures Experience: Master
Platform: NinjaTrader
 
caprica's Avatar
 
Posts: 155 since Jul 2009
Thanks: 45 given, 109 received

I optimize on things other than net profit and wonder if you could make this wonderful script display not just the performance of whatever I am optimizing on but also the net profit. For instance, many times I optimize on max expectancy but a high value will many times yield a very low net profit. I'd like to be able to see both as the optimization is progressing so I know when to abort the process.

So for instance if you optimize on something other than net profit, it would show:

ES 09-09: gen 1/20, 20.5 ips, PERF: [max 1.05, stability: 4.55], net profit: [$ 15,612.50]
ES 09-09: gen 2/20, 20.5 ips, PERF: [max 1.25, stability: 4.95], net profit: [$ 17,550.25]

Reply With Quote
 
  #39 (permalink)
Elite Member
Israel
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: pfg
Favorite Futures: eminis
 
Posts: 323 since Jun 2009
Thanks: 6 given, 206 received

Piersh hi,
Great staf.
I have a question. Maybe you can help.
Its about Walk Forward. The sequence now in NT is:
Load min. bars required>optimize(Optimization period - min. bars required)>Load min. bars required>Test(Test period - min. bars required)> New Optimization (From date + Test period) etc.
My problem is that if Test Period is 7 days and min. bars required are 100 on a 10 min. time frame and a day session (8:30-15:15), this mean that 2 days are not tested.
Is there a way to move the "From Date" back on each iteration to achieve the correct sequence:
optimize(Optimization period)>Test(Test period)>New optimize.

Regards,
Baruch

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



caprica View Post
I optimize on things other than net profit and wonder if you could make this wonderful script display not just the performance of whatever I am optimizing on but also the net profit. For instance, many times I optimize on max expectancy but a high value will many times yield a very low net profit. I'd like to be able to see both as the optimization is progressing so I know when to abort the process.

So for instance if you optimize on something other than net profit, it would show:

ES 09-09: gen 1/20, 20.5 ips, PERF: [max 1.05, stability: 4.55], net profit: [$ 15,612.50]
ES 09-09: gen 2/20, 20.5 ips, PERF: [max 1.25, stability: 4.95], net profit: [$ 17,550.25]

unfortunately not, there's no way for the optimizer to get access to the underlying performance data required to do this.

my suggestion is that you build this rule into your scoring function. either as a weight, (eg. multiply your score by the net profit), or as a cut-off (eg. return double.NegativeInfinity for all scores with avg daily net profit less than a certain value).

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 04:06 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-12 in 0.15 seconds with 20 queries on phoenix via your IP 54.163.210.170