Sierra Chart custom study · complete reference · v1.0

Position Size Calculator Pro

Everything the study does, every setting it exposes, every way it can be misread, and the reasons behind the decisions — written to be the source material for a sales page, a customer manual and a support desk.

Version
1.0
Platform
Sierra Chart 64-bit, Windows. Built and tested on v2800
Delivered as
PositionSizeCalculatorPro_64.dll
Dependencies
None — one self-contained file
Settings
55 inputs, 8 groups
Order routing
None. It never touches an order.

1What it is

The one-paragraph version, for the top of a sales page.

A pre-trade position sizing tool for Sierra Chart, drawn directly on the chart and modelled on TradingView's long/short position tool. You place an entry, a stop and up to four targets; it tells you how many contracts to trade, exactly what the trade risks in money, what each target pays, and the resulting reward-to-risk ratio — all of it net of commission.

Two things separate it from a calculator in a side panel. It is anchored to a candle, so it stays where you put it as new bars print, which makes it a record of a trade you took as much as a plan for one you are considering. And it is driven from the chart — grab a handle, press a button on the box itself — rather than from a settings dialog.

What it does not do

It never places, modifies or cancels an order, and it needs no trading connection to work. That is deliberate and worth stating prominently: it reassures cautious buyers, and it sets expectations for the ones hoping it will submit brackets.

The other edition

Pro is the more expensive of two products built on the same engine. The standard Position Size Calculator has one target, one sizing mode and a single row of five buttons, with 39 settings to Pro's 55. The two share a visual language deliberately — same red X, blue H, green flip arrow — so a customer moving up recognises everything. Its reference carries a side-by-side comparison; both can be installed together and used on the same chart.

2Anatomy on the chart

The box

The setup is drawn as stacked filled bands: a risk band from the entry down to the stop, and a reward band from the entry out to each target. The bands meet exactly at the entry and at every target, so the edges where they meet are the levels — there are no separate level lines to style or to misalign.

The box begins one bar to the right of the anchor candle and extends as far right as you drag it. With Box: Width at 0 it sizes itself to the widest label with a little air either side, and it will never be narrower than its own text.

The handles

Four triangular markers sit just left of the box, one per draggable thing, each in the colour of the label it belongs to:

HandleDrag itWhat happens
EntryAny directionVertically, the whole setup moves and every distance is preserved. Horizontally, the tool re-anchors to whichever candle you drop it on — box width included.
StopVerticallySets the stop distance. Locked in Fixed Risk mode, where the stop is an output.
TargetVerticallyOne handle per target. Locked in Fixed Risk mode.
WidthHorizontallyOn the box's right edge, mirroring the entry handle. Sets how far right the box reaches. Works in the empty space past the last candle.

Nothing can be dragged across the entry — a stop cannot become a target by accident. Direction changes only through the flip button.

Why handles rather than the lines themselves. An early version let you drag the level lines. Sierra Chart kept selecting and deselecting them faster than a level could be placed on a wick, because thin lines on a busy chart are a poor click target and everything else nearby competes for the same click. Dedicated markers, offset clear of the price action, made the tool usable. The lines are locked so they never compete.

3The three sizing modes

Which of risk, size and stop distance is the input, and which are solved for.

ModeYou setIt solvesUse it when
Variable Risk
default
Stop, targets, size Risk and reward in money The chart decides your levels and you want to know what they cost.
Fixed Risk Amount Risk amount, size Stop and target distances You always risk the same amount and want the stop that produces it.
Auto Size Risk amount, stop Contract count The stop belongs under that wick and you need the size that fits your risk. This is the question the category is named after.

The active mode is written into the entry label, so a locked stop never looks like a frozen study. The + and buttons change position size in Variable and Fixed Risk; in Auto Size, where size is an output, they step the risk amount instead.

Fixed Risk rounds down. The stop distance is floored to whole ticks, so realised risk lands at or just below the amount you set — $247.50 against a $250 setting, never $252. That is the right direction to err, but say it in the manual: otherwise the first support ticket is someone reporting the difference as a bug.

4How the money is calculated

Everything on the labels comes from these. Commission is round-turn, per contract.

StopTicks     = |Entry − Stop| / TickSize
TargetTicks   = |Target − Entry| / TickSize

Risk          = Quantity × (StopTicks × TickValue + Commission)
Reward[t]     = TargetQty[t] × (TargetTicks[t] × TickValue − Commission)

R:R           = Σ Reward[t] / Risk          // net of commission on both sides

The ratio is taken from the net money figures rather than from the raw tick counts. With commission at zero the two are identical, which is why a gross ratio looked correct for a long time; set commission to $4 and a gross ratio contradicts the two currency amounts printed beside it.

Fixed Risk, solving for the stop

RiskPerContract = RiskAmount / Quantity − Commission
StopTicks       = max(1, floor(RiskPerContract / TickValue))
Target[t]       = Entry ± StopDistance × R[t]

Auto Size, solving for the quantity

CostPerContract = StopTicks × TickValue + Commission
Quantity        = floor(RiskAmount / CostPerContract)
                  clamped to Sizing: Maximum Position Size

When that lands below one contract, the stop costs more than the entire risk budget. Rather than quietly drawing a plausible 1, the label says so: Stop too wide for $250. Tighten the stop or raise the risk amount.

Fixed Risk has the mirror of that fault and now the mirror of the warning. Commission is charged per contract whatever the stop does, so a large enough size consumes the whole budget before the stop is given any room — 50 contracts against $250 of risk at $4 commission leaves $1 per contract to cover $4 of cost. The stop used to pin silently to one tick; the label now reads Size too large for $250.

5Multiple targets

Up to four targets, each with an R multiple (where it sits, as a multiple of the stop distance) and a share of the position.

Shares are weights, not percentages. They need not add up to anything in particular: 50 / 30 / 20 and 5 / 3 / 2 produce exactly the same split. The resulting contract count appears in brackets on each target's label.

Why the counts always add up

Splitting 7 contracts three ways by weight gives fractions, and rounding each one independently produces 6 contracts or 8. The allocation uses the largest remainder method: floor every share, then hand the leftover contracts out one at a time to whichever targets were cut hardest. The parts always sum back to the position size exactly.

Stepping a target's share down to nothing removes that target — its band, label and handle all go with it. That is the intended way to drop a target, and it is why there is no separate remove button.

R:R assumes every target fills. The ratio does not model moving the stop to breakeven after a partial exit. That is the standard convention for tools of this kind, and matching what a competitor's number means matters more than being cleverer than it — but a trader who scales out will otherwise assume it is accounted for.

6What the labels say

Exact formats, so a manual can reproduce them and support can recognise them.

LabelFormatExample
StopStop  {ticks}t  -{cur}{risk}Stop 33t -$330.00
Target, singleTarget  {ticks}t  +{cur}{reward}Target 36t +$360.00
Target, multipleT{n}  {ticks}t  +{cur}{reward}  [{qty}]T2 36t +$360.00 [3]
Entry, Variable RiskSize : {qty} - RR : {ratio}Size : 8 - RR : 1.09
Entry, Fixed RiskFixed {qty} - RR : {ratio}Fixed 8 - RR : 2.00
Entry, Auto SizeAuto {qty} - RR : {ratio}Auto 8 - RR : 2.00
Entry, Auto Size over budgetStop too wide for {cur}{risk}Stop too wide for $250
Entry, Fixed Risk over budgetSize too large for {cur}{risk}Size too large for $250

All labels are padded to a common character count so they share one width and sit centred in the box. That only produces equal pixel widths in a monospaced face, which is why the default is Consolas and why the input is named to hint at it.

7The button cluster

Bottom-left of the box. Two rows, plus one per target, and a clean view behind H.

Row one — the position

GlyphColourActionSetting for its colour
XRedHide the tool, preserving every settingButtons: Hide Button Color
HBlueSwitch between the full cluster and the clean viewButtons: Handles Button Color
GreenFlip long / shortButtons: Flip Button Color
+  −Button grey-bluePosition size up / down — or risk amount, in Auto SizeButtons: Background Color

Row two — how the size is decided

GlyphColourActionSetting for its colour
Button grey-blueVariable Risk modeButtons: Background Color
Button grey-blueFixed Risk Amount modeButtons: Background Color
Button grey-blueAuto Size modeButtons: Background Color
T+Button grey-blueAdd a target, up to fourButtons: Background Color

One row per target

Only once there are two or more targets to divide the position between. Each row is a chip naming the target and a pair of steppers for its share.

GlyphColourActionSetting for its colour
T1 … T4YellowLabels the row. Not a button — nothing happens if you press it.Buttons: Target Chip Color
+  −Button grey-blueThat target's share of the position. Step it to nothing and the target is removed.Buttons: Background Color
The clean view

H is a single switch for reading the chart rather than editing the trade. Pressed, it takes the grab handles off the chart and every button but X and H off the cluster. Pressed again, everything returns. No level, size, mode, direction or anchor is touched in either direction, and the state survives hiding the tool with X.

It follows that the setup cannot be edited in the clean view: with no handles there is nothing to drag, and with no steppers the size is fixed. That is the point of it, but it is the one thing a new user may need told once.

Every glyph is an input, so a customer whose font lacks one of the symbols can type any character they like into it. The default face is Segoe UI Symbol, which carries all four of the mode and flip glyphs; Consolas does not.

Everything except X, H, the flip arrow and the target chips shares one colour — by default a lighter shade of the entry label's grey-blue, so the cluster reads as part of the box without competing with the numbers on it.

Why the buttons are pixel-drawn

The cluster is painted in real screen pixels through a GDI callback rather than being drawn as chart objects anchored in price and time. Chart-space cells cannot be made square, and their spacing drifts as you zoom — both were visible bugs before the rewrite. The painter records the rectangle it drew for each cell, and the click handler tests those exact rectangles, so what you see and what you can press can never disagree.

8Moving and hiding it

Three ways to place it

  • Drag the entry handle. The whole setup travels, box width included, and re-anchors to the candle you drop it on. This is the everyday gesture.
  • Right-click the chart and choose Position Size Calculator Pro. It lands at the exact point you clicked — that candle, that price — carrying your stop and target distances with it. It also brings the tool back if you have hidden it.
  • Drag it past the last candle. The empty space to the right is fair game, for a level you are waiting on. The width handle keeps working out there.

Hiding preserves everything

The red X takes the tool off the chart and keeps the mode, contract count, target count and shares, stop and target distances, direction and box width. Right-click to bring it back exactly as you left it. The grey H is a lighter version of the same idea: it hides only the handles, for a clean look while you read the chart.

Changing the chart's symbol starts it clean. The tool notices when the chart is switched to a different symbol and places itself fresh at the current price on the live edge, keeping your position size, mode, targets and shares, direction, box width and view state. It does not carry the old levels across — a stop that made sense on ES means nothing on 6E — and it clears every drawing from the previous symbol first, so nothing from one market can leak into another. Levels do carry across a hide-and-show on the same symbol, and across a Sierra Chart restart.

9Adapting to any instrument

The study reads Tick Size and Currency Value Per Tick from the chart it sits on, so it works on any instrument the platform can chart without configuration.

That makes one chart setting load-bearing for every figure the tool reports. If Currency Value Per Tick is wrong, nothing errors — every number simply scales by the same factor, and the results still look plausible. The classic case is trading micros on a chart configured for the full-size contract: ES is 12.50, MES is 1.25, so risk is reported ten times too large.

InstrumentTick sizeValue per tick
ES — E-mini S&P 5000.25$12.50
MES — Micro E-mini S&P 5000.25$1.25

Where a chart's values cannot be corrected, Symbol: Tick Size Override and Symbol: Currency Value Per Tick Override take precedence; both are 0 = use the chart setting. If the chart reports a zero or nonsensical tick value, the study writes a warning to the Message Log naming the symbol and the bad values rather than silently drawing nothing.

What was verified, and how

On 3 September 2026 both editions were audited line by line for anything that assumes a particular instrument. The findings and their fixes:

CheckedResult
Hardcoded tick size, tick value or price constantNone anywhere. Every figure derives from the chart's two symbol settings or from an input.
Division by zeroEvery divisor guarded. Tick size and tick value are checked once at the top and the study returns with a Message Log entry rather than drawing wrong numbers; quantity, weight sums, per-contract cost and bar pitch each have their own guard.
Negative and zero pricesEight places assumed a positive price and were rewritten. Spread charts and back-adjusted continuous contracts both print negative prices routinely, and CL itself traded below zero in April 2020. The tool now places, restores, draws and positions its buttons correctly at any price, above or below zero.
Sanity checks that used a ratio of priceReplaced with distances measured in the instrument's own ticks. A ratio is meaningless when a price can be negative or near zero; a tick count means the same thing on every instrument.
Tick-size rangeNothing depends on the magnitude. The scale spans roughly five orders of magnitude across the instruments the platform charts — from a thirty-second of a point on the bond futures down to fractions of a pip on the currency futures — and the arithmetic is identical at either end.
Price and money formattingLabels quote tick counts and money, never a raw price, so nothing depends on the instrument's decimal places. The currency prefix is an input.
Bar spacingMeasured from the chart's own bars, with a fallback when a bar duration cannot be derived. Works on time, tick, volume, range and Renko charts.
Charts with too few barsThe study returns before touching the bar arrays when fewer than two bars are loaded.
Switching the chart to another symbolFound and fixed. The study instance, its remembered values and its grab handles all survive a symbol change, and the old handles were being read back as though the user had dragged them — which mixed one symbol's levels with another's. The tool now detects the change, clears every drawing from the previous symbol, and places itself fresh on the new one with all settings kept.
What this verification is and is not. It is a complete static audit: every instrument assumption in the source was found and removed, and the reasoning is recorded above rather than asserted. It is not a substitute for loading the study on an unfamiliar symbol and looking at it. Before launch, an hour each on a currency future and an energy future — different tick size, different tick value, different price magnitude — would confirm on screen what the audit establishes in the code.

10Complete settings reference

All 55 inputs, in the order they appear in the study's settings window. Each carries a description shown in the platform when you select it.

#SettingDefaultRangeNotes
Sizing
0ModeVariable Risk3 optionsFixed Risk Amount / Variable Risk / Auto Size
1Risk Amount Per Trade250.001 – 1e9Drives Fixed Risk and Auto Size. Unused in Variable Risk.
2Position Size81 – 1,000,000An input in Variable and Fixed Risk; overwritten in Auto Size
3Maximum Position Size1001 – 1,000,000Guard against a tight stop producing an enormous position
4Size Step For + / − Buttons11 – 10,000Contracts per press
5Risk Step For + / − Buttons (Auto Size)50.001 – 1,000,000Currency per press, in Auto Size only
6Round-Turn Commission Per Contract0.000 – 10,000Added to risk, subtracted from reward. R:R is net.
7Currency Symbol$textPrefixes money on the labels
8Starting Stop Distance (Ticks)201 – 100,000Used when the tool is first placed
Targets
10Number Of Targets11 – 4Each gets its own band, label and handle
11Target 1: R Multiple2.00.1 – 100Multiple of the stop distance
12Target 1: Share Of Position1000 – 100,000A weight, not a percentage
13Target 2: R Multiple3.00.1 – 100
14Target 2: Share Of Position500 – 100,000Step to 0 to remove the target
15Target 3: R Multiple4.00.1 – 100
16Target 3: Share Of Position250 – 100,000
17Target 4: R Multiple5.00.1 – 100
18Target 4: Share Of Position250 – 100,000
Box
20Width (Bars, 0 = fit to labels)00 – 100,000A starting point only; the right-edge handle owns it afterwards
21Reward Fill Color0,128,64colourSets the band's border colour too
22Risk Fill Color185,0,0colourSets the band's border colour too
23Fill Transparency (0-100)720 – 1000 solid, 100 invisible
Labels
30ShowYesYes / No
31Text Size104 – 60Points
32Font Face (blank = chart font)ConsolastextMonospaced keeps every label the same width
33Text Color255,255,255colour
34Entry Background (Size / R:R)100,106,119colourAlso colours the entry and width handles
35Stop Background200,66,66colourAlso colours the stop handle
36Target Background56,160,105colourAlso colours the target handles
37Offset From Line (Ticks)00 – 1,000Lifts a label clear of its edge
Handles
40Marker ShapeTriangle Left8 optionsTriangle Left, X, Plus, Square, Diamond, Star, Point, Dash
41Size182 – 60Bigger is easier to grab
42Gap From Box (Bars)11 – 200How far left of the box they sit
43Snap Entry To CandleYesYes / NoNo allows free horizontal placement
Buttons
50Show On-Chart ButtonsYesYes / NoPointer events are only requested while this is on
51Cell Size (Pixels)4010 – 200Cells are square
52Gap Between Cells (Pixels)80 – 40
53Offset From Box Left Edge (Pixels)00 – 2,000
54Offset Below Lowest Level (Pixels)240 – 2,000Raise it if the bottom label overlaps
55Text Size155 – 60Points
56Font FaceSegoe UI SymboltextMust carry the glyphs below
57Background Color140,146,159colourEvery button except X, H, flip and the target chips. A lighter shade of the entry label by default.
58Text Color255,255,255colour
59Handles Button Color106,155,204colourThe H
60Hide Button Color200,66,66colourThe X
61Target Share Step10.00.1 – 100,000Per press of a target's + or −
62Symbol – Variable Mode≈  U+2248text
63Symbol – Fixed Mode↕  U+2195text
64Symbol – Auto Mode⟳  U+27F3text
65Symbol – Flip Long/Short⇅  U+21C5text
66Flip Button Color56,160,105colourThe flip arrow. Same index and default as the standard edition.
67Target Chip Color255,199,48colourThe T1–T4 chips
Symbol
70Tick Size Override00 – 1e60 = use the chart setting
71Currency Value Per Tick Override00 – 1e60 = use the chart setting
Advanced
80Drawing Line Number Base7900001,000 – 2e9A second copy on the same chart needs a different value
These index numbers are frozen. Sierra Chart stores a customer's settings by input index, so renumbering after release silently remaps everybody's saved values. The grouping was deliberately settled before the first sale, and gaps in the numbering (9, 19, 24–29 and so on) are reserved room for future settings inside their group. Never close a gap; never reorder.

11Troubleshooting

Symptom first, because that is what a customer arrives with.

SymptomCauseFix
The study isn't in the Studies listThe DLL is in the wrong folder, or Sierra Chart was running when it was copied inClose Sierra Chart fully, put the file directly in \Data\, start again
Every money figure looks ten times too big or smallThe chart's Currency Value Per Tick belongs to a different contract — the micro-on-a-full-size-chart caseCorrect it in Chart Settings › Symbol, or set Symbol: Currency Value Per Tick Override
The buttons don't respondA drawing tool is the active tool. Sierra Chart only delivers mouse events to a study when Pointer, Chart Values or Hand is activeSelect Tools › Pointer. Platform behaviour, not a setting. The right-click menu always works.
A button shows an empty boxThe chosen font doesn't carry that symbolSet Buttons: Font Face to Segoe UI Symbol, or type any character you like into that button's own symbol input
The bottom label overlaps the buttonsNot enough clearance for the label size in useRaise Buttons: Offset Below Lowest Level (Pixels)
I can't find it on the chartIt's anchored; if you've scrolled forward it may be off to the leftRight-click where you want it and choose Position Size Calculator Pro
The stop and targets won't dragFixed Risk mode — they are outputs there, not inputsSwitch to Variable Risk. The entry label reads Fixed whenever this applies.
The handles have disappearedThe grey H button was pressedPress H again. No settings were changed.
A target vanishedIts share was stepped down to zero, which is how a target is removedPress that target's +, or raise Targets: Number Of Targets
Fixed Risk shows $247.50 when I set $250The stop distance is floored to whole ticks, so risk lands at or below the amount setExpected behaviour. Nothing to fix.
Stop too wide for $250Auto Size: the stop costs more than the entire risk budget for even one contractTighten the stop or raise Sizing: Risk Amount Per Trade
A level won't cross the entryBy design — a stop cannot silently become a targetUse the flip button to change direction
Two copies on one chart interfereBoth address the same chart drawing numbersGive the second a different Advanced: Drawing Line Number Base — 800000, for example
The box is wider or narrower than expectedBox: Width is 0, so it fits itself to the widest labelDrag the right-edge handle, or set an explicit width
It re-placed itself after I changed the chart's symbolBy design: a new symbol gets a fresh placement at its own current price, with every setting keptExpected. Drag the handles to where you want them on the new symbol.

12Limits worth disclosing

A buyer who reads these first sees honesty; a buyer who discovers them first sees a bug.

LimitStatusDetail
Buttons need the Pointer toolPlatformACSIL receives mouse events only when Pointer, Chart Values or Hand is active. Unfixable. The handles and the right-click menu are unaffected.
R:R assumes every target fillsBy designNo modelling of a stop moved to breakeven after a partial. Standard convention.
Fixed Risk floors to whole ticksBy designRealised risk lands at or below the configured amount. Stated in the study description.
Two instances need different line basesOpenDocumented rather than prevented. Deriving the base from the study instance ID would remove the trap.
Equal label widths assume a monospaced fontOpenPadding is to a character count. A proportional face gives ragged widths.
Forward-space width on non-time barsOpenRight of the last candle there are no timestamps, so position is projected from the last bar's duration. Exact on time bars; drifts slightly on trade-count, volume, range and Renko charts.
Not yet run on an unfamiliar instrumentOpenAudited in full for instrument assumptions (section 9) and none remain, but it has only been watched on ES and MES. An hour each on a currency and an energy future would confirm it on screen.