Skip to content
TradingTune
Metrics, Risk, and Execution

How do you size a position from stop distance and a risk budget?

On one reading, the order size is the risk amount divided by the money lost per unit from entry to stop, before any rounding to a tradable step.

On this page

Key takeaways

  • On one reading, the size of one order before rounding is the chosen risk amount divided by the money lost per unit between the entry price and the stop price.
  • On one reading, the money lost per unit is the stop distance multiplied by the point value, so a wider stop gives a smaller size for a given budget.
  • The passages cited here state truncation for a margin call quantity and rounding for a liquidation price, and they state no rule for rounding an order quantity.
  • On one reading, rounding down leaves the intended loss at the stop price at or under the budget, but the loss at an actual fill can differ from it.
  • On one reading, a record of one check holds the budget, the stop distance, the tick size, the point value, the computed size, the rounding rule and the filled quantity, among other items.

What is the short answer for sizing from a stop distance and a risk budget?

The quantity of an order that is meant to lose a chosen amount when its stop is reached is that amount divided by the money lost per unit of size between the entry price and the stop price, with both in one currency, before rounding. The money lost per unit is the stop distance multiplied by the point value, so a wider stop distance gives a larger loss per unit and, for a given chosen amount, a smaller order. This article uses the term risk budget for the chosen amount: the amount of money the reader decides to lose if the stop is reached, whatever amount that is.

The TradingView support article on simulating leverage in Pine Script says, checked 2026-12-02, that PointValue is the amount of money that a whole number price move signifies. The Pine Script FAQ page on strategies gives, checked 2026-12-02, three steps for risking a percentage of equity: a monetary risk per contract from the stop distance, a risk amount from the current equity, and a position size from dividing the second figure by the first.

The result of the division is often not a quantity that can be traded as it stands, so it needs rounding to a step that the instrument allows. On one reading, rounding down leaves the intended loss at or under the chosen amount in this arithmetic, which describes the stop price and not the price of an actual fill.

Three different kinds of quantity meet in this calculation, and the first and third steps each turn one kind into another. The stop distance is a price distance, the budget is an amount of money, and the size is a count of order units such as contracts, where the unit depends on the instrument being traded. The Pine Script FAQ page on strategies measures the risk per contract, checked 2026-12-02, and treats the number of units each contract represents as one of the factors of that risk.

What is a risk budget, and what does the Pine Script FAQ call it?

A risk budget is a decision about money that is taken before the arithmetic starts. It states how much the reader is prepared to lose if one order reaches its stop. The phrase risk budget does not appear in the pages cited here, and the words risk amount for this figure appear on the Pine Script FAQ page on strategies. The Pine Script FAQ page on strategies words the second step, checked 2026-12-02, as multiplying the current equity by the percentage of equity that the person setting up the script wants to risk. In a strategy test, equity is the value of the simulated account. On one reading, the percentage form therefore ties the amount to a figure that moves as the simulation goes on.

The Pine Script FAQ page on strategies gives a reason for that form when it says, checked 2026-12-02, that adjusting the position size to risk a fixed percentage of equity normalizes risk exposure, regardless of equity fluctuations. Normalizing is the page’s own verb for what the percentage form does to exposure, and this article does not read it as protection.

The three steps cited here name no amount and no percentage to risk. They leave that choice to the person who writes or runs the script of the strategy. On one reading, the second step can take a fixed amount of money instead of a percentage of equity. The rest of this article uses that fixed-amount form, because the arithmetic then concerns one order at a time. On one reading, a fixed amount stays where the reader put it until the reader changes it, while a percentage form gives a different amount whenever equity differs between two orders.

This article gives no figure for the budget and does not say which amount suits a strategy.

How does a stop distance turn into money per unit?

The first of the three steps turns a distance into money. The Pine Script FAQ page on strategies says, checked 2026-12-02, to calculate monetary risk per contract by multiplying the stop distance in ticks by the monetary value of each tick and by the number of units each contract represents. A tick is the smallest price step that the price of a symbol can take, so a stop distance counted in ticks is a count of those steps between the entry price and the stop price.

The TradingView support article on simulating leverage in Pine Script defines, checked 2026-12-02, PriceChange as the difference between the current price and the entry price of the open position. On one reading, the stop distance is a difference of a similar kind, taken between the entry price and the stop price instead of the current price, and it can be written as a price or as a count of ticks.

The point value converts a price move into money. The TradingView support article on simulating leverage in Pine Script says, checked 2026-12-02, that for most symbols the point value is one, with the main exception being futures. On one reading, a point value of one means that the price distance already is the money per unit for most symbols, and for futures the point value scales that distance.

The two pages word the tick in different ways. The TradingView support article on simulating leverage in Pine Script says, checked 2026-12-02, that a margin liquidation price is rounded up or down, by the side of the position, to the nearest price divisible by the symbol’s minimum tick value. On one reading, that wording speaks of the tick as a step in price, while the Pine Script FAQ page on strategies pairs the tick with a monetary value, and each wording fits what its own page describes.

On one reading, the tick size multiplied by the point value gives the money for one tick of one unit. On one reading, a price distance multiplied by the point value gives the money for that distance, so a stop distance has two routes to money, one through ticks and one through price.

How do you divide the budget by the risk per unit, and why does a wider stop shrink the size?

The third step is the division itself. The Pine Script FAQ page on strategies says, checked 2026-12-02, to calculate the position size by dividing the risk amount by the risk per contract. With the budget fixed at one chosen amount, the money lost per unit sits in the denominator, so a change that raises the loss per unit lowers the quotient and a change that lowers it raises the quotient.

The Pine Script FAQ page on strategies says, checked 2026-12-02, that smaller stop distances require larger position sizes to achieve a specific fixed risk. The word require belongs to a tip in the answer of a FAQ page, and the qualifier specific fixed risk belongs to the page’s statement as well.

The Pine Script FAQ page on strategies also describes the direction of the effect, checked 2026-12-02, as sizing so that the position size falls when the stop distance grows and rises when it shrinks, so as to maintain a constant risk percentage. On one reading, with the budget and the point value held constant, doubling the stop distance halves the size before rounding, because the size is the budget divided by a figure that scales with the stop distance.

The table below works the division in words for three named cases, so no figure of a real instrument enters. Case A is the baseline, and cases B and C each change one input against it while the budget stays at one chosen amount.

Case Stop distance Point value What the division gives before rounding
Case A The baseline stop distance, taken as the reference for the other two cases The baseline point value, taken as the reference for the other two cases The baseline size, which is the budget divided by the baseline money lost per unit
Case B Twice as wide as the baseline stop distance The baseline point value Half the baseline size before rounding, because the money lost per unit is twice as large
Case C The baseline stop distance Ten times larger than the baseline point value A tenth of the baseline size before rounding, because the money lost per unit is ten times larger

In each of the three cases the budget is held at one chosen amount, so the money lost per unit is the quantity that moves the result. A sweep of stop distances is a separate task, and the post on optimizing stop and target levels with a TradingView backtest treats it.

How does rounding to a tradable quantity change the loss at the stop?

The division often gives a decimal, and an order needs a quantity that the instrument accepts. The Pine Script FAQ page on strategies says, checked 2026-12-02, that the actual exposure level can be less than intended when the available capital does not divide neatly by the unit value, and it lists small equity amounts, high unit prices and assets such as stocks where trading partial shares is not possible as cases where this is particularly so.

The passages cited here state truncation for the quantity that a margin call liquidates, rounding for the liquidation price, and a shortfall in exposure where partial shares are not possible, and they state no rule for rounding an order quantity. The TradingView support article on simulating leverage in Pine Script says, checked 2026-12-02, that the value is truncated to the same decimal point as the minimum contract size for the current symbol. On one reading, that value is the quantity that a margin call liquidates, so it belongs to a different calculation from the size of a new order.

On one reading, rounding down to a whole number of the smallest order steps that the instrument allows leaves the loss at the stop price at or under the budget in this arithmetic, because the rounded quantity does not exceed the result of the division. On one reading, rounding up can put the loss at the stop price above the budget, because the rounded quantity then exceeds the result of the division.

On one reading, a result smaller than one order step means that the budget does not allow even the smallest order at that stop distance, since the smallest order already loses more than the budget at the stop price. On one reading, the choices then include a different budget or stop distance, skipping the order, or the smallest order with a loss above the budget, and the arithmetic does not say which of these suits a strategy.

What quantity does a Pine strategy actually fill, and how do you check it?

A computed size is a request, and the quantity that fills can differ from it. The Pine Script Strategies page describes, checked 2026-12-02, a command that specifies the maximum possible position size when a script calls the strategy.entry() command. The Pine Script Strategies page says, checked 2026-12-02, that when an entry order would produce a market position beyond the specified threshold, the strategy cuts the order quantity so that the resulting position stays within the limit. On one reading, a computed size can therefore differ from the quantity that fills when a maximum position size is set for the strategy.

A trade marker is a second place where size can mislead. The Pine Script Strategies page says, checked 2026-12-02, that the markers of one of its examples display the total size of each transaction, not the size of each resulting position. On one reading, a reversing order shows why, because the transaction then holds the size of the open position plus the size of the new order, which can be larger than the resulting position.

Leverage and margin are a third place. The Pine Script FAQ page on strategies says, checked 2026-12-02, that in some cases the strategy might require increased leverage to achieve the required sizes. The TradingView support article on simulating leverage in Pine Script says, checked 2026-12-02, that the margin settings of a strategy script allow it to validate position sizes. The effect of a margin call on later trades is the subject of a separate post on margin calls and leveraged backtests, which this article leaves aside.

On one reading, the fixed-amount variant of the three steps fits in a few lines of Pine, with the risk amount read from an input.

Pine v6
//@version=6
strategy("Sizing arithmetic", overlay = false)
int stopTicksInput = input.int(1, "Stop distance in ticks", minval = 1)
float riskAmountInput = input.float(1.0, "Amount to risk", minval = 0)
// Calculate the risk per contract of the instrument.
float riskPerContract = stopTicksInput * syminfo.mintick * syminfo.pointvalue
// Determine the position size necessary to risk the specified amount.
float positionSize = riskAmountInput / riskPerContract
plot(positionSize, "Position size", color.lime, 4, plot.style_histogram)

The code reads a stop distance in ticks and a risk amount from two inputs, multiplies the stop distance by the tick size and by the point value to get the money at risk for one unit, divides the risk amount by that product and plots the quotient as a lime histogram. The two input defaults are placeholders for the reader’s own values, not suggested figures. The code places no order and does not round the quotient.

On one reading, the first part of a check of the fill compares the computed size with the quantity that the trade list shows for that order. On this reading, the second part recomputes the money at the stop from the filled quantity multiplied by the stop distance and by the point value, and it compares that money with the budget. On this reading as well, the third part holds the margin settings and a maximum position size in view, since they can change what fills.

Why can the loss at the stop differ from the budget?

The budget describes an intended loss at the stop price, and an order can end at another price. The Investor.gov glossary page says, checked 2026-12-02, that a stop order becomes a market order once the specified price is reached. The Investor.gov glossary page also says, checked 2026-12-02, that the price at which a trade is executed may differ from the stop price, especially in a fast-moving market where stock prices can change rapidly. The glossary entry does not mention the size of an order.

On one reading, the budget is therefore the intended loss at the stop price and not a bound, because the actual loss is the filled quantity multiplied by the distance that the fill really covers and by the point value. On one reading, a price jump between two bars is one common reason for a fill to end up away from the stop price, and the post on fills after an overnight gap past a stop follows that case through. On one reading, the picture changes again where a stop price is attached to a price bound instead of a market order, and the post on stop and stop-limit orders in TradingView compares the two types.

A second source of difference lies in the stop distance itself. The Pine Script FAQ page on strategies says, checked 2026-12-02, that the stop distance in its example script is set to a constant value for demonstration purposes and that in practice the stop distance normally varies for each trade. On one reading, a size computed once for a constant distance does not carry over to a script whose distance changes, and the division has to run again for each order.

The three steps cited here have no term for commission or slippage. On one reading, a commission can therefore move the realised loss away from the budget even when the fill lands on the stop price, and slippage can move the fill itself away from that price. Setting such costs in a test is the subject of the guide on modeling slippage and commission.

What should a record of one sizing check hold?

On one reading, a record of one sizing check starts with the budget written as a chosen amount of money, because a size is hard to audit later if the amount behind it was not written down. On this reading, the second item is the stop distance with its unit, in ticks or in price, and the two prices it was measured between. On this reading, the third item is the tick size and the point value as read from the symbol, since the money per unit depends on both and symbols can differ in them.

On this reading, the fourth item is the computed size before rounding, followed by the rounding rule that was applied and the smallest order step that the rule used, so that a later reader can tell a rounding effect from a fill effect. On this reading, the fifth item is the quantity that actually filled, taken from the trade list, together with the money at the stop that this quantity implies and its difference from the budget.

On this reading, a sixth item lists the settings that can change a fill, among them the margin settings, a maximum position size and the way the size was passed to the order. On this reading, the last item is the date on which the pages were read, because live documentation pages can change and an undated note does not show which wording it relied on.

Redoing this arithmetic by hand for each stop distance in a test means filling in these items again for each run, and a size on its own does not show which settings produced it.

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

Add to Chrome, it's free

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

What does this arithmetic not show?

The arithmetic converts a chosen amount and a stop distance into a size, and it does not say which amount to choose, which stop to place or what a live fill will cost. The result of the division carries no forecast: it describes the intended loss at the stop price for one order.

The four pages cited here are live pages, and two of them, the Pine Script FAQ page and the Pine Script Strategies page, are long documents that the cited passages cover in part. Each statement about them describes the page text as it stood on the checked date, and a later edit of a page can change the wording.

The arithmetic also treats one order alone. How a sizing rule shapes the path of a whole account over many orders is a different calculation, and the post on how risk of ruin is calculated takes that up, while this article sizes one order and builds no account path.

Sources

TradingTune for Chrome

Stop tuning your strategy's inputs by hand.

TradingTune runs systematic parameter searches on your own TradingView strategy, right inside the chart page. You keep the strategy, you read the results.

Free tier, no API keys. A free account is required to run. Not affiliated with TradingView, Inc.

Share this post