Position Sizing CalculatorA simple automated calculator that shows how many shares can be bought or sold if a specific maximum amount is to be risked on the position.
The risk per share is assumed to be the distance to the respective buy or sell line of the Supertrend indicator. This is based on a calculation of the ATR for the last ten days, which is multiplied by a fixed factor and plotted against the highest or lowest candle of the past ten days.
The parameters can be changed manually. By default, a risk of $500 per trade is assumed.
For each of the last bars, the calculator displays the distance to the calculated exit and, through a simple division, calculates the number of shares that could be bought or sold in a potential long or short position to achieve this hypothetical maximum risk.
Of course, there is no guarantee that the respective price will actually be reached, but the calculator can help provide a reference point for sizing the position.
The principle is clearly visible in the screenshots: FRT is a stock that moves slowly and is only a short distance from the stop-loss level. At the current price of $114.47 and a calculated stop at $108.99, 91 shares could be purchased to risk $500. In total, that would be an order of $10,416.77 for a long position.
SOUN, on the other hand, has a very wide margin to the stop-loss; it is a stock with high volatility. Therefore, only 300 shares can be purchased here to achieve the same hypothetical risk. The position would thus be worth only $2,841.
Designed by tuvot_1a, programmed by Claude.
Indicatore Pine Script®















