Sierra Chart custom study · standard edition · complete reference · v1.0

Position Size Calculator

The standard edition: one entry, one stop, one target, and five buttons. Everything the study does, every setting it exposes, and how it differs from the Pro edition — 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
PositionSizeCalculatorStandard_64.dll
Dependencies
None — one self-contained file
Settings
39 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. Set your position size, place an entry, a stop and a target, and it tells you exactly what the trade risks in money, what it pays, and the reward-to-risk ratio — net of commission.

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.

Where it sits in the range

This is the standard edition. It does one job with no menus to learn: one target, one way of sizing, five buttons. The Pro edition is the same engine with up to four targets, and two further sizing modes that hold risk constant or solve the contract count from a risk amount. Section 11 lays the two out side by side.

What it does not do

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

2Anatomy on the chart

The box

Two filled bands: a risk band from the entry to the stop, and a reward band from the entry to the target. They meet exactly at the entry, and each carries a solid border, so the band edges are the levels — there are no separate lines to style or misalign.

The box begins one bar 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

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.
TargetVerticallySets the target distance.
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. Dedicated markers, offset clear of the price action, made the tool usable.

3How the money is calculated

You set the size and place the levels; risk, reward and the ratio are the outputs. Commission is round-turn, per contract.

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

Risk         = Quantity × (StopTicks × TickValue + Commission)
Reward       = Quantity × (TargetTicks × TickValue − Commission)

R:R          = Reward / Risk          // net of commission on both sides

The ratio is taken from the net money figures rather than from raw tick counts. With commission at zero the two are identical; set commission to $4 and a gross ratio would contradict the two currency amounts printed beside it.

The + and buttons step the position size by Sizing: Size Step, never below one contract and never above Sizing: Maximum Position Size. Every figure on the labels updates on the press.

4What 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
TargetTarget  {ticks}t  +{cur}{reward}Target 36t +$360.00
EntrySize : {qty} - RR : {ratio}Size : 8 - RR : 1.09

All three 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.

5The five buttons

One row under the box, in one of two states. There are no menus.

GlyphColourActionShownSetting for its colour
XRedHide the tool, preserving every settingAlwaysButtons: Hide Button Color
HBlueSwitch between the full view and the clean viewAlwaysButtons: Handles Button Color
GreenFlip the setup between long and shortFull viewButtons: Flip Button Color
+Button grey-bluePosition size up by one stepFull viewButtons: Background Color
Button grey-bluePosition size down by one stepFull viewButtons: 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 the three controls that act on the setup — flip, +, — off the row, leaving X and H beneath the box. Pressed again, everything returns. No level, size, 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 + or the size is fixed. That is the point of it, but it is the one thing a new user may need told once.

The flip glyph is an input, so a customer whose font lacks the symbol can type any character they like into it. The default face is Segoe UI Symbol; Consolas does not carry the arrow.

Why the buttons are pixel-drawn

The row is painted in real screen pixels through a GDI callback rather than drawn as chart objects anchored in price and time. Chart-space cells cannot be made square, and their spacing drifts as you zoom. 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 never disagree.

6Moving 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. 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 contract count, direction, stop and target distances and box width. Right-click to bring it back exactly as you left it. The blue H is a lighter version of the same idea: it leaves the box on the chart but strips it back to a clean view — no handles, and only X and H in the row.

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.

7Adapting 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 still looks 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 tick value, the study writes a warning to the Message Log naming the symbol 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.

8Complete settings reference

All 39 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
2Position Size81 – 1,000,000The + and − buttons step it
3Maximum Position Size1001 – 1,000,000Guard against one + press too many
4Size Step For + / − Buttons11 – 10,000Contracts per press
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
Target
11Starting R Multiple2.00.1 – 100Where the target sits at first placement, as a multiple of the stop distance
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 handle
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 flip arrow
57Background Color140,146,159colourThe + and − faces. 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
66Flip Button Color56,160,105colourThe up-down arrow. Same index and default in the Pro edition.
65Symbol – Flip Long/Short↕  U+2195textAny character your font carries
Symbol
70Tick Size Override00 – 1e60 = use the chart setting
71Currency Value Per Tick Override00 – 1e60 = use the chart setting
Advanced
80Drawing Line Number Base7800001,000 – 2e9Pro uses 790000, so both editions can share a chart at their defaults
The numbering is shared with Pro on purpose. Every setting that exists in both editions has the same index number in both, so a support conversation about "input 22" means the same thing whichever product the customer has. The gaps — 0, 1, 5, 10, 12–18, 61–64, 67 — are where Pro-only settings live. Sierra Chart stores a customer's settings by index, so these numbers are frozen after release: never close a gap, never reorder.

9Troubleshooting

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.
The flip button shows an empty boxThe chosen font doesn't carry the arrowSet Buttons: Font Face to Segoe UI Symbol, or type any character into Buttons: Symbol – Flip Long/Short
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
The handles are gone, and so are the flip and +/− buttonsThe blue H button was pressed — that is the clean viewPress H again. No settings were changed.
A level won't cross the entryBy design — a stop cannot silently become a targetUse the flip button to change direction
+ stops working at some sizeSizing: Maximum Position Size has been reachedRaise it. It exists to catch one press too many.
Two copies on one chart interfereBoth address the same chart drawing numbersGive the second a different Advanced: Drawing Line Number Base — 770000, 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.
I want more targets, or the size solved for meNot in this editionThat is the Pro edition — see section 11

10Limits 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.
One target, one sizing modeBy designThe defining difference from Pro. Say it plainly on the product page so nobody buys the wrong edition.
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 7) and none remain, but it has only been watched on ES and MES.

11Standard vs Pro

Same engine, same drawing, same handles. The differences are exactly these.

CapabilityPosition Size CalculatorPosition Size Calculator Pro
TargetsOneUp to four, each with its own share of the position; contract count per target shown on its label
SizingYou set the size; risk and reward are calculatedThat, plus Fixed Risk (risk held constant, stop and targets move to keep it) and Auto Size (place the stop, the contract count is solved from your risk amount)
ButtonsOne row: X, H, flip, +, −Two rows — X, H, flip, +, − then the three modes and T+ — plus a share row per target once there is more than one
Settings3955
Anchoring to a candleBoth
Grab handles, width handle, forward-space placementBoth
Right-click placement at the click pointBoth
Hide with X, preserving all settingsBoth
Net-of-commission R:RBoth
Tick size and tick value overridesBoth
Never touches an orderBoth
Line-number base780000790000
DLLPositionSizeCalculatorStandard_64.dllPositionSizeCalculatorPro_64.dll
Right-click menu entryPosition Size CalculatorPosition Size Calculator Pro
How to pitch the split

The standard edition is for someone who already knows their size and wants to see what a stop and target cost, on the chart, without learning anything. Pro is for someone who scales out, or who wants the size solved from a risk budget — the question a position size calculator is named after. Both can be installed side by side and used on the same chart.