Documentation

Block Reference

Complete reference for all 70 blocks in the partiqon graph editor. Every block has a strongly-typed socket system: Number, Bar, Boolean, DateTime. Invalid connections are rejected before you run.

Blocks marked tunable can be exposed to PSO optimization. All indicators are computed on closed bars only — no lookahead bias.

Source13 Aggregator8 Indicator21 Gate4 Compare5 Logic4 Math11 Sink4

Source

Raw data inputs — bar prices, tick prices, position state, time constants. Source blocks have no inputs.

Tick Price
Source.Tick.Price
Latest tick bid/ask/mid prices from live data. Only available when the graph timeframe is set to TICKS. For bar-based graphs use Source.Bar.Current instead.
bidNumber — use for SHORT entries
midNumber — use for indicators
askNumber — use for LONG entries
Current Bar
Source.Bar.Current
The bar that just closed. The primary data source for bar-based graphs. Not available for tick data (use Tick Price → Aggregator instead).
barBar — closed OHLCV bar
Current Time
Source.Time.Now
Unix-millisecond timestamp of the current bar's close. Wire into Gate.Session directly, or compare against Source.Constant.DateTime for time-conditional logic.
timeDateTime — Unix ms
Constant (Number)
Source.Constant.Number
A fixed number that does not change bar-to-bar. Mark as tunable to expose to PSO — the optimizer will search the range you specify.
valueNumber
valuenumber default 0tunable
Constant (Time)
Source.Constant.DateTime
A fixed time-of-day in CET (e.g. 09:00). Useful for comparing against Source.Time.Now to build custom session filters.
valueDateTime
hourinteger 0–23, default 9
minuteinteger 0–59, default 0
Constant (Boolean)
Source.Constant.Boolean
A fixed true or false value. Useful for temporarily disabling a gate branch without rewiring.
valueBoolean
valueboolean default true
Bar → Field
Source.Bar.Field
Extracts a single numeric field from a Bar object. Use to feed a specific price field (e.g. close) into a Math or Compare block.
barBar
valueNumber
fieldenum open | high | low | close | volume | bid | ask, default close
Bars Since Entry
Source.BarsSinceEntry
Number of bars elapsed since the current position was opened. Returns −1 when flat, 0 on the entry bar, 1 on the next bar, etc. Use with Compare.GTE for time-based exits.
valueNumber — −1 when flat
High Since Entry
Source.HighSinceEntry
Tracks the maximum bar.high seen since the position opened. Returns 0 when flat. Classic use: HighSinceEntry − (ATR × mult)Sink.UpdateStop for a Chandelier trailing stop on longs.
valueNumber — 0 when flat
Low Since Entry
Source.LowSinceEntry
Tracks the minimum bar.low seen since the position opened. Returns 0 when flat. Mirror of High Since Entry for short positions: LowSinceEntry + (ATR × mult) → trailing stop.
valueNumber — 0 when flat
Position Entry Price
Source.PositionEntryPrice
The fill price of the currently open position. Returns 0 when flat. Use to compute distance-from-entry for profit-target or breakeven logic.
valueNumber — 0 when flat
Position Stop-Loss
Source.PositionStopLoss
The current stop-loss price level of the open position. Returns 0 when flat. Use as the lower bound in trailing logic: Math.Max(PositionStopLoss, newTrail) prevents the stop moving away.
valueNumber — 0 when flat
Position PnL (points)
Source.PositionPnLPoints
Unrealised PnL in price points: close − entry for longs, entry − close for shorts. Returns 0 when flat. Use with Compare.GT to gate trailing stop activation (e.g. only trail after +20 pts profit).
valueNumber — 0 when flat

Aggregator

Timeframe resampling. All aggregators emit the last fully closed bar — no partial bars, no lookahead. A bar is held stable until the next one closes.

Tick→M1 Aggregator
Aggregator.TickToBar.M1
Aggregates raw tick prices into 1-minute OHLC bars. Wire Source.Tick.Price → mid into price, then feed bar output to indicators. Only available in tick-data mode.
priceNumber
barBar — completed M1 bar
Tick→M5 Aggregator
Aggregator.TickToBar.M5
Aggregates raw tick prices into 5-minute OHLC bars. Same semantics as Tick→M1 but at 5-minute granularity.
priceNumber
barBar — completed M5 bar
M1 Aggregator
Aggregator.M1
Pass-through for M1 bars. The output is identical to the input. Included for graph symmetry when mixing M1 and higher-TF aggregators in the same graph.
barBar
barBar
M5 Aggregator
Aggregator.M5
Resamples finer bars (e.g. M1) into M5 bars. Output only changes when a new M5 bar closes — stable throughout the M5 period.
barBar
barBar — last closed M5 bar
M15 Aggregator
Aggregator.M15
Resamples finer bars into M15 bars. Use to build multi-timeframe setups: e.g. M5 graph that filters entries via M15 EMA slope.
barBar
barBar — last closed M15 bar
M30 Aggregator
Aggregator.M30
Resamples finer bars into M30 bars. No lookahead — output is frozen at the most recent completed M30 bar.
barBar
barBar — last closed M30 bar
M60 (H1) Aggregator
Aggregator.M60
Resamples finer bars into 60-minute (H1) bars. Stable throughout the hour; emits a new bar on each H1 close.
barBar
barBar — last closed H1 bar
Daily (D1) Aggregator
Aggregator.D1
Resamples intraday bars into daily bars (day boundary at UTC+1 midnight). Emits the last completed daily bar — stable all day. Use with Indicator.EMA for a clean daily-trend filter.
barBar
barBar — last closed daily bar

Indicator

Technical indicators computed on closed-bar data. All return 0 until enough history is available. Formulas shown use standard notation: N = period, t = current bar.

EMA
Indicator.EMA
Exponential Moving Average. Weights recent closes more heavily than older ones. The smoothing factor α determines the decay rate.
α = 2 / (N + 1) EMA[t] = close[t] × α + EMA[t-1] × (1 - α) Seed: EMA[N-1] = SMA of first N closes
bar →Bar
value ←Number
periodinteger 2–500, default 20tunable
SMA
Indicator.SMA
Simple Moving Average. Arithmetic mean of the last N closes. Slower to react than EMA — good for stable trend filters and Bollinger Band midlines.
SMA[t] = (close[t] + close[t-1] + … + close[t-N+1]) / N
bar →Bar
value ←Number
periodinteger 2–500, default 20tunable
ATR
Indicator.ATR
Average True Range. Direction-free volatility measure. The True Range captures the largest of the current candle range, the gap-up, and the gap-down relative to the prior close. ATR is the Wilder-smoothed average.
TR[t] = max(high[t] − low[t], |high[t] − close[t-1]|, |low[t] − close[t-1]|) ATR[t] = (ATR[t-1] × (N-1) + TR[t]) / N (Wilder smoothing) Seed: ATR[N-1] = mean(TR[0..N-1])
bar →Bar
value ←Number
periodinteger 2–200, default 14
RSI
Indicator.RSI
Relative Strength Index (0–100). Measures momentum by comparing average gains to average losses using Wilder smoothing. Classic thresholds: <30 oversold (long signal), >70 overbought (short signal).
ΔC[t] = close[t] − close[t-1] Gain[t] = max(ΔC, 0), Loss[t] = max(−ΔC, 0) AvgGain / AvgLoss: Wilder EMA(N) of Gain / Loss RS = AvgGain / AvgLoss RSI = 100 − 100 / (1 + RS)
bar →Bar
value ←Number 0–100
periodinteger 2–100, default 14
ADX
Indicator.ADX
Average Directional Index (0–100). Measures trend strength irrespective of direction. ADX >25 = strong trend; ADX <20 = no trend / range. Internally computes +DI and −DI but only exposes ADX.
+DM = high[t] − high[t-1] if > 0 else 0 (and > −DM) −DM = low[t-1] − low[t] if > 0 else 0 (and > +DM) Smooth +DM, −DM, TR with Wilder EMA(N) +DI = 100 × Smooth(+DM) / ATR(N) −DI = 100 × Smooth(−DM) / ATR(N) DX = 100 × |+DI − −DI| / (+DI + −DI) ADX = Wilder EMA(DX, N)
bar →Bar
value ←Number 0–100
periodinteger 2–100, default 14
VWAP
Indicator.VWAP
Volume-Weighted Average Price. Resets each trading session (UTC+1 midnight). Represents the "fair value" price of the day weighted by transaction volume. Reverts to 0 at session open until first bar arrives.
TP[t] = (high[t] + low[t] + close[t]) / 3 VWAP[t] = Σ(TP[i] × vol[i], i=session_start..t) / Σ(vol[i], i=session_start..t) Resets: daily at UTC+1 midnight
bar →Bar
value ←Number
Stochastic
Indicator.Stochastic
Stochastic oscillator (0–100). %K measures where the close sits within the recent high-low range; %D smooths %K. Extremes (<20 oversold, >80 overbought) signal reversals; %K/%D crossovers signal momentum shifts.
%K[t] = 100 × (close[t] − Lowest(low, k_period)) / (Highest(high, k_period) − Lowest(low, k_period)) %D[t] = SMA(%K, d_period)
bar →Bar
k ←Number fast stochastic 0–100
d ←Number signal line 0–100
k_periodinteger 2–100, default 14
d_periodinteger 1–50, default 3
Bollinger Bands
Indicator.BollingerBands
Volatility envelope: SMA ± σ standard deviations. Price touching the lower band = statistically extreme (long entry for MR). Squeeze (narrow bands) = volatility compression, often precedes breakout.
Middle = SMA(close, N) σ_std = population std dev of close over N bars Upper = Middle + sigma × σ_std Lower = Middle − sigma × σ_std
bar →Bar
upper / middle / lower ←Number
periodinteger 2–500, default 20
sigmanumber 0.1–5.0, default 2.0
Highest(N)
Indicator.Highest
Rolling maximum of a specified bar field over the last N bars (current bar inclusive). Use for Donchian-style breakout levels or resistance detection.
Highest[t] = max(field[t], field[t-1], …, field[t-N+1])
bar →Bar
value ←Number
periodinteger 2–500, default 20
fieldenum open|high|low|close, default high
Lowest(N)
Indicator.Lowest
Rolling minimum of a specified bar field over the last N bars. Mirror of Highest(N) — use for Donchian support levels or entry triggers below recent lows.
Lowest[t] = min(field[t], field[t-1], …, field[t-N+1])
bar →Bar
value ←Number
periodinteger 2–500, default 20
fieldenum open|high|low|close, default low
Consecutive Up/Down Bars
Indicator.ConsecutiveBars
Counts the current streak of consecutive higher-close or lower-close bars. The opposite counter resets to 0 on a direction change. Use for streak-reversal entries: e.g. 4+ down bars → long fade.
if close[t] > close[t-1]: up_count += 1; down_count = 0 elif close[t] < close[t-1]: down_count += 1; up_count = 0
bar →Bar
up_count ←Number resets to 0 on a down bar
down_count ←Number resets to 0 on an up bar
Swing High
Indicator.SwingHigh
Identifies confirmed pivot highs using an N-bar fractal: bar[t].high must be the maximum of the surrounding 2N+1 bars. Because the right-side N bars must close before confirmation, the signal fires N bars after the actual pivot — no lookahead bias. The price output holds the most recent confirmed pivot high level.
Pivot at bar[p] if: high[p] = max(high[p-N .. p+N]) Confirmed at bar[p+N] (right side complete) price = high[p] (held until next pivot)
bar →Bar
price ←Number most recent swing-high level
confirmed ←Boolean true only on confirmation bar
lookbackinteger 1–50, default 5tunable
Swing Low
Indicator.SwingLow
Mirror of Swing High for pivot lows. Fires N bars after the actual low point once the right-side N bars have confirmed the minimum. Use price as a structural stop anchor or confirmed as a counter-trend entry trigger.
Pivot at bar[p] if: low[p] = min(low[p-N .. p+N]) Confirmed at bar[p+N] price = low[p] (held until next pivot)
bar →Bar
price ←Number most recent swing-low level
confirmed ←Boolean true only on confirmation bar
lookbackinteger 1–50, default 5tunable
MACD
Indicator.MACD
Moving Average Convergence Divergence. Classic momentum indicator: the MACD line measures the gap between a fast and slow EMA. The signal line is an EMA of the MACD. The histogram makes divergences visible bar-to-bar.
MACD[t] = EMA(close, fast) − EMA(close, slow) signal[t] = EMA(MACD, signal_period) histogram[t] = MACD[t] − signal[t] Positive histogram → upward momentum building
bar →Bar
macd ←Number MACD line
signal ←Number signal line
histogram ←Number MACD − signal
fast_periodinteger 2–200, default 12
slow_periodinteger 5–500, default 26
signal_periodinteger 2–100, default 9
Efficiency Ratio (ER)
Indicator.EfficiencyRatio
Kaufman Efficiency Ratio. Divides the net price displacement over N bars by the total path length (sum of absolute bar-to-bar changes). ER → 1.0 = trending cleanly; ER → 0.0 = choppy noise. DAX research: 78.5% of days have ER < 0.15.
direction = |close[t] − close[t-N]| noise = Σ |close[i] − close[i-1]| for i = t-N+1 .. t ER[t] = direction / noise (range 0.0–1.0) Returns 0 until N+1 bars available
bar →Bar
value ←Number 0.0–1.0
periodinteger 2–500, default 20tunable
Keltner Channel
Indicator.KeltnerChannel
ATR-based envelope around an EMA. Unlike Bollinger Bands (standard deviation), the channel width scales with true-range volatility, so it stays tighter in ranging markets. Classic squeeze signal: Bollinger Bands contracting inside the Keltner channel predicts a volatility expansion.
middle = EMA(close, ema_period) upper = middle + mult × ATR(atr_period) lower = middle − mult × ATR(atr_period)
bar →Bar
upper / middle / lower ←Number
ema_periodinteger 2–500, default 20tunable
atr_periodinteger 2–200, default 14
multnumber 0.1–10.0, default 2.0tunable
Z-Score
Indicator.ZScore
Rolling statistical z-score of close relative to its recent mean and standard deviation. Measures how many standard deviations price is from its recent average. Z < −2 = statistically cheap (long MR entry); Z > +2 = statistically expensive (short MR entry).
mean[t] = SMA(close, N) std[t] = population std dev of close over N bars Z[t] = (close[t] − mean[t]) / std[t] Returns 0 until N bars available. std=0 → Z=0.
bar →Bar
value ←Number typical range ±1.5 to ±3.0
periodinteger 2–500, default 20tunable
Pivot Points
Indicator.PivotPoints
Classic floor-trader pivot points computed from the prior day's high, low, and close (UTC+1). All 7 levels update once per day and are stable intraday. Returns 0 for all outputs until the first complete trading day passes.
P = (prev_H + prev_L + prev_C) / 3 R1 = 2P − prev_L R2 = P + (prev_H − prev_L) R3 = prev_H + 2 × (P − prev_L) S1 = 2P − prev_H S2 = P − (prev_H − prev_L) S3 = prev_L − 2 × (prev_H − P)
bar →Bar
p ←Number pivot point
r1, r2, r3 ←Number resistance levels 1–3
s1, s2, s3 ←Number support levels 1–3
Support & Resistance
Indicator.SupportResistance
Composite structural level detector. Combines pivot fractals, session extremes, prior-day high/low, overnight range, weekly extremes, opening range, and round numbers into a unified support/resistance model. Levels within merge_zone_pts are merged. Proximity gates use ATR multiples to define the "touch zone".
Inputs: bar + atr_value Level sources: • N-bar pivot fractal highs/lows (pivot_lookback) • Session high/low (reset at session_open_hour) • Previous calendar day H/L • Overnight range H/L (22:00–overnight_end_hour CET) • Weekly Mon–Fri H/L • Opening range H/L (first or_duration_minutes) • Round numbers (every round_number_step pts) Merge: levels within merge_zone_pts → single level at_support = dist_support ≤ touch_zone_atr_mult × ATR
barBar
atr_valueNumber from Indicator.ATR
support / resistanceNumber nearest level price
dist_support / dist_resistanceNumber ATR units
at_support / at_resistanceBoolean proximity gate
session_high, session_lowNumber
prev_day_high, prev_day_lowNumber
overnight_high, overnight_lowNumber
weekly_high, weekly_lowNumber
or_high, or_lowNumber opening range
or_completeBoolean OR window closed
pivot_lookbackinteger 3–50, default 10tunable
touch_zone_atr_multnumber 0.1–2.0, default 0.5tunable
merge_zone_ptsnumber 1–50, default 5tunable
round_number_stepnumber 10–1000, default 100
session_open_hourinteger 0–23, default 8
session_open_minuteinteger 0–59, default 0
or_duration_minutesinteger 5–120, default 30tunable
overnight_end_hourinteger 0–12, default 9
Second Attempt
Indicator.SecondAttempt
Fires when price makes its second approach to a level after having pulled back cleanly by at least pullback_min_atr ATRs. The first touch flushes weak longs/shorts; the second is statistically stronger. Wire a SupportResistance.support price into level.
State machine per level: IDLE → TOUCHING (close within touch_zone) TOUCHING → PULLED_BACK (moved away ≥ pullback_min_atr) PULLED_BACK → TOUCHING (second approach) → is_second_attempt = true (fires once) attempt_count increments on each approach max_bars_between: resets state if too much time passes
bar →Bar
level →Number e.g. SupportResistance.support
atr →Number
is_second_attempt ←Boolean
attempt_count ←Number
is_supportboolean default true
pullback_min_atrnumber 0.1–3.0, default 0.5tunable
max_bars_betweeninteger 3–100, default 20tunable
Break + Retest
Indicator.LevelBreakRetest
Detects a clean level break then waits for a pullback retest. A break is confirmed when close is beyond the level by break_atr_mult × ATR. Once broken, is_breakout stays true until a retest is detected or max_retest_bars expires. Retesting the broken level from the new side fires is_retest_long or is_retest_short once.
Break confirmed: close > level + break_atr_mult × ATR (upward) → is_breakout = true, broken_level = level Retest (long): close < broken_level + touch_zone_atr_mult × ATR → is_retest_long = true (fires once) State resets if max_retest_bars exceeded
bar →Bar
level →Number
atr →Number
is_breakout ←Boolean true while waiting for retest
is_retest_long ←Boolean fires once on long retest
is_retest_short ←Boolean fires once on short retest
broken_level ←Number
break_atr_multnumber 0.1–2.0, default 0.3tunable
touch_zone_atr_multnumber 0.1–2.0, default 0.5tunable
max_retest_barsinteger 3–60, default 15tunable

Gate

Filters that block or allow entry based on time, trend, volatility, or regime. Wire Gate outputs into Logic.And with your entry conditions. All gates are permissive until warmed up.

Session Filter
Gate.Session
True iff the current bar's timestamp falls within the configured CET window. Use to restrict entries to the main trading session and avoid low-liquidity periods (pre-market, post-close).
bar →Bar
allowed ←Boolean
start_hourinteger 0–23, default 7
start_minuteinteger 0–59, default 0
end_hourinteger 0–23, default 20
end_minuteinteger 0–59, default 0
use_cetboolean default true
Trend Gate
Gate.TrendGate
Blocks LONG entries when the ATR-normalised EMA slope is more negative than the threshold. Intended for mean-reversion strategies that should not fade a strong downtrend. The slope output is available for further gating or plotting.
slope[t] = (EMA[t] − EMA[t − slope_lookback]) / (ATR[t] × slope_lookback) (ATR-normalised) allow_long = slope[t] ≥ block_long_below_slope
bar →Bar
allow_long ←Boolean
slope ←Number + = uptrend, − = downtrend
ema_periodinteger 5–500, default 50
atr_periodinteger 2–200, default 14
slope_lookbackinteger 2–200, default 12
block_long_below_slopenumber −5.0–5.0, default −0.5tunable
Volatility Gate
Gate.VolatilityGate
Blocks all entries when current ATR is in an extreme percentile of recent history. Prevents trading during abnormal volatility spikes (e.g. flash crashes, macro data releases). The percentile output shows the rolling rank 0–1.
atr_history = rolling window of ATR(atr_period) values percentile[t] = rank of ATR[t] in atr_history / len(atr_history) (0=lowest, 1=highest) allow_entry = percentile[t] ≤ block_above_percentile
bar →Bar
allow_entry ←Boolean
percentile ←Number 0–1 ATR rank
atr_periodinteger 2–200, default 14
percentile_windowinteger 100–20000, default 2000
block_above_percentilenumber 0.0–1.0, default 0.80tunable
Regime Filter
Gate.RegimeFilter
Classifies the current market into four mutually-exclusive regimes using a multi-signal model. Each regime is exposed as a Boolean output so you can gate different strategy logic to the regime where it performs best.
Inputs used: EMA(fast) / EMA(slow) slope + separation ATR percentile (rolling) Range compression ratio (recent vs historical) Regimes: TRENDING = |slope| ≥ min_slope AND separation ≥ min_sep AND ATR ≥ min_atr_for_trending MEAN_REVERTING = |slope| ≤ max_slope AND atr_pct ≤ max_pct BREAKOUT = range_compression ≤ bo_min_range_compression AND ATR ≥ min_atr_for_breakout NEUTRAL = none of the above All require min_bars_in_regime consecutive bars
bar →Bar
is_trending ←Boolean
is_mean_reverting ←Boolean
is_breakout ←Boolean
is_neutral ←Boolean
ema_fast_periodinteger default 20
ema_slow_periodinteger default 50
atr_periodinteger default 14
trending_min_ema_slopenumber default 0.3tunable
trending_min_ema_separationnumber default 0.15tunable
mr_max_ema_slopenumber default 0.15tunable
mr_max_atr_percentilenumber default 0.4tunable
min_atr_for_trendingnumber default 15.0tunable
min_atr_for_breakoutnumber default 12.0tunable

Compare

Numeric comparison operators. Two Number inputs → one Boolean output. No parameters except Compare.EQ which has an epsilon tolerance.

BlockTypeLogicNotes
a > bCompare.GTtrue if a > bstrict, no tolerance
a ≥ bCompare.GTEtrue if a ≥ b
a < bCompare.LTtrue if a < bstrict
a ≤ bCompare.LTEtrue if a ≤ b
a ≈ bCompare.EQ|a − b| < εparam epsilon default 1e-9

All compare blocks have two Number inputs named a and b, and one Boolean output named value.

Logic

Boolean logic gates for combining conditions. AND/OR/NOT have no parameters. IF-THEN-ELSE bridges Boolean conditions into numeric values.

BlockTypeInputsOutputLogic
ANDLogic.Anda, b (Boolean)Booleana AND b
ORLogic.Ora, b (Boolean)Booleana OR b
NOTLogic.Nota (Boolean)BooleanNOT a
IF-THEN-ELSELogic.IfThenElsecondition (Bool), value_if_true, value_if_false (Number)Numbercondition ? a : b

Use Logic.And to combine gate conditions (session AND regime AND entry signal). Use Logic.IfThenElse to select between two stop distances based on a condition, or implement a breakeven guard.

Math

Arithmetic operations on Number streams. Most have two Number inputs and one Number output. Crossover blocks output Boolean. Rolling blocks operate over a history window.

BlockTypeFormula / Notes
a + bMath.Addvalue = a + b
a − bMath.Subvalue = a − b. Use: HighSinceEntry − ATR×mult for trailing
a × bMath.Mulvalue = a × b. Use: ATR × constant for dynamic SL sizing
a ÷ bMath.Divvalue = a / b. Returns 0 if |b| < 1e-12 (prevents NaN)
|a|Math.Absvalue = |a|. Single input.
min(a,b)Math.Minvalue = min(a, b)
max(a,b)Math.Maxvalue = max(a, b). Use: max(PositionStopLoss, newTrail) to only tighten
a crosses above bMath.CrossesAbovetrue only on the bar where a transitions from ≤ b to > b (prev_a ≤ b AND a > b)
a crosses below bMath.CrossesBelowtrue only on the bar where a transitions from ≥ b to < b
Rolling SMAMath.RollingSMASMA of upstream Number stream over param period (2–1000, default 20)tunable. E.g. SMA(ATR, 50)
Lag(N)Math.LagReturns value from N bars ago (param period 1–500, default 1). Returns 0 until N+1 values seen

The Math.CrossesAbove / Math.CrossesBelow blocks output Boolean. All other Math blocks output Number. Rolling SMA and Lag take a single Number input named value; all others take a (and b where applicable).

Sink

Output blocks that interact with the position manager. Sinks have no outputs — they cause side effects (opening positions, closing them, moving stops).

Entry LONG
Sink.Entry.Long
Opens a LONG position when trigger fires true and no position is currently open. SL and TP distances are captured at fire-time and measured from the actual fill price. Leave entry_price unconnected or zero for a market order.
triggerBoolean entry fires on true when flat
stop_loss_distanceNumber points below fill price
take_profit_distanceNumber points above fill price
entry_priceNumber optional: limit price; 0 = market
reasonstring default "graph_long"
Entry SHORT
Sink.Entry.Short
Opens a SHORT position when trigger fires true and no position is currently open. SL and TP are distances from fill price — they are added and subtracted respectively in the SHORT direction automatically.
triggerBoolean entry fires on true when flat
stop_loss_distanceNumber points above fill price
take_profit_distanceNumber points below fill price
entry_priceNumber optional: limit price; 0 = market
reasonstring default "graph_short"
Exit
Sink.Exit
Closes the open position when trigger fires true. Use side_filter to make the exit apply only to LONG or SHORT positions — useful when you have separate LONG and SHORT exit conditions wired to separate Exit blocks.
triggerBoolean
side_filterenum ANY | LONG | SHORT, default ANY
reasonstring default "graph_exit"
Update Stop-Loss
Sink.UpdateStop
Moves the open position's stop to the absolute price value when trigger fires. Only tightens — if the new stop would widen the risk, the update is ignored. This prevents trailing stop logic from accidentally moving the stop away from the position.
For LONG: new_stop applied only if value > current_stop For SHORT: new_stop applied only if value < current_stop Typical pattern: HighSinceEntry → Sub(ATR×mult) → Max(PositionStopLoss, …) → UpdateStop
triggerBoolean fires only while in position
valueNumber absolute stop price level
side_filterenum ANY | LONG | SHORT, default ANY