Amibroker: How to Code Van Tharp Position Sizing (Fixed Fractional)


Beginners Course  |  Intermediate Course  |  Amibroker Course Home

One of the more popular methods of Money Management in trading and investing is something called “Fixed Fractional Position Sizing” – where we are risking a fixed fraction of our overall capital per trade.  If you are already familiar with this method, you may want to test it out in your trading system to see what percentages work best – similar to this test done by Gary Stone.

It was popularised by Van Tharp, through his books and his educational Trading Game, which focussed on money management defined by the Risk from your entry point, down to your stop loss point.

In other words, if we have a stock trading at $10.00, and we enter at $10.00 and set our stop loss at $9.00, he sees the Risk as being $1.00 (the difference), not the whole $10.00.

Then, using this method, a trader would most often risk just 1% of his or her capital.  On a $100,000 portfolio, that would be $1,000, for example.  With the entry-to-exit difference in our stock being $1.00, we could buy 1000 shares (1000 / 1).

Check out the video below for the full detail!

Hope you enjoyed, and happy trending!

– Dave McLachlan

Beginners Course  |  Intermediate Course  |  Amibroker Course Home

Videos in the FREE Amibroker Course:

  1. Amibroker: How To Import A Watchlist With A CSV File
  2. Amibroker: How To Backtest A Single Stock Or Index
  3. Amibroker: How To Backtest a Portfolio or Group of Stocks
  4. Amibroker: How To Optimize A Trading System
  5. Amibroker: How To Scan The Market For Buy And Sell Signals
  6. Amibroker: How To Use Explore To Find And Filter Stocks
  7. Amibroker: How To Add Position Sizing Using AFL
  8. Amibroker: How to Add An Index Filter To Your Trading System Using AFL
  9. Amibroker: How To Plot Your Trading System On A Chart (incl. Buy/Sell Arrows)
  10. Amibroker: How to Use the If, Then Else Function (IIF)
  11. Amibroker: How to Code the ATR Trailing Stop (Chandelier) using ApplyStop
  12. Amibroker: How to Plot ApplyStop on a Chart
  13. Amibroker: How to Code Van Tharp Position Sizing (Fixed Fractional)
  14. Amibroker: How to “Scale In” to Positions (1) – Buying Once a Month
  15. Amibroker: How to “Scale In” to Positions (2) – Pyramiding Three Times
  16. Amibroker: How to Use “Cross”, When One Thing Crosses Another
  17. Amibroker Advanced: How to Compare Equity Curves

FREE Trading System Video Lessons:

  1. 7 Free Trading Systems and Their Returns From The Last 13 Years
  2. Seven Full Trading Systems Revisited, With Completely New Data
  3. Trading System: How to Create A Buy and Hold Trading System
  4. Trading System: How to Code “Sell In May And Go Away”
  5. Trading System: How to Code a Moving Average Channel That Made 23% p.a
  6. Trading System: How to Code Highest Highs As Used In 52 Week Highs Or Turtle Trading System
  7. Trading System: How to Code a Bollinger Band Breakout Trading System
  8. Trading System: How to Code a Moving Average Crossover That Returned 28% per annum
  9. Trading System: How to Refer to Previous Signals For MAup Trading System
  10. Trading System: How to Code the Leap Of Faith (Gaps) Trading System That Returned 24% p.a.
  11. Trading System: How to Code a Short Selling System (Plus Results)
  12. Trading System: Meb Faber Trading System Using Different Timeframes
  13. Trading System: How to Code the Three Billion Dollar Trading System

FREE Amibroker Q & A Videos:

  1. Amibroker Q & A: How To Do A Monte Carlo Test? (on ALL versions)
  2. Amibroker Q & A: Visualising Monte Carlo Data with Histograms and Scatter Plots
  3. Amibroker Q & A: How to Create the 52 Week High/Low Index with AddToComposite
  4. Amibroker Q & A: How to Code Trend Pilot: Five Consecutive Days Above or Below a Moving Average
  5. Amibroker Q & A: Three “Hacks” To Improve Your Coding Skills
  6. Amibroker Q & A: How to Remove Excess Signals

January 17, 2016  Tags: , , , ,   Posted in: Amibroker Course

3 Responses

  1. Neha Lele - February 20, 2016

    Hi Dave,

    Wonderful video yet again! Cant thank you enough for the same. If I become successful and ever write a book, I shall name you in my acknowledgements and thanks giving. Dave I had a small question about this one, as we saw that we would require 11.5% of our equity to be invested in one trade. So say for example we take similar 9 odd trades and our entire equity gets exhausted. However, we have set our maximum open positions to be 20. So I believe the system will try to take the 10th trade and give an error of not enough margin. Does this have any adverse effect on the automated system? Would there be a way of linking MaxOpenPositions also to the set position size?

  2. David McLachlan - February 21, 2016

    Hey Neha,

    Wow, good question. I like the idea of linking Open Positions to our equity or margin. Without delving into it, I’m not sure how that would be done, but I can think of an easiest way for now:

    If it were me, I might simply set “Account Margin” to 50 – effectively meaning I have 50/50 equity and margin – I could borrow up to 100% of my equity. Then, Amibroker will use it if it needs to, and leave it alone if it doesn’t.

    That might look like: SetOption( “AccountMargin”, 50 );

    Good question!

    Happy trending – Dave

  3. John Howarth - May 1, 2016

    I have down loaded the demo version of Ami Broker and it will not short sell OR cover buy. Is my down load corrupt? The demo down load disabled? I have copied and pasted, rewritten code from your site and the Ami Broker training and cannot get Ami broker to trade short.

Leave a Reply