How RuleTrader’s Smart Trade Sizing Works
It’s surprisingly tricky to get trade sizes right with an automated investment system, which is why we developed RuleTrader’s Smart Trade Sizing algorithm. Before we explain that, lets look at some of the issues with the normal methods of trade-sizing, which it’s designed to address.
A standard approach to trade-sizes is to simply specify a percentage of total capital for each trade, which in turn implies a target number of positions. However, as this does not take into account the actual cash available, it can often leave unproductive cash sitting in the trading account. This is because, if the system if fully invested and a position is sold, then either the sale value is:
- less than the target trade-size, so a new position is unaffordable and the cash is not used
- greater than the target trade-size, so a new position can be bought but cash will remain after the purchase
Even worse, this unproductive cash tends to increase over time, which severely impacts the performance of the investment system.
Unfortunately, turning it on its head and only taking account of the cash available and ignoring total capital doesn’t work either. This is because the resultant positions are either too small (and potentially swamped by trade costs), or too large (and potentially too high risk relative to the total capital). Neither of these options is desirable.
RuleTrader’s unique Smart Trade Sizing algorithm solves this by taking into account both total capital and total cash. It uses a smart percentage value, which is defined in RuleTrader settings. This percentage of capital determines the nominal trade size. A nominal target number of positions is also calculated by dividing 100 by the smart percentage. For example, if the percentage is 5% then it aims for 20 positions.
The Smart Trade Sizing algorithm calculates a trade-size that delivers at least the nominal target number of positions. If more positions can be afforded at around the nominal trade size, then more positions are allowed. Conversely, if there is insufficient capital to buy the nominal number of positions at the nominal trade size, then the trade size is adjusted to compensate.
Specifically, the trade-size is calculated using the following 4 steps (values are rounded to the nearest integer):
- Calculate the minimum number of positions to buy, which is the nominal target number of positions less the number of existing positions
- Calculate the affordable number of positions that could be bought, which is the total available cash divided by the nominal trade size
- Determine the actual number of positions to buy, which is the greater of the minimum number of positions and the affordable number of positions
- Calculate the smart trade size, which is the total cash divided by the actual number of positions to buy
The advantage of this approach is that it produces trade-sizes that are reasonably sized vs total capital, while also utilising all available cash. It ensures that a minimum number of positions are purchased (the nominal target number of positions), while allowing additional positions to be opened beyond the nominal target, at around the nominal trade size, if they can be afforded with the cash available.
While we’re on the subject of trade-sizes, it’s worth noting that RuleTrader provides an ‘Actual trade-size must be at least __% of the target size‘ setting in the System Settings tab of the Test Dashboard. This setting allows a degree of fuzziness in trade sizing calculations by allowing purchases when the available cash is less than the your target trade-size but is at least this percentage of that target. It’s another great way to avoid missed buys that leave unproductive cash sitting in your trading account.
Please Note: The information provided herein is not intended to provide and should not be construed as providing investment or financial advice and should not be relied on for making investment decisions. Nor is it intended as an endorsement or recommendation for the opinions expressed herein. Please read our Disclaimer – it is for your protection as much as ours.
Enter your email to be notified of new articles
Your email is never shared and only used for new articles
© 2025 RuleTrader Ltd. All rights reserved
