Skip to content
All library documents

Position Sizing from Equity Risk and Stop-Loss Distance

Article TradingView scripts

Summary

This educational strategy example calculates trade quantity from a chosen maximum loss and a stop distance expressed as a percentage of entry price. The risk input can be either a percentage of strategy equity or a fixed cash amount. Dividing that risk budget by the cash loss per unit at the specified stop distance yields the position size.

The script illustrates the calculation with sample long and short entries triggered at fixed bar intervals, then applies a stop-loss distance. Its stated assumptions are that account currency matches the symbol currency and leverage is 1:10, adjustable in settings. These assumptions matter because contract value, currency conversion, leverage, and execution conditions can affect realized risk. The example does not present performance evidence, and its periodic entry rules are for demonstration rather than a tested trading signal.

Key ideas

  • Position quantity is derived by dividing the allowed loss by the estimated loss per unit at the stop.
  • The risk budget can be set as a percentage of equity or as a fixed monetary amount.
  • The stop distance is specified as a percentage of entry price.
  • The example assumes matching account and symbol currencies and uses adjustable leverage.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.