Position Sizing by Van Tharp - futures io
futures io



Position Sizing by Van Tharp


Discussion in Psychology and Money Management

Updated
      Top Posters
    1. looks_one MXASJ with 6 posts (20 thanks)
    2. looks_two Laserdan with 6 posts (7 thanks)
    3. looks_3 Big Mike with 3 posts (5 thanks)
    4. looks_4 vio1965 with 2 posts (2 thanks)
      Best Posters
    1. looks_one Prtester with 5 thanks per post
    2. looks_two MXASJ with 3.3 thanks per post
    3. looks_3 Big Mike with 1.7 thanks per post
    4. looks_4 Laserdan with 1.2 thanks per post
    1. trending_up 19,342 views
    2. thumb_up 43 thanks given
    3. group 9 followers
    1. forum 21 posts
    2. attach_file 3 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
 

Position Sizing by Van Tharp

(login for full post details)
  #1 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received

I am reading Tharp's book and am really interested in position sizing.
I am keenly interested in the Percent Volatility Model he presnts in his book Trade your way to financial freedom


Here is an excerpt from the book:
Quoting 
MODEL 4: THE PERCENT VOLATILITY MODEL
Volatility refers to the amount of daily price movement of the underlying instrument over an arbitrary period of time. It’s a direct measurement of the price change that you are likely to be exposed to-for or against you-in any given position. If you equate the volatility of each position that you take, by making it a fixed percentage of your equity, then you are basically equalizing the possible market fluctuations of each portfolio element to which you are exposing yourself in the immediate future.

Volatility, in most cases, simply is the difference between the
high and the low of the day. If IBM varies between 141 and 143%
then its volatility is 2.5 points, However, using an average true range takes into account any gap openings. Thus, if IBM closed at


139 yesterday, but varied between 141 and 143% today, you’d need

to add in the 2 points in the gap opening to determine the true
range. Thus, today’s true ranges is between 139 and 143’&or 4%
points. This is basically Wells Wilder’s average true range calculation
as shown in the definitions~at the end of the book.
Here’s how a percent volatility calculation might~work for
position sizing. Suppose that you have $50,000 in your account and
you want to buy gold. Let’s say that gold is at $400 per ounce and
during the last 10 days the daily range is $3. We will use a IO-day
simple moving average of the average true range as our measure of
volatility. How many gold contracts can we buy?
Since the daily range is $3 and a point is worth $100 (i.e., the
contract is for 100 ounces), that gives the daily volatility a value of
$300 per gold contract. Let’s say
that we are going to allow volatility



to be a maximum of 2 percent of our equity. Two percent of

$50,000 is $1,000. If we divide our $300 per contract fluctuation into



our allowable limit of $1,000, we get 3.3 contracts. Thus, our position-

sizing model, based on volatility, would allow us to purchase



3 contracts.




What i was hoping that someone would write this up in code for the community to use in their strategies.

Follow me on Twitter Started this thread Reply With Quote
The following 4 users say Thank You to Laserdan for this post:

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(84 thanks from 14 posts)
looks_twoSalao's Journalby Salao
(30 thanks from 7 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(26 thanks from 9 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(13 thanks from 8 posts)
looks_5Maybe a little bit different journalby Malykubo
(7 thanks from 5 posts)
 
 
(login for full post details)
  #2 (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: 49,975 since Jun 2009
Thanks: 32,441 given, 98,184 received

Nice post. I moved to Money Management section. I will come back to this post as soon as I have some time, I am actually working on money management scenarios right now in Ninja (backtesting).

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
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #3 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received


thanks mike...I thought i posted it in the correct forum, but I guess it belongs here.

As for position sizing, it is the most important thing about makin money!

Hopefully people will share their posiion sizing algos, or if they dont have one, then lets develop one as a group.

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

I've got a spreadsheet that looks at 14 day ATR, equity dedicated to a particular instrument, and instrument tick size. It then calculates your position size (# contracts) based on the time frame you are trading.

Let me clean it up and I'll post it here later today.

Reply With Quote
The following user says Thank You to MXASJ for this post:
 
(login for full post details)
  #5 (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: 49,975 since Jun 2009
Thanks: 32,441 given, 98,184 received

Well, I spent some time trying to code up the average true range of the last three days, and then look at the range for the current day.

What I did was use the CurrentDayOHL().High and .Low dataseries and then save the previous values and average them together to get a three day average range.

Then I measured the Opening price of today vs the current price, to see how much range we've moved right "now". I also tried measuring against how much we've moved higher vs. how high we normally move to gauge the "room" left in a move, and how much we've moved lower.

I must say, I failed. The code just wasn't working. I believe it is because the strategy I am using it on is a multi-time frame strategy and also only trades certain hours of the day. Having multi-time frame made the DataSeries variables much more complex, having to rely on CurrentBar and bars.SessionBreak etc. Then having it only trade certain hours of the day further complicated things, because there were gaps in the data from the hours it wasn't trading.

So. I am hoping someone else will step up with their method.

I am using Zen Fire, so for the day range I considered using a 1440 minute bar but later changed it to 60 minute because of problems I was experiencing with CurrentDayOHL().

Maybe someone can come at this a different direction. I would like to employ these types of risk assessments in my rule book.

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)
  #6 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

I owe this thread a spreadsheet which I'll post later today. Been busy learning Ninja Script . Also adding a Kelly formula to the spreadsheet.

FWIW I look at the ATR and put it manually into the spreadsheet every few weeks or whenever I think there has been a important change in volatility, and for the hours I trade (2am to 11:30am EST) there are two distinct ranges... volatility increases significantly at 0930am EST (duh!). I've been using a mean of my entire trading session and get stopped out more than I like during NYSE mornings.

Mike if you are calculating rolling daily ATR and trading cash hours, perhaps you need to only use futures data from cash hours for the ATR calculation? I.E. the gaps are a part of how much more "move" is left in the move. Just a thought as I work on my first coffee of the day...

Reply With Quote
The following 2 users say Thank You to MXASJ for this post:
 
(login for full post details)
  #7 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

Here you go. A JPEG and a Excel spreadsheet. Top part is based on how much you are prepared to risk per trade (2% of equity in this case), what the 14 period ATR is for the timeframe you are trading, and what your stop loss point is as ATR. It looks at margin as well and gives you the lower number of the two (contracts tradeble under stop loss rules vs. margin rules).

I've added a Kelly formula underneath. Please check the math on that first!

Critique it, change it, and post it back if you find it useful.

Attached Thumbnails
Click image for larger version

Name:	PositionSize.JPG
Views:	570
Size:	82.9 KB
ID:	694  
Attached Files
Register to download File Type: xlsx PositionSize.xlsx (10.9 KB, 444 views)
Reply With Quote
The following 14 users say Thank You to MXASJ for this post:
 
(login for full post details)
  #8 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received

Thank you

Now if we can get this into Ninja Trader to auto check acct balance...

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #9 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

Does your account balance change enough intraday to affect the number of contracts you can trade? Ouch!

The one thing I'm looking at is running different strats from 0200-0930 and 0930-1130 as the ATR changes from about 0.9 to about 2.0... so in theory I'm trading smaller size and with wider stops during the NYSE morning.

Otherwise that's a spreadsheet I don't need to look at too often unless there has been a significant change in my account equity or in market volatility.

Reply With Quote
The following user says Thank You to MXASJ for this post:
 
(login for full post details)
  #10 (permalink)
 Prtester 
SE-Asia
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Amp
Trading: ES
 
Posts: 148 since Jun 2009
Thanks: 64 given, 122 received


Some time ago i post some example in the NT Forum, but don't develop any further, if someone interested, we can make it here.

Position Size Algorithm - NinjaTrader Support Forum

Reply With Quote
The following 5 users say Thank You to Prtester for this post:
 
(login for full post details)
  #11 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received


Quoting 
Does your account balance change enough intraday to affect the number of contracts you can trade?

lol...no, but it would be nice to allocate different amounts per instrument, so set it in the strategey options, when running multi strats

Follow me on Twitter Started this thread Reply With Quote
 
(login for full post details)
  #12 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received


Prtester View Post
Some time ago i post some example in the NT Forum, but don't develop any further, if someone interested, we can make it here.

Position Size Algorithm - NinjaTrader Support Forum

Hey thanks...I will see what i can do...

Follow me on Twitter Started this thread Reply With Quote
The following user says Thank You to Laserdan for this post:
 
(login for full post details)
  #13 (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: 49,975 since Jun 2009
Thanks: 32,441 given, 98,184 received


Prtester View Post
Some time ago i post some example in the NT Forum, but don't develop any further, if someone interested, we can make it here.

Position Size Algorithm - NinjaTrader Support Forum


Here it is from Ninja forum:


Quoting 
This is the NT default sample crossover strategy with a simple Position Size algorithm, I use 2 type of Position Size, Fix percent and Kelly, please comment on it, remember be kind it’s free.

Maybe we can add some more Position Size method. If any want to jump in and help is welcome.

Possible enhancements: made the Position Algorithm a function to be call from any strategy. Add some scaling feature, etc.


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!
Attached Files
Register to download File Type: zip MACrossWMonMan.zip (3.5 KB, 60 views)
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #14 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

Would you really want a position size algo within a strategy? I could see its use when examining the best mix for a portfolio of strategies with known Sharpe ratios, etc... but then you would be reinventing MPT, VaR, etc.

Also... when one's $100K account becomes a $200K account, would you trade double the size or park that $100K profit where you would get the risk-free rate instead?

Where does one cross the boundary between trade risk management (a single bet) and portfolio management (cumulative results of prior bets combined with risk-managing future bets)?

Reply With Quote
 
(login for full post details)
  #15 (permalink)
 Laserdan 
North Carolina
 
Experience: Beginner
Platform: Ninja Trader
Broker: Ninja Trader Broker / Continuum
Trading: ES
 
Posts: 57 since Jun 2009
Thanks: 4 given, 57 received

What i plan to do is divide my account up into sections...Futures, Stocks and Forex. Trade multiple Strats at the same time. So lets say I want to trade $50,000 in each of those 3 categories.

I want to start a strategy and tell it that I have $50,000 to start with. Then lets say i run 2 strats on two different instuments: Oil with 1% risk and ES with 1.5% risk.

I think the Volitility Position sizing would be very useful.

I will work on it and share what i come up with. If there is anyhing out there that already does this and I am reinventing the wheel, let me know.

Either way, I will work on it and share my code with the group

Follow me on Twitter Started this thread Reply With Quote
The following 2 users say Thank You to Laserdan for this post:
 
(login for full post details)
  #16 (permalink)
 MXASJ 
Asia
 
Experience: Beginner
Platform: NinjaTrader, TOS
 
Posts: 798 since Jun 2009
Thanks: 109 given, 799 received

If you consider each strat to be an asset with a known standard deviation, Sharpe ratio, etc and what you are looking to do is work out an optimal position size for each asset in a basket of assets whose correllations are known or can be calculated, you are looking at Modern Portfolio Theory (MPT) by Markowitz. Your asset mix should land you on a point on the efficient frontier where you have the optimal risk/reward ratio. Google MPT&Markowitz and see if that is what you are looking for.

Excel might be a better application for building the model, with data on the strats coming from Ninja.

I haven't looked for it yet but if you can calculate correlation of a strat against, say, the SPX, that is handy for building an MPT-based basket. Metastock does that well.

Note MPT and several other theories have been hit over the past year because they rely on an assumed Guassian distribution of returns. Fat tail/black swan events are the enemy of Gaussian assumptions.

I've got a gazzilion books on this stuff so if you have a question fire away. If I don't know it I know where to look it up. Also, if anyone spots an error in my statements don't be shy and please do point it out.

Reply With Quote
The following 2 users say Thank You to MXASJ for this post:
 
(login for full post details)
  #17 (permalink)
 caprica 
USA
 
Experience: Master
Platform: NinjaTrader
 
caprica's Avatar
 
Posts: 155 since Jul 2009
Thanks: 45 given, 112 received

I just struck gold with this thread!!!! Finally, some people that pay attention to the important things in trading! Hello friends!!


Laserdan View Post
I am reading Tharp's book and am really interested in position sizing.
I am keenly interested in the Percent Volatility Model he presnts in his book Trade your way to financial freedom

Laserdan, a big thanks for starting this fantastic thread! Are you or anyone else using Van Tharp's SQN or max expectancy in your ninja strategies? I posted the code I have here earlier today. I do find the SQN the most valuable but the max expectancy can provide insight but is much harder to generate useful results with if you do not have a large data set.


MXASJ View Post
Here you go. A JPEG and a Excel spreadsheet. Top part is based on how much you are prepared to risk per trade (2% of equity in this case), what the 14 period ATR is for the timeframe you are trading, and what your stop loss point is as ATR. It looks at margin as well and gives you the lower number of the two (contracts tradeble under stop loss rules vs. margin rules).

I've added a Kelly formula underneath. Please check the math on that first!

Critique it, change it, and post it back if you find it useful.

Mxasj, great spreadsheet my man! I actually found this thread because I was going to post a position sizing spreadsheet and thought I better search first. Your spreadsheet is far superior.

I'm not keenly familiar with Kelly but it's a risk model is it not? From a brief search on the internets it would seem the Kelly model is similar to max expectancy, what is your interpretation of it and how do you use it in your strategies?


Prtester View Post
Some time ago i post some example in the NT Forum, but don't develop any further, if someone interested, we can make it here.

Position Size Algorithm - NinjaTrader Support Forum

Prtester, I am always interested in furthering money management capabilities inside of an ATS. I see you are also using Kelly ratio. Do you guys have a NT "Type" to optimize on Kelly? I'd like to compare it to Van Tharp's max expectancy. Prtester, I use scaling a great deal in my strategies and I'd like to know what your thoughts were for using the Kelly ratio. What was your overview of how it would work (nevermind the technical code to make it work).

Reply With Quote
The following user says Thank You to caprica for this post:
 
(login for full post details)
  #18 (permalink)
 caprica 
USA
 
Experience: Master
Platform: NinjaTrader
 
caprica's Avatar
 
Posts: 155 since Jul 2009
Thanks: 45 given, 112 received

I found this about Kelly Criterion ratio:
Money Management Using the Kelly Criterion

So the principal is useful directly to position sizing much more so than expectancy. Now I just need to see about getting it inside of Ninja, am hoping someone has done this work already.

I took one of my systems with about 120 trades, a 65% win ratio and a w/l of 1.3 and the ratio came back as 0.38. So I am not sure what practical use this number is really telling me at this point because I do not risk more than 2% per trade.

Maybe you seasoned Kelly guys can help me understand it more. I am always looking for new methods of refining strategies to make them more efficient.

Reply With Quote
The following user says Thank You to caprica for this post:
 
(login for full post details)
  #19 (permalink)
 TheRumpledOne 
Tucson, AZ
 
 
Posts: 418 since Aug 2009

TRADING IS SIMPLE:

* Price either goes up or down.
* No one knows what will happen next.
* Keep losses small and let winners run.
* POSITION SIZE = RISK / STOP LOSS
* The reason you entered has no bearing on the outcome of your trade.
* You can control the size of your loss (skill) but you can't control the size of your win (luck).
* You need to know when to pick up your chips and cash them in.

Do not make things complicated.

Account Balance = $1,000

Maximum Risk = 2% * Account Balance

Maximum Risk = 2% * $1,000 = $20

Example:

If you want to buy a stock and your risk is $20 with a stop loss of $0.20 per share, then you can trade 100 shares.

POSITION SIZE = RISK / STOP LOSS.

POSITION SIZE = $20 / $0.20 = 100

Simple.

Reply With Quote
 
(login for full post details)
  #20 (permalink)
vio1965
Kharkov
 
 
Posts: 3 since Jul 2011
Thanks: 0 given, 2 received

Hi , is there such TOS code (*.ts) or so to be embedded in TOS??? if yes please send it URL...

Reply With Quote
The following user says Thank You to vio1965 for this post:
 
(login for full post details)
  #21 (permalink)
 liquidcci 
Austin, TX
 
Experience: Master
Platform: ninjatrader, r-trader
Trading: NQ, CL
 
liquidcci's Avatar
 
Posts: 865 since Jun 2011
Thanks: 610 given, 1,070 received

I have an automated system but am afraid of using an algo to scale my position. I can see the benefits of using an algo but I don't want something to go wrong I end up with 50 contracts. Of course a good programmer could put in safe guards. I may do this at some point if I can come with something that above all is safe from an execution standpoint.

I do have a system for scaling but I increase or decrease contracts manually when adding strategy to chart. About the only thing I do manually.

"The day I became a winning trader was the day it became boring. Daily losses no longer bother me and daily wins no longer excited me. Took years of pain and busting a few accounts before finally got my mind right. I survived the darkness within and now just chillax and let my black box do the work."
Reply With Quote
The following 2 users say Thank You to liquidcci for this post:
 
(login for full post details)
  #22 (permalink)
vio1965
Kharkov
 
 
Posts: 3 since Jul 2011
Thanks: 0 given, 2 received

...thank you, but I mean only to make TOS code as embedded calculator because it is quite tedious to copy data to excel and back each time wile making order ....istn't there such TOS code???

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


futures io Trading Community Psychology and Money Management > Position Sizing by Van Tharp


Last Updated on July 8, 2011


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 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