Skip to main content

position sizing and how edgeful uses strategy.position_size

how position size flows from the TradingView algo indicator through to your broker — the one input that controls it, why the Strategy Tester's starting capital doesn't affect live trades, and a worked example you can map to your own account.

Written by Brad
Updated today

summary: how position size flows from the TradingView algo indicator to your broker. one input controls it, the Strategy Tester's "initial capital" does not, and each contract fires as a separate webhook — so sizing is simple once you see the pieces.

this article covers: where position size is actually set, how edgeful translates it into a broker order, why the TradingView Strategy Tester's starting capital doesn't scale your live trades, how slippage reduction fits in, and a worked example with real numbers. new to algo automation? start at the algo automation quickstart.

where position size is set

position size is set in one place only — the contracts per trade input on the edgeful algo indicator in TradingView. that's it. no multiplier anywhere else, no per-account scaling, no hidden edgeful override.

open your chart, click the gear icon on the edgeful indicator, and set the number of contracts you want the algo to trade on each entry. save, and your next alert fires at that size.

if you want different sizes on different accounts (e.g. 1 contract on SIM, 3 contracts on live), use 2 separate indicator setups on 2 separate charts, each pointing at its own strategy and broker account. one indicator = one size = one webhook chain.

how edgeful translates it to a broker order

when the algo fires, TradingView builds the webhook payload using Pine Script's strategy.order.contracts variable — that's the value from your contracts-per-trade input, same number, unchanged.

the JSON message you pasted into the TradingView alert (from the algo dashboard) interpolates that value into the quantity field:

"quantity": "##{{strategy.order.contracts}}"

edgeful receives the webhook, reads the quantity, and sends an order for that many contracts to your connected broker. no transformation, no scaling. what's in the indicator is what hits the broker.

the Strategy Tester "initial capital" trap

this is the #1 source of sizing confusion.

TradingView's Strategy Tester has an initial capital field — defaults to $100,000. when you change it (e.g. set it to $5,000 to match your actual account), the tester's hypothetical PnL chart and metrics change. that's cosmetic for the backtest.

it does not change how many contracts the algo trades. contracts-per-trade is a separate input. the Strategy Tester's initial capital only affects the tester's own math on the historical chart — it never flows through to live alerts or broker orders.

if you want the algo to trade a different size, change the contracts per trade input on the indicator. ignore the initial capital field unless you're measuring % return in the tester.

slippage reduction and entry order type

the algo indicator has a slippage reduction setting in its TradingView input panel. it controls how entries are placed, not how many contracts are sized.

when slippage reduction is on, entries go in as limit orders — you get price control at the cost of fill certainty on fast bars. when it's off, entries are market orders — guaranteed fill, possible slippage.

either way, the quantity is the same. slippage reduction changes the order type, not the size. TP and SL always exit as market orders regardless of this setting. for the full breakdown on why exits are market orders, see how the algo automation chain works.

worked example

say you're running the ORB algo on MNQ (micro Nasdaq futures). MNQ moves $2 per point per contract.

  1. on the indicator, you set contracts per trade = 2.

  2. the algo fires a long entry at 21,500. TradingView sends a webhook with "quantity": "2".

  3. edgeful routes a 2-contract buy order to your broker. the broker fills both contracts.

  4. price hits your TP at 21,520 (20 points higher). TradingView fires the TP alert. edgeful sends a 2-contract sell-to-flatten order.

  5. PnL: 20 points × $2/point × 2 contracts = $80 gross (before fees/slippage).

want to double your size? change the indicator input to 4 contracts. next trade fires at 4. PnL scales linearly — 20 points × $2 × 4 = $160. same algo, same signal, double the size.

rule of thumb: point value × contracts = $ risk per point. MNQ = $2/point per contract. NQ = $20/point per contract. MES = $1.25/point per contract. ES = $12.50/point per contract. check your broker's contract spec sheet to confirm.

sizing vs. max loss and stop loss

contracts-per-trade sets how big each trade is. two other indicator settings set how much you can lose:

  • stop loss (SL) — the max loss per trade. hits first and closes the position.

  • max loss — the max cumulative session loss. hits after SL and stops new trades. not available on the IB algo.

these two work alongside your contracts-per-trade input to bound total exposure. for how SL and max loss interact (and why IB doesn't have max loss), see customizable algo parameters and risk controls.

going live with size

don't jump straight to your target size on a live account. the right order:

  1. SIM with 1 contract → prove the chain works end-to-end. see test your webhook before going live.

  2. live with 1 contract → prove broker execution and slippage are in the range you expect.

  3. scale up → change the contracts-per-trade input once a handful of live trades have filled cleanly.

scaling up is a 30-second change on the indicator. scaling up before you've seen live fills is how people find out their broker rejects size they haven't funded for.

related articles

start here:

spokes:

related concepts:

Did this answer your question?