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,717 / 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, 2009, 09:17 PM   #1 (permalink)
Elite Member
USA
 
Trading Experience: Master
Platform: NinjaTrader
 
caprica's Avatar
 
Posts: 157 since Jul 2009
Thanks: 45 given, 91 received

Van Tharp's SQN (system quality number)

Hello. I just uploaded this to the Ninja Strategies section. It is really a unique method to optimize your strategies on.

This is Van Tharp's System Quality Number (SQN) optimizer type for NinjaTrader. Place the SQN.cs file in your Documents\NinjaTrader 6.5\bin\custom\Type directory and then exit and reload Ninja.

Here is information from Ragingbull on SQN:

Quoting 
The only way to seriously qualify and optimize any system is through its System Quality Number (SQN). I advice you to refer to Van Tharp for reference on the subject.

Assuming a set of N trades (N>30 for being statistically significant), SQN is defined as follow:

SQN= Squareroot(N) * Average (of the N Profit&Loss) / Std dev (of the N Profit&Loss).

The large the N, the more trading opportunities you have.
The large the average P&L, the better you are obviously.
The smaller the Std dev (P&L), the more regular are your results and the smaller are the drawdowns.

Note here that if you optimize for the largest SQN, you maximize in fact the product N*average P&L and you minimize the Std dev (P&L) and the drawdowns at the same time.

This is exactly what all good traders should be looking for their system.

The code itself was written by Pete S all credit to him.

If you want more information on the SQN (System Quality Number) or Van Tharp you can look here:
Definitive Guide to Position Sizing

To use this you need to use Strategy Analyzer and change your "Optimize on..." selection to "my system quality number". This is where you normally choose max net profit, or max profit factor, etc.

Download the file here:
http://forum.bigmiketrading.com/free_downloads/ninjatrader/strategies/99-download.html?view

"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain


Last edited by caprica; July 27th, 2009 at 09:29 AM.
Reply With Quote
     
The following 2 users say Thank You to caprica for this post:
     

Old July 25th, 2009, 11:28 PM   #2 (permalink)
Elite Member
USA
 
Trading Experience: Master
Platform: NinjaTrader
 
caprica's Avatar
 
Posts: 157 since Jul 2009
Thanks: 45 given, 91 received

Here is a brief PDF that is a sample only of the table of contents from the publisher of Van Tharp's book "Definitive Guide to Position Sizing", to whet your appetitive and interest you in purchasing this book.

Attached Thumbnails
Van Tharp's SQN (system quality number)-table-contents-definitive-guide.pdf  
Reply With Quote
     

Old September 11th, 2010, 08:24 AM   #3 (permalink)
Just starting out...
Norway
 
Trading Experience: Beginner
Platform: Ninja
 
Posts: 6 since Jun 2009
Thanks: 1 given, 1 received

SQN for ninja 7


Hi

Do you have SQN update for ninja 7
thanks
regards

Reply With Quote
     

Old September 11th, 2010, 11:19 AM   #4 (permalink)
Elite Member
Santa Maria
 
Trading Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker/Data: Mirus/Zen-Fire
Favorite Instrument: ES
 
Posts: 295 since May 2010
Thanks: 101 given, 307 received


kekkis View Post
...Do you have SQN update for ninja 7...

I'd suggest you see:
https://www.bigmiketrading.com/ninjatrader-programming/4979-system-optimization-fitness-functions.html#post56256

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

Old October 6th, 2011, 04:12 AM   #5 (permalink)
trading my rent money
Tokyo, Japan
 
Trading Experience: Intermediate
Platform: NT7
Favorite Instrument: GC
 
pengi's Avatar
 
Posts: 35 since Jan 2011
Thanks: 26 given, 36 received

Current BMT User Poll

Should sim traders that pretend to trade cash be allowed on BMT?

 

caprica View Post
SQN = Squareroot(N) * Average (of the N Profit&Loss) / Std dev (of the N Profit&Loss).

Hi @caprica,

Thanks for your contribution towards helping everyone optimize their systems for SQN. I'm a big fan of Tharp's work as well.

However, I believe the formula you posted above is incorrect, or at least flawed in a big way.

From what I understand, Tharp basis is the risk of each trade, which he calls R. He uses the R-multiple of trades to calculate the SQN. However, the formula you posted doesn't use R at all. Since you are going by what someone else posted, I want to ask you to double check this. Please consider the following method of how I calculate the SQN for my trades. It's my interpretation of Tharp's words, but I may be wrong as well. What do you think?

1) Calculate R, how much you risk per trade. For example, if you risk 2% of your account on each trade, and you have a $10k account, R would be 200.

2) Calculate the R-multiple of each trade. For example, if R is 200 and a given trade had a net profit of 400, then the trade's R-multiple was 2. If it lost 200, then the R-multiple for that trade is -1.

3) Calculate E, the expectancy of the system. I interpret this to be the average R-multiple of all trades. If your system has a positive expectancy, this should be greater than zero.

4) Calculate SQN, the ratio of E to the standard deviation of the R multiples dataset in step 2.

Reply With Quote
     

Old October 18th, 2011, 01:49 PM   #6 (permalink)
Trading Apprentice
United Arab Emirates
 
Trading Experience: Intermediate
Platform: Multicharts
Favorite Instrument: Futures
 
Posts: 2 since Oct 2011
Thanks: 0 given, 0 received

Hey

I want to understand how to build up a system as VAN TAHRP talks about low risk idea.

Reply With Quote
     

Old July 24th, 2012, 11:16 PM   #7 (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,137 since Jun 2009
Thanks: 20,735 given, 38,109 received

@Luger,

Regarding the SQN*maxprofit you shared. Years ago I used a similar scoring system, but it also weighted based on trade frequency as well as long vs short. I am having trouble finding my old Optimizer Type code, so thought I would ask if you would code this, since I am so rusty with NT.

The idea is to expand on your SQN*maxprofit, adding:

1) Higher score for more trades per day. I value this because I believe if a system has a true edge, then greater frequency can demonstrate that edge by beating out slippage and commissions, and fight curve fitting.

2) Weight score based on Long vs Short performance. For example, if Long's account for 80% of profit, then this would score badly. Optimal would be 50/50.

Thank you kindly, if you could do this for me.

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 2 users say Thank You to Big Mike for this post:
     

Old July 24th, 2012, 11:31 PM   #8 (permalink)
Fortitudo et Honor
Austin, TX
 
Trading Experience: Advanced
Platform: TradeStation
Favorite Instrument: Futures
 
Posts: 882 since Mar 2011
Thanks: 128 given, 647 received


Big Mike View Post
@Luger,

Regarding the SQN*maxprofit you shared. Years ago I used a similar scoring system, but it also weighted based on trade frequency as well as long vs short. I am having trouble finding my old Optimizer Type code, so thought I would ask if you would code this, since I am so rusty with NT.

The idea is to expand on your SQN*maxprofit, adding:

1) Higher score for more trades per day. I value this because I believe if a system has a true edge, then greater frequency can demonstrate that edge by beating out slippage and commissions, and fight curve fitting.

2) Weight score based on Long vs Short performance. For example, if Long's account for 80% of profit, then this would score badly. Optimal would be 50/50.

Thank you kindly, if you could do this for me.

Mike

Mike, I agree with your effort to sanity check the system and ensure that it's not long or short biased, but how do you account for the dataset bias?

If you were to take an data set for CL from the highs of 2008 till today, featuring a trend trading system, obviously you're going to generate more profit on the short side, simply because the entire market moved short a great deal (macro) from then till now.

I guess I would prefer to use the long/short ratios as a sanity check or post analysis screening criteria rather than an evaluation criteria (depending on the system's approach).

I do the same thing for profit distributions. Rarely (if ever) is a system able to hit high marks on every criteria (drawdown, expectancy, trade sample size, etc) and I find that some systems, I largely rejected simply because it earned too high of a profit% in a couple of months during the sample. Obviously, we'd all love a consistent profit distribution where every month is similar. But in reality, the markets don't feed us that way, and it's difficult to massage a system to vary depending on the market conditions (sometimes).

So now I look at the distributions and as long as all the profit isn't in one or 2 months AND there's little to no negative months, then that's okay. I call it the "fishing" centric systems, that wait (patiently) for those few time periods that really kill it, then during the other time periods they either hold flat or lose a very small amount.

Obviously that's asking a lot (for a trader to sit and fish for months waiting on the whopper months) but it's exactly what a lot of Fundamental traders do. There are a lot of fundamental traders that will make their whole year based on a couple of good months. Which really capitalizes on the concept of big winners and tiny losers.

"A dumb man never learns. A smart man learns from his own failure and success. But a wise man learns from the failure and success of others."
Reply With Quote
     
The following user says Thank You to RM99 for this post:
     

Old July 24th, 2012, 11:48 PM   #9 (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,137 since Jun 2009
Thanks: 20,735 given, 38,109 received


RM99 View Post
Mike, I agree with your effort to sanity check the system and ensure that it's not long or short biased, but how do you account for the dataset bias?

Yes absolutely. I basically write two kinds of strategies, small time frame and big time frame. For the small time frame system I believe the 50/50 split is realistic because the amount of time in the market is minimal per trade, it is not influenced heavily by bigger trends.

I wish I could find my old code, I spent a huge amount of time developing that optimizer type just the way I wanted it. It is in a backup file somewhere.

I cannot remember all the reserve keywords with NT, so am having trouble remembering how I had mine set up.

If there are 100 trades total, 50 long, 50 short, but the 50 longs account for 80% of the profit, I want this to score badly. My strategy is not written well if it takes 50 short trades that only account for 20% of the profit compared to long trades.

I had a lot of code in my optimizer setup to prevent curve fitting. I also prefer to optimize against huge data sets, multi-year of tick data, with thousands of trades per year. I'll keep digging for it.

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, 08:50 AM   #10 (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 View Post
@Luger,

Regarding the SQN*maxprofit you shared. Years ago I used a similar scoring system, but it also weighted based on trade frequency as well as long vs short. I am having trouble finding my old Optimizer Type code, so thought I would ask if you would code this, since I am so rusty with NT.

The idea is to expand on your SQN*maxprofit, adding:

1) Higher score for more trades per day. I value this because I believe if a system has a true edge, then greater frequency can demonstrate that edge by beating out slippage and commissions, and fight curve fitting.

2) Weight score based on Long vs Short performance. For example, if Long's account for 80% of profit, then this would score badly. Optimal would be 50/50.

Thank you kindly, if you could do this for me.

Mike

I will take a detailed look this evening. #2 should not be hard, with #1 I will have to figure out how to get a proper day count.

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 10:57 AM.

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-21 in 0.19 seconds with 20 queries on atlantis via your IP 54.227.156.177