TradingView backtesting guides

Fixed-Ratio Position Sizing Calculator

Fixed ratio position sizing converts cumulative closed profit and delta into whole-contract steps. Calculate the current tier, then compare its loss exposure with a percentage-risk rule. The result does not account for margin or stop distance.

$

Net closed trading profit since the sizing program began; exclude cash transfers

$

Profit per contract needed to add the next contract; enter USD amounts to the nearest cent

Fixed Ratio Contract Tier
--
N = floor((1 + √(1 + 8P / Δ)) / 2)

Delta and the equity staircase

Enter cumulative net closed profit P, not the account balance. With delta Δ, a tier of N whole contracts requires P = Δ × N × (N - 1) / 2. Starting with one contract, each increase requires another N × Δ of total profit. A lower delta reaches each tier sooner. This formula follows Michael Bryant's explanation of Ryan Jones's method.

For a hypothetical $10,000 starting account and $1,000 delta, the thresholds below assume all trades are closed and there are no deposits or withdrawals. Equity equals starting capital plus P.

Example thresholds with delta $1,000
ContractsClosed profit requiredAccount equityProfit to add one more
1$0$10,000$1,000
2$1,000$11,000$2,000
3$3,000$13,000$3,000
4$6,000$16,000$4,000

Changing starting capital to $50,000 leaves the profit thresholds unchanged. The three-contract threshold would then correspond to $53,000 of equity. Neither version says whether three contracts fit the account's risk budget.

Reduce size when closed profit crosses a threshold

This calculator uses symmetric thresholds: the same levels govern increases and decreases. At P = $3,000 and Δ = $1,000, the tier is three. At P = $2,999.99 it is two. Recalculate after a trade closes and apply the result to the next entry. Keeping the largest tier ever reached would be a different rule with greater exposure during a drawdown.

A loss can skip several tiers. From $6,000 of profit, a $4,000 loss leaves $2,000, reducing the next tier from four to two. At zero profit the formula still returns one. Negative profit is outside this calculator's accepted inputs; choose a halt, minimum-size or restart rule before using the method. A formula tier of one does not establish that one contract is affordable.

A full path with losses: fixed ratio vs fixed fractional

This constructed example starts both accounts at $10,000. Fixed ratio uses a $1,000 delta. Fixed fractional uses 5% of current closed equity and $500 planned loss per contract, with size = floor(0.05 × equity / $500). These are demonstration settings, not suggested risk levels. Both use whole contracts, one position at a time and the same per-contract outcomes, assumed net of costs. There are no cash flows or open profits. Risk and fills are assumed constant; real gaps can exceed the planned $500 loss.

Size before each trade; profit and equity after its close (USD)
TradeP&L per contractRatio sizeRatio cumulative profitRatio equityFractional sizeFractional equity
1$1,0001$1,000$11,0001$11,000
2$1,0002$3,000$13,0001$12,000
3-$5003$1,500$11,5001$11,500
4-$5002$500$10,5001$11,000
5$1,0001$1,500$11,5001$12,000
6-$5002$500$10,5001$11,500
7$5001$1,000$11,0001$12,000

On trade 3, fixed ratio holds three contracts: 3 × -$500 = -$1,500. Its $13,000 equity falls to $11,500, leaving $1,500 of cumulative profit and a two-contract tier for trade 4. After trade 4, profit is $500 and the next tier is one. The loss changes subsequent exposure, so a table containing only profit thresholds would miss the path dependence.

Fixed ratio finishes at $11,000 with a maximum closed-equity drawdown of $2,500 / $13,000 = 19.23%. Fixed fractional finishes at $12,000 with $1,000 / $12,000 = 8.33% maximum drawdown. Its size stays at one because the rounded risk budget never funds two contracts. These settings do not equalize ongoing risk: fixed ratio's planned loss on trade 3 is $1,500 / $13,000 = 11.54%. The example proves how the rules differ, not that one method performs better across other trade sequences.

In fixed fractional sizing, a wider stop reduces quantity for the same budget. Fixed ratio would return the same tier. To impose both rules, cap the ratio tier by the affordable quantity from a risk-based position size calculation. If the cap is zero, skip the trade instead of rounding up. The combined rule needs its own backtest.

Check units before using the result in TradingView

  • Define one unit: one share, one futures contract or a fixed share block. A result of three blocks of 100 shares means 300 shares, not three shares. Include contract point value and currency conversion when estimating stop risk.
  • Keep delta fixed during a test and record when closed profit resets. Exclude deposits, include fees, and state how withdrawals affect your separate affordability cap.
  • Check entry and exit quantity units together. TradingView's strategy documentation explains that an explicit order quantity overrides default sizing. Verify the resulting trade list, cost assumptions and margin behavior in Strategy Tester.

Broker margin, minimum order size and liquidity can restrict the calculated tier. This educational calculator does not enforce those rules or place orders, and its output is not investment advice.

Frequently asked questions

What does delta mean in fixed ratio position sizing?

Delta sets the profit increment per existing contract before adding one contract. At a $1,000 delta, moving from one to two contracts needs $1,000 of profit; moving from two to three needs another $2,000. Delta is neither a stop distance nor a percentage risk limit.

When does the calculator reduce the contract tier?

The calculator reapplies the same thresholds to current cumulative closed profit. With delta $1,000, three contracts require at least $3,000 of profit. Below $3,000, the tier drops to two; below $1,000, it drops to one. Size is recalculated for the next trade, not retroactively for an open position.

What happens after losses take cumulative profit below zero?

This calculator rejects negative cumulative profit. It does not decide whether to keep one contract, stop trading or restart the sizing program. Define that policy separately, and check whether even one contract exceeds the account risk or margin limit.

Can deposits increase my fixed ratio tier?

Deposits are not trading profit. Exclude deposits and withdrawals from cumulative closed trading profit, and subtract trading costs. Separately check available equity and broker margin. Adding cash can change affordability without changing this profit-based tier.

Turn a sizing rule into editable Pine Script

Use Pine Script AI Coding Agent to draft a sizing rule, then review quantity and exit units against these calculations in Strategy Tester. In Trading Journal, record the planned risk, position quantity and actual result. Neither step replaces broker margin checks or sends an order from this calculator.

Open Pine Script Coding Agent

Record planned risk and results in Trading Journal