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


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

  #161 (permalink)
Elite Member
Michigan
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker/Data: MB Trading
Favorite Futures: Forex
 
TraderDJB's Avatar
 
Posts: 46 since Jan 2010
Thanks: 7 given, 28 received

Verge, as for which version, I use strictly Ninja Trader 7 but the changes aren't platform specific.

The .xml file is irrelevant, I edited the PH Genetic 1.12.zip folder directly, putting in my new .cs files in and never actually "exported" it from NT at all. So, that is why its version matches the version you downloaded, even though it wasn't from 6.5 at all.

By the way, you'd asked about minimum trades and I recall seeing this in SQN:

 
Code
		public static int sMinTrades = 0;
		

		public override double GetPerformanceValue(SystemPerformance systemPerformance)
		{
			// Allow override of minimum number of trades to return a value
			// Parameter is SQNMinTrades
			int minTrades = 30;
			if (sMinTrades > 0)
			{
				minTrades = sMinTrades;
			}
			else
			{
				int n;
				for (n = 0; n < Strategy.Parameters.Count; n++)
				{
					if ("SQNMinTrades".CompareTo(Strategy.Parameters[n].Name) == 0)
					{
						minTrades = (int)Strategy.Parameters[n].Value;
						break;
					}
				}
			}
		
			double numTrades = systemPerformance.AllTrades.Count;
			
			if (numTrades < minTrades)
				return 0;
If you change the sMinTrades to be what you want, this code can overwrite/insert onto the beginning of whatever optimization type code you use and it will enforce a minimum number of trades. With more complex coding, it could be made to look for that value from the Strategy so that it could be easily editable. It would be easier to show you if you told me which type you usually optimize for.

- DJB/TFX

Do or do not, there is no try. - Yoda
Reply With Quote
 
  #162 (permalink)
Elite Member
Michigan
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker/Data: MB Trading
Favorite Futures: Forex
 
TraderDJB's Avatar
 
Posts: 46 since Jan 2010
Thanks: 7 given, 28 received

Your last comment was as I was typing a reply, so here you go with the code added to Max Profit Factor. I set it to a minimum of 20, change as you like. Seeing how it was done should be sufficient for you to apply it to any of the others. These files are in your Custom\Type folder.

Do or do not, there is no try. - Yoda
Attached Files
Register to download File Type: cs @MaxProfitFactor.cs (1.4 KB, 46 views)
Reply With Quote
The following 2 users say Thank You to TraderDJB for this post:
 
  #163 (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,240 since Jun 2009
Thanks: 29,353 given, 83,234 received



verge View Post
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.

You can create your own performance Type (Net Profit, Profit Factor, and VergeCustom for instance).

Within that (NT\bin\Custom\Type\customVerge.cs, using another one like NetProfit as example), you can just check for trades per day and then return double infinity to reject a value too low.

Below is hand typed, not tested...

 
Code
                            
double tradesPerDay;
int totalTrades;

tradesPerDay systemPerformance.AllTrades.TradesPerformance.TradesPerDay;
totalTrades systemPerformance.AllTrades.Count;

if (
tradesPerDay == totalTrades) return double.NegativeInfinity// seems to be NT bug

if (tradesPerDay 2) return double.NegativeInfinity// rejection threshold 
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
The following 3 users say Thank You to Big Mike for this post:
 
  #164 (permalink)
Elite Member
Cape Town, South Africa
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Zen-fire
Favorite Futures: EUR/USD
 
Posts: 40 since Aug 2009
Thanks: 22 given, 11 received

Thank you both

Traderfx & Mike

Thank you both. I use a number of different optimization functions (because I am still searching for the ideal one) and will now be able to change them with the help you have given me.

Now that I have your attention I would like to ask about one other enhancement that I would like on this GO - and that is to write the detailed results to a csv type file so that I can use it to draw graphs. MOGO creates such a file as an option - see screen-shot for example - after it has been imported in to Excel. (the first line in the file are the parameter names)

I know that Piersh's GO writes to the output window - but not all the results - only the end of every generation ( I think). I would like the number of entries in the file to be = generations X populations size. I typically use files with around 65 000 records. Again - any ideas of how I can do this will be appreciated.

Attached Thumbnails
NinjaTrader Genetic Optimizer-mogo-file-excel.png  
Reply With Quote
 
  #165 (permalink)
Elite Member
Michigan
 
Futures Experience: Intermediate
Platform: NinjaTrader, TradeStation, Thinkorswim
Broker/Data: MB Trading
Favorite Futures: Forex
 
TraderDJB's Avatar
 
Posts: 46 since Jan 2010
Thanks: 7 given, 28 received

Dear Verge Sir, may I ask you a question?

Since the MoGo has everything you ever wanted, why bother with trying to have another optimizer meet all these specific needs?

As far as creating a csv output for every iteration, it's above my pay grade.

- TFX

Do or do not, there is no try. - Yoda
Reply With Quote
 
  #166 (permalink)
Elite Member
Cape Town, South Africa
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: Zen-fire
Favorite Futures: EUR/USD
 
Posts: 40 since Aug 2009
Thanks: 22 given, 11 received

Mogo does not work in NT7


TraderFX View Post
Dear Verge Sir, may I ask you a question?

Since the MoGo has everything you ever wanted, why bother with trying to have another optimizer meet all these specific needs?

As far as creating a csv output for every iteration, it's above my pay grade.

- TFX

MoGo does not work in NT7

Reply With Quote
 
  #167 (permalink)
Membership Revoked
United States of America
 
Futures Experience: Advanced
Platform: NT
 
Posts: 1,149 since Aug 2009
Thanks: 262 given, 471 received

Can one of you frequent users, please explain what each of these options do and how best to use them?

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

Reply With Quote
 
  #168 (permalink)
Administrator: Retired Backtester
 Vendor: speedytradingservers.com 
Rennes France
 
Futures Experience: Advanced
Platform: NinjaTrader
Broker/Data: IB/Kinetick
Favorite Futures: Futures
 
sam028's Avatar
 
Posts: 3,366 since Jun 2009
Thanks: 3,573 given, 3,982 received


Zoethecus View Post
Can one of you frequent users, please explain what each of these options do and how best to use them?

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

I think you shoudl read the Wikipedia article on GA, you'll have your answers.
Not for the "Min Performance" parameter, which is not specific to usual GA usage.

Success requires no deodorant! (Sun Tzu)
Reply With Quote
The following 2 users say Thank You to sam028 for this post:
 
  #169 (permalink)
Membership Revoked
United States of America
 
Futures Experience: Advanced
Platform: NT
 
Posts: 1,149 since Aug 2009
Thanks: 262 given, 471 received


sam028 View Post
I think you shoudl read the Wikipedia article on GA, you'll have your answers.
Not for the "Min Performance" parameter, which is not specific to usual GA usage.

Nope that didn't answer my question, but thanks for the link. A more user friendly description drilled down to trading systems is what I'm after.

I'm real slow and stupid; high level stuff goes right over my head.

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


if you hover over the controls, you should see a short description of what each one does...

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)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

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 02:24 AM.

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-15 in 0.12 seconds with 20 queries on phoenix via your IP 54.226.132.197