Big Mike's Trading Forum
 

Go Back   Big Mike's Trading Forum

> Trading Forums > Psychology and Money Management


Notices
     

Van Tharp's SQN (system quality number)
Started:July 25th, 2009 (09:17 PM) by caprica Views / Replies:8,698 / 24
Last Reply:February 9th, 2013 (10:42 PM) Attachments:5

Welcome to Big Mike's Trading Forum.

Welcome, Guest!

This forum was established to help traders by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

BMT is fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • 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, and we will never resell your private information.

-- Big Mike
     

Reply
 5  
 
Thread Tools Search this Thread

Van Tharp's SQN (system quality number)

Old July 25th, 2012, 08:29 PM   #11 (permalink)
Fiddler
Nashville, TN
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Instrument: NQ ES
 
Posts: 425 since Feb 2011
Thanks: 284 given, 469 received

@Big Mike

I am attaching your requested optimizer type. The new score considers Max Profit, SQN, Trades per Day, and the ratio of Long Profit to Short Profit.

There is one variable in there for the Long/Short Profit that is easy to change. I was not sure how sensitive you wanted this metric to be. I left comments in explaining.

//This value represents the floor to a divisor representing long short profit split
//0.1 = (60/40 split = 50/50 split = 40/60 split) performance would be halved at (70/30, 30/70)
//For a value of 0.05 (55/45 split = 50/50 split = 45/55 split)
//performance would be halved at (60/40, 40/60)
double rngLongShortBalance = 0.1;
//Actual calculation so that you can see what I am dividing by in the final output.
double rngLSbalance = Math.Max(rngLongShortBalance, Math.Abs(0.5 - (totLongProfit / totProfit)));

Basically, I thought you could use that variable to to set your own acceptable range outside of which there are reductions in the final score.

Otherwise the final score looks like this:

(SQN * Max Profit * Trades per Day) / (Long Short Ratio derivative)

To install place attached file in:
NinjaTrader7\bin\Custom\Type
Open Ninja Trader editor and compile any indicator or strategy

I am also going to take a look at the idea you mentioned about variation around a smooth upward sloping profit line as a possible improvement to the SQN number. Right now I can't visualize if that is going to be an improvement or end up causing problems somewhere.

Attached Files
Register to download File Type: cs SQNlsprofitbalancetraderate.cs (3.8 KB, 50 views)
Reply With Quote
     
The following 3 users say Thank You to Luger for this post:
     

Old July 25th, 2012, 08:32 PM   #12 (permalink)
Administrator: 'da Big Dawg
Manta, Ecuador
 
Trading Experience: Advanced
Platform: My own custom solution
Favorite Instrument: SP500, Stocks
 
Big Mike's Avatar
 
Posts: 31,115 since Jun 2009
Thanks: 20,722 given, 38,012 received


Luger View Post
@Big Mike

I am attaching your requested optimizer type. The new score considers Max Profit, SQN, Trades per Day, and the ratio of Long Profit to Short Profit.

There is one variable in there for the Long/Short Profit that is easy to change. I was not sure how sensitive you wanted this metric to be. I left comments in explaining.

//This value represents the floor to a divisor representing long short profit split
//0.1 = (60/40 split = 50/50 split = 40/60 split) performance would be halved at (70/30, 30/70)
//For a value of 0.05 (55/45 split = 50/50 split = 45/55 split)
//performance would be halved at (60/40, 40/60)
double rngLongShortBalance = 0.1;
//Actual calculation so that you can see what I am dividing by in the final output.
double rngLSbalance = Math.Max(rngLongShortBalance, Math.Abs(0.5 - (totLongProfit / totProfit)));

Basically, I thought you could use that variable to to set your own acceptable range outside of which there are reductions in the final score.

Otherwise the final score looks like this:

(SQN * Max Profit * Trades per Day) / (Long Short Ratio derivative)

To install place attached file in:
NinjaTrader7\bin\Custom\Type
Open Ninja Trader editor and compile any indicator or strategy

I am also going to take a look at the idea you mentioned about variation around a smooth upward sloping profit line as a possible improvement to the SQN number. Right now I can't visualize if that is going to be an improvement or end up causing problems somewhere.

You rock!

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
     

Old July 25th, 2012, 09:49 PM   #13 (permalink)
Fiddler
Nashville, TN
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Instrument: NQ ES
 
Posts: 425 since Feb 2011
Thanks: 284 given, 469 received


I am attaching the Perfect Equity Curve (PEC) variants as well.

PEC
PEC * Max Profit
(PEC * Max Profit * Trades per Day) / (Long Short ratio derivative)

I would stay with the SQN and variants. The PEC versions truly do favor smoother curves at the expense of many other considerations. This ended up mostly an academic exercise, and I am posting just for anyone that is curious. Though I guess it could be used to check a smaller optimization field once the larger population has been narrowed down.

For example, I optimized one variable on my bot with just PEC. Usually the top few choices run from 58k-63k profit. Pure PEC gave me 22k for the first three, then got to some in the mid to upper 50k.

Attached Files
Register to download File Type: cs PEC.cs (2.2 KB, 40 views)
Register to download File Type: cs PECmaxprofit.cs (2.4 KB, 30 views)
Register to download File Type: cs PEClsprofitbalancetraderate.cs (3.9 KB, 28 views)
Reply With Quote
     
The following 4 users say Thank You to Luger for this post:
     

Old July 25th, 2012, 09:57 PM   #14 (permalink)
Administrator: 'da Big Dawg
Manta, Ecuador
 
Trading Experience: Advanced
Platform: My own custom solution
Favorite Instrument: SP500, Stocks
 
Big Mike's Avatar
 
Posts: 31,115 since Jun 2009
Thanks: 20,722 given, 38,012 received


Luger View Post
I am attaching the Perfect Equity Curve (PEC) variants as well.

PEC
PEC * Max Profit
(PEC * Max Profit * Trades per Day) / (Long Short ratio derivative)

I would stay with the SQN and variants. The PEC versions truly do favor smoother curves at the expense of many other considerations. This ended up mostly an academic exercise, and I am posting just for anyone that is curious. Though I guess it could be used to check a smaller optimization field once the larger population has been narrowed down.

For example, I optimized one variable on my bot with just PEC. Usually the top few choices run from 58k-63k profit. Pure PEC gave me 22k for the first three, then got to some in the mid to upper 50k.

Thanks for this. What kind of sample size and trade frequency did you use in your test? I can imagine the fewer the trades, the more this will not make any sense.

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
     

Old July 25th, 2012, 10:14 PM   #15 (permalink)
Fiddler
Nashville, TN
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Instrument: NQ ES
 
Posts: 425 since Feb 2011
Thanks: 284 given, 469 received

It was small numbers compared to what I know you are planning...lol

Range was from 60 to 170 trades for those weird results. The PEC results in general, even for the variants, are certainly much more rigid than SQN. Instead of comparing to trade results to average profit and compiling, you are comparing current cumulative profit to where current cumulative profit should be based on average profit (average profit * trade number) and compiling. Effectively the variance can accrue trade to trade.

Reply With Quote
     

Old July 27th, 2012, 01:02 AM   #16 (permalink)
Administrator: 'da Big Dawg
Manta, Ecuador
 
Trading Experience: Advanced
Platform: My own custom solution
Favorite Instrument: SP500, Stocks
 
Big Mike's Avatar
 
Posts: 31,115 since Jun 2009
Thanks: 20,722 given, 38,012 received


Luger View Post
I am attaching the Perfect Equity Curve (PEC) variants as well.

PEC
PEC * Max Profit
(PEC * Max Profit * Trades per Day) / (Long Short ratio derivative)

I would stay with the SQN and variants. The PEC versions truly do favor smoother curves at the expense of many other considerations. This ended up mostly an academic exercise, and I am posting just for anyone that is curious. Though I guess it could be used to check a smaller optimization field once the larger population has been narrowed down.

For example, I optimized one variable on my bot with just PEC. Usually the top few choices run from 58k-63k profit. Pure PEC gave me 22k for the first three, then got to some in the mid to upper 50k.

So far the PEC model seems to be performing very well. I am still wet behind the ears when it comes to Ninja and C#, I am having to re-learn stuff all over again after being out of it for years. But it seems that your code works. Once I get some more complex strategies converted, I'll know for sure

In my testing, the PEC model produces quicker [genetic time] and more desirable results than the other SQN types you provided.

Looking forward to it, and really want to thank you again.

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
     

Old July 27th, 2012, 08:57 AM   #17 (permalink)
Elite Member
Newcastle, Australia
 
Trading Experience: Intermediate
Platform: Multicharts 8 - Full Version
Broker/Data: IB
Favorite Instrument: SPI,FTSE100, 6E, 6A
 
Posts: 276 since Oct 2010
Thanks: 104 given, 164 received

Hi
Im very interested in this topic but Im a multicharts user.
Would you have this code in a pseudo form so that I can generate easylanguage code?

Regards,
Neil.

Reply With Quote
     

Old July 27th, 2012, 05:46 PM   #18 (permalink)
Administrator: 'da Big Dawg
Manta, Ecuador
 
Trading Experience: Advanced
Platform: My own custom solution
Favorite Instrument: SP500, Stocks
 
Big Mike's Avatar
 
Posts: 31,115 since Jun 2009
Thanks: 20,722 given, 38,012 received


NW27 View Post
Hi
Im very interested in this topic but Im a multicharts user.
Would you have this code in a pseudo form so that I can generate easylanguage code?

Regards,
Neil.

The source was posted already, MultiCharts uses C# for its optimizer type thing (whatever it is called). They don't document anything, so good luck finding the right keywords. It is not EasyLanguage.

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
     

Old July 27th, 2012, 09:45 PM   #19 (permalink)
Elite Member
Cincinnati Ohio
 
Trading Experience: Intermediate
Platform: NinjaTrader / Sierra Charts
Broker/Data: T4
Favorite Instrument: CL
 
Silver Dragon's Avatar
 
Posts: 1,392 since Feb 2011
Thanks: 2,530 given, 2,594 received


Luger View Post
I am attaching the Perfect Equity Curve (PEC) variants as well.

PEC
PEC * Max Profit
(PEC * Max Profit * Trades per Day) / (Long Short ratio derivative)

I would stay with the SQN and variants. The PEC versions truly do favor smoother curves at the expense of many other considerations. This ended up mostly an academic exercise, and I am posting just for anyone that is curious. Though I guess it could be used to check a smaller optimization field once the larger population has been narrowed down.

For example, I optimized one variable on my bot with just PEC. Usually the top few choices run from 58k-63k profit. Pure PEC gave me 22k for the first three, then got to some in the mid to upper 50k.

@Luger

Trying to understand the code; What does this part of the code do?

SD

 
Code
for (n = 0; n < Strategy.Parameters.Count; n++)
		{
		if ("SQNMinTrades".CompareTo(Strategy.Parameters[n].Name) == 0)
			{
				minTrades = (int)Strategy.Parameters[n].Value;
				break;
			}

nosce te ipsum
Life's real failure is when you do not realize how close you were to success when you gave up.
Reply With Quote
     

Old July 27th, 2012, 10:23 PM   #20 (permalink)
Fiddler
Nashville, TN
 
Trading Experience: Intermediate
Platform: NinjaTrader
Broker/Data: IB
Favorite Instrument: NQ ES
 
Posts: 425 since Feb 2011
Thanks: 284 given, 469 received



Silver Dragon View Post
@Luger

Trying to understand the code; What does this part of the code do?

SD

 
Code
for (n = 0; n < Strategy.Parameters.Count; n++)
		{
		if ("SQNMinTrades".CompareTo(Strategy.Parameters[n].Name) == 0)
			{
				minTrades = (int)Strategy.Parameters[n].Value;
				break;
			}

It was in the original SQN code so I left it. If there are less than 30 trades, then SQN returns zero due to too small of a sample. I think that part also checks the number of parameters in the strategy and if there are more than 30, then that number becomes the floor.

I could be totally wrong. It would be nice to have someone who is a better coder to evaluate that section because it may just be wasting cpu cycles.

Reply With Quote
     
The following user says Thank You to Luger for this post:
     

Reply



Tags
account, ai, big mike, book, calls, change, cl, code, color, combination, credit, custom, cycles, day, demo, downloads, drawdown, edge, exit, expectancy, file, fishing, fitness, formula, free, functions, greater than, guide, how to, indicator, indicators, interest, lot, low, maximize, maxprofit, method, ml, multicharts, multiple, ninja, ninja 7, ninjatrader, nt, optimization, optimizer, percent, performance, plan, position sizing, position_sizing, profit, profitable, programming, reload, risk, sample, screening, setup, slippage, small, split, square_of_nine, standard deviation, strategies, strategy, system, systems, testing, thank you, tharp, tick data, time, trade, trader, traders, trades, trading, trend, trend trading, type, update, van tharp
     

Big Mike's Trading Forum > Trading Forums > Psychology and Money Management > Van Tharp's SQN (system quality number)

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads
Thread Thread Starter Forum Replies Last Post
Van Tharp Books Dusty909 Psychology and Money Management 11 February 21st, 2014 01:11 PM
Van Tharp's Max Expectancy caprica Psychology and Money Management 30 February 20th, 2014 02:21 PM
Position Sizing by Van Tharp Laserdan Psychology and Money Management 21 July 8th, 2011 10:37 AM
System Quality Number for MC? WayneA EasyLanguage Programming 5 July 21st, 2010 08:09 AM
What Type Trader Are You? - more from Van Tharp Trader.Jon Psychology and Money Management 0 November 12th, 2009 08:47 AM


All times are GMT -4. The time now is 05:53 PM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2014 by Big Mike Trading. 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 2014-04-16 in 0.13 seconds with 20 queries on atlantis via your IP 54.198.34.238