Percent Risk Position Sizing in EasyLanguage

About the Author Jeff Swanson

Jeff is the founder of System Trader Success - a website and mission to empowering the retail trader with the proper knowledge and tools to become a profitable trader the world of quantitative/automated trading.

follow me on:
  • JEROME says:

    Hi Jeff,
    Impossible to download your file.
    Why?
    Regards.
    Jerome LUCE.

    • I just tested it and it appears the downloads are working. Anyone else having a problem?

  • Alex says:

    I’ve only glanced through this quickly, but for futures (as opposed to stocks) shouldn’t the code be something like:

    Units To Buy = Account Size * Percent Risk / ( ( Buy Price – Stop Price )*( MinMove * PointValue ) )

    As you say – moving this sort of thing out to a function is a good idea – it also makes it easy to call into an indicator on a chart for a quick visual ‘sense check’ to ensure it behaves as anticipated.

    I’d be interested to see some more articles on this topic Jeff, especially covering approaches like Kelly and Optimal F.

    • This is true in regards to the MinMove when looking at the general equation above. The units associated with the numerator and denominator must cancel. That is, they must both be expressed in dollars. However, the function actually expects a dollar value for the denominator, not two prices or the difference of two prices. In the end, this is handled by the calling strategy. I will make further articles around this function and explore other approaches. Thanks for writing!

  • […] Percent Risk Position Sizing in EasyLanguage [System Trader Success] Many of the trading models and market studies on this website used a fixed share or fixed contract position size. This means the same number of shares or contracts is traded for each position. For the futures market this often means trading one contract. This is done simply to exclude the effects of dynamic positioning and reinvesting profits so we can focus on the performance of the strategy […]

  • JR says:

    Hi there,

    Excellent post! Thank you so much!

    Regarding the improvements made to this function, can someone please help me figure out how to use available cash (instead of using total equity) to adjust position sizing whenever the code is trying to buy more than the account can afford. I’m testing for a basket of securities and I have found that my code buys sometimes more than it should.

    I’d really appreciate some help figuring this out!
    Thank you!

  • >