New: the web-based algo terminal is liveLaunch terminal

Position Sizing and Exposure Limits for Algo Strategies

Understand how a strategy can define order size and cap exposure without treating a formula as a guarantee of safety.

Dark Logic Algo3 min read
Dark Logic Pro graphic about converting a TradingView Pine Script into a Python bot
Illustration accompanying this Dark Logic Algo guide.

Sizing is part of the strategy

An entry signal says when a strategy may act; position sizing determines how much exposure it takes. A rulebook should define the sizing input, maximum quantity and conditions under which an order is skipped. Some approaches use a fixed quantity, while others scale to a risk budget or volatility estimate. Each method has assumptions and can behave unexpectedly when prices, liquidity or account values change. There is no universal size appropriate for every trader. Set limits based on your circumstances and ensure the software shows the actual quantity before an order is transmitted. Test boundary values so a missing or invalid input cannot produce an unexpectedly large order.

Use caps that account for combined positions

A per-order limit does not necessarily cap total account exposure. Several strategies can act on the same instrument or correlated instruments, and separate orders may add up to a larger position than intended. Define whether limits apply per order, per strategy, per instrument or across the whole account. Include pending orders when calculating potential exposure because they can still fill. Specify what happens if the account is already holding a position from manual activity. Reconcile the software’s view with broker records before using exposure-dependent rules. A cap can reduce some operational risks, but it does not stop losses from exceeding a desired amount during gaps, illiquidity or execution failures.

Understand volatility and liquidity assumptions

A volatility-based sizing rule may reduce quantity when recent movement increases, but its estimate depends on the lookback period, data quality and calculation method. If market conditions change quickly, historical volatility may lag. Liquidity is also important: an order that is small relative to typical volume can still experience poor execution in a thin market or during a fast move. Use conservative assumptions and examine stress periods in backtesting. Do not assume that scaling quantity inversely to volatility makes a strategy safe or risk-neutral. It changes exposure according to a model; the chosen model can be wrong and actual fills can differ from research assumptions.

Monitor actual exposure and review decisions

After each fill, calculate the position from confirmed broker data and compare it with configured limits. Alert if the software cannot determine account state, if a position exceeds a limit or if an order remains unresolved. Keep a record of the sizing rule and its version, then review realized outcomes and drawdowns over time. Avoid increasing size solely because a short period was profitable. Research metrics are historical descriptions and do not forecast future returns. This educational guide is not personal investment advice. If you are uncertain about appropriate exposure, consider obtaining independent professional advice before risking capital.

Ready to try it yourself?

Open the web terminal and test your rules with built-in risk controls.

Launch web terminal
Back to all articles
Dark Logic Algo

Explore the platform

Choose the platform that fits your workflow. Review the setup guide and risks before connecting a live broker account.

Upstox for Windows

Desktop package for the Upstox API workflow.

Download Upstox

Dark Logic Algo is software, not investment advice. Trading involves risk and does not guarantee income or returns.