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.
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.
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:
| Handle | Drag it | What happens |
|---|---|---|
| Entry | Any direction | Vertically, the whole setup moves and every distance is preserved. Horizontally, the tool re-anchors to whichever candle you drop it on — box width included. |
| Stop | Vertically | Sets the stop distance. Locked in Fixed Risk mode, where the stop is an output. |
| Target | Vertically | One handle per target. Locked in Fixed Risk mode. |
| Width | Horizontally | On 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.
3The three sizing modes
Which of risk, size and stop distance is the input, and which are solved for.
| Mode | You set | It solves | Use 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.
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.
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.
6What the labels say
Exact formats, so a manual can reproduce them and support can recognise them.
| Label | Format | Example |
|---|---|---|
| Stop | Stop {ticks}t -{cur}{risk} | Stop 33t -$330.00 |
| Target, single | Target {ticks}t +{cur}{reward} | Target 36t +$360.00 |
| Target, multiple | T{n} {ticks}t +{cur}{reward} [{qty}] | T2 36t +$360.00 [3] |
| Entry, Variable Risk | Size : {qty} - RR : {ratio} | Size : 8 - RR : 1.09 |
| Entry, Fixed Risk | Fixed {qty} - RR : {ratio} | Fixed 8 - RR : 2.00 |
| Entry, Auto Size | Auto {qty} - RR : {ratio} | Auto 8 - RR : 2.00 |
| Entry, Auto Size over budget | Stop too wide for {cur}{risk} | Stop too wide for $250 |
| Entry, Fixed Risk over budget | Size 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
| Glyph | Colour | Action | Setting for its colour |
|---|---|---|---|
| X | Red | Hide the tool, preserving every setting | Buttons: Hide Button Color |
| H | Blue | Switch between the full cluster and the clean view | Buttons: Handles Button Color |
| ⇅ | Green | Flip long / short | Buttons: Flip Button Color |
| + − | Button grey-blue | Position size up / down — or risk amount, in Auto Size | Buttons: Background Color |
Row two — how the size is decided
| Glyph | Colour | Action | Setting for its colour |
|---|---|---|---|
| ≈ | Button grey-blue | Variable Risk mode | Buttons: Background Color |
| ↕ | Button grey-blue | Fixed Risk Amount mode | Buttons: Background Color |
| ⟳ | Button grey-blue | Auto Size mode | Buttons: Background Color |
| T+ | Button grey-blue | Add a target, up to four | Buttons: 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.
| Glyph | Colour | Action | Setting for its colour |
|---|---|---|---|
| T1 … T4 | Yellow | Labels the row. Not a button — nothing happens if you press it. | Buttons: Target Chip Color |
| + − | Button grey-blue | That target's share of the position. Step it to nothing and the target is removed. | Buttons: Background Color |
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.
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.
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.
| Instrument | Tick size | Value per tick |
|---|---|---|
| ES — E-mini S&P 500 | 0.25 | $12.50 |
| MES — Micro E-mini S&P 500 | 0.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:
| Checked | Result |
|---|---|
| Hardcoded tick size, tick value or price constant | None anywhere. Every figure derives from the chart's two symbol settings or from an input. |
| Division by zero | Every 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 prices | Eight 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 price | Replaced 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 range | Nothing 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 formatting | Labels 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 spacing | Measured 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 bars | The study returns before touching the bar arrays when fewer than two bars are loaded. |
| Switching the chart to another symbol | Found 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. |
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.
| # | Setting | Default | Range | Notes |
|---|---|---|---|---|
| Sizing | ||||
| 0 | Mode | Variable Risk | 3 options | Fixed Risk Amount / Variable Risk / Auto Size |
| 1 | Risk Amount Per Trade | 250.00 | 1 – 1e9 | Drives Fixed Risk and Auto Size. Unused in Variable Risk. |
| 2 | Position Size | 8 | 1 – 1,000,000 | An input in Variable and Fixed Risk; overwritten in Auto Size |
| 3 | Maximum Position Size | 100 | 1 – 1,000,000 | Guard against a tight stop producing an enormous position |
| 4 | Size Step For + / − Buttons | 1 | 1 – 10,000 | Contracts per press |
| 5 | Risk Step For + / − Buttons (Auto Size) | 50.00 | 1 – 1,000,000 | Currency per press, in Auto Size only |
| 6 | Round-Turn Commission Per Contract | 0.00 | 0 – 10,000 | Added to risk, subtracted from reward. R:R is net. |
| 7 | Currency Symbol | $ | text | Prefixes money on the labels |
| 8 | Starting Stop Distance (Ticks) | 20 | 1 – 100,000 | Used when the tool is first placed |
| Targets | ||||
| 10 | Number Of Targets | 1 | 1 – 4 | Each gets its own band, label and handle |
| 11 | Target 1: R Multiple | 2.0 | 0.1 – 100 | Multiple of the stop distance |
| 12 | Target 1: Share Of Position | 100 | 0 – 100,000 | A weight, not a percentage |
| 13 | Target 2: R Multiple | 3.0 | 0.1 – 100 | |
| 14 | Target 2: Share Of Position | 50 | 0 – 100,000 | Step to 0 to remove the target |
| 15 | Target 3: R Multiple | 4.0 | 0.1 – 100 | |
| 16 | Target 3: Share Of Position | 25 | 0 – 100,000 | |
| 17 | Target 4: R Multiple | 5.0 | 0.1 – 100 | |
| 18 | Target 4: Share Of Position | 25 | 0 – 100,000 | |
| Box | ||||
| 20 | Width (Bars, 0 = fit to labels) | 0 | 0 – 100,000 | A starting point only; the right-edge handle owns it afterwards |
| 21 | Reward Fill Color | 0,128,64 | colour | Sets the band's border colour too |
| 22 | Risk Fill Color | 185,0,0 | colour | Sets the band's border colour too |
| 23 | Fill Transparency (0-100) | 72 | 0 – 100 | 0 solid, 100 invisible |
| Labels | ||||
| 30 | Show | Yes | Yes / No | |
| 31 | Text Size | 10 | 4 – 60 | Points |
| 32 | Font Face (blank = chart font) | Consolas | text | Monospaced keeps every label the same width |
| 33 | Text Color | 255,255,255 | colour | |
| 34 | Entry Background (Size / R:R) | 100,106,119 | colour | Also colours the entry and width handles |
| 35 | Stop Background | 200,66,66 | colour | Also colours the stop handle |
| 36 | Target Background | 56,160,105 | colour | Also colours the target handles |
| 37 | Offset From Line (Ticks) | 0 | 0 – 1,000 | Lifts a label clear of its edge |
| Handles | ||||
| 40 | Marker Shape | Triangle Left | 8 options | Triangle Left, X, Plus, Square, Diamond, Star, Point, Dash |
| 41 | Size | 18 | 2 – 60 | Bigger is easier to grab |
| 42 | Gap From Box (Bars) | 1 | 1 – 200 | How far left of the box they sit |
| 43 | Snap Entry To Candle | Yes | Yes / No | No allows free horizontal placement |
| Buttons | ||||
| 50 | Show On-Chart Buttons | Yes | Yes / No | Pointer events are only requested while this is on |
| 51 | Cell Size (Pixels) | 40 | 10 – 200 | Cells are square |
| 52 | Gap Between Cells (Pixels) | 8 | 0 – 40 | |
| 53 | Offset From Box Left Edge (Pixels) | 0 | 0 – 2,000 | |
| 54 | Offset Below Lowest Level (Pixels) | 24 | 0 – 2,000 | Raise it if the bottom label overlaps |
| 55 | Text Size | 15 | 5 – 60 | Points |
| 56 | Font Face | Segoe UI Symbol | text | Must carry the glyphs below |
| 57 | Background Color | 140,146,159 | colour | Every button except X, H, flip and the target chips. A lighter shade of the entry label by default. |
| 58 | Text Color | 255,255,255 | colour | |
| 59 | Handles Button Color | 106,155,204 | colour | The H |
| 60 | Hide Button Color | 200,66,66 | colour | The X |
| 61 | Target Share Step | 10.0 | 0.1 – 100,000 | Per press of a target's + or − |
| 62 | Symbol – Variable Mode | ≈ U+2248 | text | |
| 63 | Symbol – Fixed Mode | ↕ U+2195 | text | |
| 64 | Symbol – Auto Mode | ⟳ U+27F3 | text | |
| 65 | Symbol – Flip Long/Short | ⇅ U+21C5 | text | |
| 66 | Flip Button Color | 56,160,105 | colour | The flip arrow. Same index and default as the standard edition. |
| 67 | Target Chip Color | 255,199,48 | colour | The T1–T4 chips |
| Symbol | ||||
| 70 | Tick Size Override | 0 | 0 – 1e6 | 0 = use the chart setting |
| 71 | Currency Value Per Tick Override | 0 | 0 – 1e6 | 0 = use the chart setting |
| Advanced | ||||
| 80 | Drawing Line Number Base | 790000 | 1,000 – 2e9 | A second copy on the same chart needs a different value |
11Troubleshooting
Symptom first, because that is what a customer arrives with.
| Symptom | Cause | Fix |
|---|---|---|
| The study isn't in the Studies list | The DLL is in the wrong folder, or Sierra Chart was running when it was copied in | Close Sierra Chart fully, put the file directly in \Data\, start again |
| Every money figure looks ten times too big or small | The chart's Currency Value Per Tick belongs to a different contract — the micro-on-a-full-size-chart case | Correct it in Chart Settings › Symbol, or set Symbol: Currency Value Per Tick Override |
| The buttons don't respond | A drawing tool is the active tool. Sierra Chart only delivers mouse events to a study when Pointer, Chart Values or Hand is active | Select Tools › Pointer. Platform behaviour, not a setting. The right-click menu always works. |
| A button shows an empty box | The chosen font doesn't carry that symbol | Set 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 buttons | Not enough clearance for the label size in use | Raise Buttons: Offset Below Lowest Level (Pixels) |
| I can't find it on the chart | It's anchored; if you've scrolled forward it may be off to the left | Right-click where you want it and choose Position Size Calculator Pro |
| The stop and targets won't drag | Fixed Risk mode — they are outputs there, not inputs | Switch to Variable Risk. The entry label reads Fixed whenever this applies. |
| The handles have disappeared | The grey H button was pressed | Press H again. No settings were changed. |
| A target vanished | Its share was stepped down to zero, which is how a target is removed | Press that target's +, or raise Targets: Number Of Targets |
| Fixed Risk shows $247.50 when I set $250 | The stop distance is floored to whole ticks, so risk lands at or below the amount set | Expected behaviour. Nothing to fix. |
Stop too wide for $250 | Auto Size: the stop costs more than the entire risk budget for even one contract | Tighten the stop or raise Sizing: Risk Amount Per Trade |
| A level won't cross the entry | By design — a stop cannot silently become a target | Use the flip button to change direction |
| Two copies on one chart interfere | Both address the same chart drawing numbers | Give the second a different Advanced: Drawing Line Number Base — 800000, for example |
| The box is wider or narrower than expected | Box: Width is 0, so it fits itself to the widest label | Drag the right-edge handle, or set an explicit width |
| It re-placed itself after I changed the chart's symbol | By design: a new symbol gets a fresh placement at its own current price, with every setting kept | Expected. 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.
| Limit | Status | Detail |
|---|---|---|
| Buttons need the Pointer tool | Platform | ACSIL 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 fills | By design | No modelling of a stop moved to breakeven after a partial. Standard convention. |
| Fixed Risk floors to whole ticks | By design | Realised risk lands at or below the configured amount. Stated in the study description. |
| Two instances need different line bases | Open | Documented rather than prevented. Deriving the base from the study instance ID would remove the trap. |
| Equal label widths assume a monospaced font | Open | Padding is to a character count. A proportional face gives ragged widths. |
| Forward-space width on non-time bars | Open | Right 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 instrument | Open | Audited 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. |