Van Tharp's SQN (system quality number) - futures io
futures io



Van Tharp's SQN (system quality number)


Discussion in Psychology and Money Management

Updated
      Top Posters
    1. looks_one Big Mike with 9 posts (2 thanks)
    2. looks_two Luger with 5 posts (9 thanks)
    3. looks_3 Sandpaddict with 4 posts (2 thanks)
    4. looks_4 Wikmar with 3 posts (3 thanks)
      Best Posters
    1. looks_one Shivaya with 2 thanks per post
    2. looks_two Luger with 1.8 thanks per post
    3. looks_3 caprica with 1.5 thanks per post
    4. looks_4 Wikmar with 1 thanks per post
    1. trending_up 31,273 views
    2. thumb_up 24 thanks given
    3. group 31 followers
    1. forum 42 posts
    2. attach_file 5 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Van Tharp's SQN (system quality number)

(login for full post details)
  #21 (permalink)
 NJAMC 
Atkinson, NH USA
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
 
NJAMC's Avatar
 
Posts: 1,970 since Dec 2010
Thanks: 3,036 given, 2,379 received


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

Hi @Luger,

Not sure if it still matters, but happen to be pointed to this thread for your PEC, but in the Loop, it appears this is scanning for a parameter named "SQNMinTrades", when if finds the parameter, it sets minTrades equal to that value and the bails out of the loop with the break statement. So, if there are 100+ parameters, and the 2nd parameter is found to be "SQNMinTrades" it retrieves the value and then exits the For loop, saving 98 or so useless comparisons as there is likely an assumption the parameter is unique int he list.

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my futures io Trade Journal Reply With Quote

 
 
(login for full post details)
  #22 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,119 since Jun 2009
Thanks: 32,592 given, 98,694 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,

Would it be possible for you to make a small edit to these please?

I need to discard runs that result in an "Infinity" score, ie 100% percent profitable. What's happening is sometimes the optimizer is finding a magic combination that gives it extremely low trade frequency (ie 50 trades) but 100% winners, and it's overriding the trades I really want (ie 5,000 trades @ 40%).

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #23 (permalink)
 Outlier 
Germany
 
Experience: Advanced
Platform: TradeStation
Trading: Futures
 
Posts: 88 since May 2012
Thanks: 53 given, 93 received



Big Mike View Post
@Luger,

Would it be possible for you to make a small edit to these please?

I need to discard runs that result in an "Infinity" score, ie 100% percent profitable. What's happening is sometimes the optimizer is finding a magic combination that gives it extremely low trade frequency (ie 50 trades) but 100% winners, and it's overriding the trades I really want (ie 5,000 trades @ 40%).

Mike

I'd rather implement a minimum number of trades requirement for this type of fitness function. Not dependent on the number of parameters, that doesn't make sense to me, just a user provided value.

Reply With Quote
 
(login for full post details)
  #24 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,119 since Jun 2009
Thanks: 32,592 given, 98,694 received


Outlier View Post
I'd rather implement a minimum number of trades requirement for this type of fitness function. Not dependent on the number of parameters, that doesn't make sense to me, just a user provided value.

I am not aware that NT7 has that capability, to pass a user value to the Fitness test. If it does, that would be fine by me as well.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #25 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,119 since Jun 2009
Thanks: 32,592 given, 98,694 received

New thread for Optimizer Types



Will update more later.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #26 (permalink)
agustinfga
Monterrey Mexico
 
 
Posts: 2 since May 2016
Thanks: 0 given, 0 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.

Is there an update of this metric or optimizer fitness for nt8?

Can somebody do that? I have tried but I don't I have enough experience or undestanding

Reply With Quote
 
(login for full post details)
  #27 (permalink)
agustinfga
Monterrey Mexico
 
 
Posts: 2 since May 2016
Thanks: 0 given, 0 received

Do you have an update for NĦinjaTrader 8?

Reply With Quote
 
(login for full post details)
  #28 (permalink)
nivi
Madrid, Spain
 
 
Posts: 30 since Feb 2017
Thanks: 4 given, 6 received

Hello,

I am looking for SQN.cs for NT8. I want to optimize by the SQN ratio with NT8, but I can't find this document anywhere.

Thanks.

Reply With Quote
 
(login for full post details)
  #29 (permalink)
alex224
Madrid
 
 
Posts: 2 since Nov 2018
Thanks: 0 given, 0 received


nivi View Post
Hello,

I am looking for SQN.cs for NT8. I want to optimize by the SQN ratio with NT8, but I can't find this document anywhere.

Thanks.

Hi NIVI

Did you find SQN.cs for NT8?

Thanks

Reply With Quote
 
(login for full post details)
  #30 (permalink)
nivi
Madrid, Spain
 
 
Posts: 30 since Feb 2017
Thanks: 4 given, 6 received


Hello,
I did not find that code.

Some months have passed, I have discovered several important failures in NT8, and also in MultiCharts, and also in other trading programs.

Finally I made the decision to create my own analysis program. I do studies and analysis using only excel.

Soon I will create another excel to launch operations of my real broker account.

Reply With Quote


futures io Trading Community Psychology and Money Management > Van Tharp's SQN (system quality number)


Last Updated on May 12, 2021


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing

Your Trading Jekyll and Hyde w/Peter Davies @ Jigsaw Trading

Elite only
 

Our 12-year anniversary w/ $$,$$$ prizes (check soon)

June
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), 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