Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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:
What i was hoping that someone would write this up in code for the community to use in their strategies.
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).
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.
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.
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...
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.
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.