Back to Help Center
Blueprint

Blueprint Node Reference

Read 16 min read
Risk notice: Blueprint nodes can generate automated trading actions, but a node combination does not guarantee profit. Before live trading, backtest first, then validate with paper trading or small size. Do not enable withdrawal permission on exchange API keys.

1. How Blueprints Work

A blueprint is an event-driven strategy flowchart. An executable blueprint usually contains these node groups:

  • Event nodes: Decide when the strategy runs, such as startup, each candle, each Tick, a timer, or an order receipt.
  • Market nodes: Read the current mounted symbol, candles, latest price, order book, account, and position.
  • Indicator nodes: Calculate technical indicators from candles or numeric series.
  • Signal/logic nodes: Convert indicators and prices into boolean conditions for entry, exit, or chart output.
  • Risk nodes: Add rate limits, kill switches, minimum quantity checks, maximum position limits, cooldowns, stop loss, and take profit rules.
  • Order/function nodes: Generate entry, exit, close, cancel, and strategy exit rule actions.
  • State nodes: Store variables, maintain counters, persist state, and detect signal changes.
  • Tool nodes: Run expressions, cast types, calculate arithmetic, normalize values, and round precision.
  • Chart nodes: Display indicator lines, horizontal lines, backgrounds, markers, tables, and order markers on the chart.

A typical strategy chain looks like this:

OnBar / OnBarClose
  -> Symbol Selector
  -> Get OHLCV
  -> Indicator nodes
  -> Signal/logic nodes
  -> Risk nodes
  -> strategy.entry / strategy.close / order nodes

If the execution timeframe is 15m but the market filter uses 1h data, configure it like this:

event.on_bar(timeframe=15m)
  -> market.symbol_selector
  -> market.get_ohlcv(timeframe=1h, limit=200)
  -> 1h indicators and filters
  -> 15m execution chain

2. Ports, Connections, and Parameters

Each node consists of input ports, output ports, and parameters.

ConceptDescription
Input portReceives events or data. If not connected, some nodes use parameter defaults.
Output portOutputs events, numbers, booleans, symbols, order intents, chart references, and other values.
ParameterConfigured in the right property panel. Exposed parameters appear in the strategy parameter panel and can be changed when mounting.
multi inputAllows multiple connections into the same input port. Common examples:riskInputs, order plot, and chart.plotchar.shape.

Flow Types

Flow typePurposeCommon scenarios
eventControls execution order and side-effect triggerseventIn -> order, state write, chart drawing
dataPasses data valuesPrice, indicator, boolean condition, symbol, risk intent
uiLegacy visual chain type for chart/UI nodesCurrent chart nodes are mostly terminal visual nodes

Value Types

TypeMeaningCommon source
anyAny value typeExpression inputs, dynamic labels, compatibility ports
voidTypeEvent without dataTrigger outputs from event nodes
number / integer / doubleTypeNumber, integer, doubleIndicators, price calculations, counters
boolTypeBoolean conditionCompare, AND/OR, signal nodes
textTextLabels, comments, state text
symbolTrading pairSymbol Selector
timeframeTimeframeTimeframe filters
timestampTimeDate filters, chart time ranges
seriesNumberNumeric seriesVolume and time series
ohlcvSeriesCandle seriesOpen/high/low/close from Get OHLCV
chartVisualRef / chartPlotRef / chartHLineRefChart object referencePlot, HLine, Fill, order marker templates
pricePriceLast Price, Bid/Ask, Mark Price
orderIntentRisk or order intentRisk node outputs, order node inputs
orderUpdateOrder receiptOrder event nodes
position / balance / accountPosition, balance, account snapshotAccount and position market nodes

Compile and Connection Rules

  • A blueprint must contain at least one event source node, otherwise it will not run.
  • Data flow must be acyclic. If data nodes form a loop, compilation fails.
  • If event flow forms a loop, add logic.gate for throttling, otherwise high-frequency repeated triggers may occur.
  • Data port types must match. If types do not match, insert tool.cast_number, tool.cast_integer, or tool.cast_bool.
  • A normal input port allows only one connection. Ports that support multiple connections are marked in the node definition.
  • Order nodes must connect eventIn; without an event trigger, they will not execute.
  • When a blueprint contains order nodes, connect at least one risk node to riskInputs. The compiler may warn that order nodes exist without risk nodes or that order nodes have no risk input.
  • market.symbol_selector outputs the symbol from the current backtest, mount, or debug context. It is suitable for reusable blueprint templates, and avoids hardcoding a symbol in the template.
  • market.get_ohlcv with timeframe=runtime follows the runtime timeframe. For higher-timeframe filters, explicitly select 1h, 15m, or another timeframe.

3. High-Frequency Strategy Guidelines

High-frequency or high-turnover strategies should control trigger frequency and order frequency first:

  • Prefer event.on_bar or event.on_bar_close as the main trigger. Use event.on_tick only when Tick-level reaction is explicitly required.
  • If you use event.on_tick or a short event.on_timer, add one or more of logic.gate, risk.max_order_rate, and logic.once_per_bar downstream.
  • If you do not want repeated entries on the same candle, use logic.once_per_bar or state.last_signal.
  • Avoid repeatedly requesting a large candle count at Tick level. Set market.get_ohlcv.limit based on indicator needs; 100-300 is usually enough.
  • Execution timeframe and decision timeframe can be separated. For example: 15m execution with 1h filtering means the event node uses 15m, while the market node uses 1h.
  • For live trading chains, keep risk.kill_switch, risk.order_validation, risk.max_position_size, and risk.max_order_rate connected by default.
  • For strategies that pause after losses, add risk.cooldown_after_loss or risk.daily_consecutive_loss_cooldown.

4. Event Nodes

Event nodes are blueprint execution entry points. Without an event node, market, indicator, logic, and order nodes will not form runtime frames.

Node IDNameMain inputsMain outputsParametersPurpose and notes
event.on_startOnStartNoneout triggerNoneTriggers once when the strategy starts. Useful for initializing variables or reading the first snapshot.
event.on_stopOnStopenabledout triggerNoneTriggers once when the strategy stops. Useful for cleanup logic. If enabled is not connected, it is treated as enabled by default.
event.on_barOnBartimeframeout triggertimeframe defaults to 1m, options: 1s/1m/5m/15m/1hTriggers by timeframe and is the recommended default strategy entry.
event.on_bar_openOnBarOpentimeframeout triggerSame as OnBarTriggers when each candle opens. Useful for open-of-bar execution.
event.on_bar_closeOnBarClosetimeframeout triggerSame as OnBarTriggers when each candle closes. Use confirmed candles to reduce repainting.
event.on_tickOnTickNoneout triggerNoneTriggers on each Tick and has the highest frequency. Must be paired with throttling and risk control.
event.on_timerOnTimerenabled, intervalSecout triggerintervalSec=60, range 1-86400 secondsTriggers at a fixed interval. Inputs can override parameters.
event.on_order_updateOnOrderUpdatesymbol, side, status filtersevent, orderNoneTriggers on order/fill receipts. Useful for updating state or adding TP/SL after a fill.
event.on_trade_transactionOnTradeTransactionsymbol, side, status filtersevent, orderNoneTriggers on trade transaction updates. Useful for finer-grained order state handling.
event.on_position_updateOnPositionUpdatesymbol, side filtersevent, positionNoneTriggers on position changes. Useful for position sync and risk state updates.

5. Market Nodes

Market nodes read symbol, candles, prices, account, and position data from the current runtime context.

Node IDNameMain inputsMain outputsParametersPurpose and notes
market.symbol_selectorSymbol SelectoreventIneventOut, symbolNoneOutputs the currently mounted or backtested symbol. Do not hardcode symbol in the blueprint.
market.get_ohlcvGet OHLCVsymbolseries/open/high/low/close/hlc3/ohlc4/volume/timelimit=200, timeframe=runtime/1m/5m/15m/1hFetches the latest N candles. Indicators usually connect to series or close; volatility indicators can use high/low/close.
market.last_priceGet Last PricesymbolpriceNoneReads the latest traded price. Useful for real-time conditions or chart levels.
market.bid_askGet Bid/Asksymbolbid, askNoneReads best bid and best ask. Useful for estimating slippage or active/passive execution.
market.mark_priceGet Mark PricesymbolpriceNoneReads perpetual futures mark price. Useful for futures risk checks.
market.account_snapshotGet Balance/PositioneventIneventOut, balance, positionNoneReads account balance and position snapshot. Connect event input to control read timing.
market.position_stateGet Position Statesymbolqty/absQty/side/entryPrice/openTimeMs/unrealizedPnl/isFlatNoneOutputs current symbol position state. Commonly used for “enter only when flat” and “exit only when holding”.

6. Indicator Nodes

Most indicator nodes receive ohlcvSeries and output the current bar value. For multi-timeframe filters, set Get OHLCV.timeframe to the target timeframe.

Node IDNameMain inputsMain outputsKey parametersUse cases
indicator.smaSMAseriesvalueperiod=20Simple moving average for trend direction and mean-reversion baseline.
indicator.emaEMAseriesvalueperiod=21Exponential moving average, faster than SMA.
indicator.kamaKAMAseriesvalue/previous/slope/trenderPeriod=10, fastPeriod=2, slowPeriod=30, slopeLookback=5Adaptive moving average for filtering noisy ranges.
indicator.rsiRSIseries or high/low/closevalueperiod=14Overbought/oversold, momentum divergence, pullback confirmation.
indicator.atrATRseries or high/low/closevalueperiod=14Volatility, stop distance, low-volatility filter.
indicator.atr_medianATR Medianhigh/low/closeatr/medianatrPeriod=14, medianPeriod=50Checks whether current volatility is above normal.
indicator.bbBollinger Bandsseriesupper/middle/lowerperiod=20Bollinger breakout, mean reversion, bandwidth filtering.
indicator.macdMACDseriesmacd/signal/histfastPeriod=12, slowPeriod=26, signalPeriod=9Trend momentum and zero-line filtering.
indicator.donchianDonchianseriesupper/middle/lowerperiod=20Range breakout and turtle-style strategies.
indicator.candle_streakCandle Streakopen/high/low/closebullStreak/bearStreak/bullMoveAtr/bearMoveAtr/bodyAtr/directionatrPeriod=14, minBodyPct=0.00005Consecutive bullish/bearish candles and body strength filter.
indicator.adxADXseries or high/low/closevalueperiod=14Trend strength filter, common thresholds: 20/25.
indicator.chopCHOPseries or high/low/closevalueperiod=14Identifies trending versus choppy markets; higher values mean more range-bound.
indicator.vwapVWAPseriesvalueperiod=20Volume-weighted average price for intraday deviation checks.
indicator.stochStochseriesk/dperiod=14, smoothK=3, smoothD=3Stochastic oscillator for range entries and exits.
indicator.stoch_rsiStochastic RSIseriesk/dperiod=14, smoothK=3, smoothD=3Stochastic applied to RSI; more sensitive signals.
indicator.highestHighest Nseriesvalueperiod=20Highest value over the last N candles for breakout thresholds.
indicator.lowestLowest Nseriesvalueperiod=20Lowest value over the last N candles for breakdown thresholds.
indicator.ichimokuIchimokuseriesconversion/base/spanA/spanB/laggingconversionPeriod=9, basePeriod=26, spanBPeriod=52, displacement=26Ichimoku cloud for multi-part trend structure.
indicator.supertrendSupertrendseriesvalue/trendperiod=10, multiplier=3.0Trend following and stop reference.
indicator.fibonacciFibonacci Retracementserieslevel0/236/382/500/618/786/100period=100Fibonacci retracement levels over the recent range.
indicator.cciCCIseriesvalueperiod=20Commodity Channel Index for trend and extreme readings.
indicator.williams_rWilliams %Rseriesvalueperiod=14Overbought/oversold oscillator.
indicator.parabolic_sarParabolic SARseriesvalue/trendafStart=0.02, afStep=0.02, afMax=0.2Trend reversal and trailing stop reference.
indicator.obvOBVseriesvalueNoneOn-Balance Volume for price/volume direction confirmation.
indicator.mfiMFIseriesvalueperiod=14Money Flow Index, a volume-aware overbought/oversold indicator.
indicator.volumeVolumeseriesNumbervalue/averageperiod=20Current volume versus average volume; helps filter false breakouts.
indicator.keltnerKeltner Channelsseriesupper/middle/loweremaPeriod=20, atrPeriod=10, multiplier=2.0ATR-based channel breakout and pullback.
indicator.rocROCseriesvalueperiod=12Rate of Change for price speed.
indicator.momentumMomentumseriesvalueperiod=10Momentum oscillator.
indicator.smoothed_momentumSmoothed Momentumseriesmomentum/value/bull/bearperiod=10, smooth=3Smoothed momentum with direct bullish/bearish boolean outputs.
indicator.wavetrendWaveTrendserieswt1/wt2/bull/bear/crossOver/crossUnderchannelLength=9, averageLength=12, maLength=3, overbought=60, oversold=-60Oscillator and crossover signals for pullback confirmation.
indicator.aroonAroonseriesup/down/oscillatorperiod=25Measures trend strength driven by new highs/lows.
indicator.cmfCMFseriesvalueperiod=20Chaikin Money Flow for inflow/outflow filtering.
indicator.pivot_pointsPivot Pointsseriespp/r1/r2/r3/s1/s2/s3period=20Support, resistance, breakout, and pullback targets.

7. Signal and Logic Nodes

Signal nodes usually output booleans. Logic nodes combine conditions or control event flow.

Node IDNameMain inputsMain outputsParametersPurpose and notes
logic.compareCompareleft/rightresultoperator options: > = true, avoiding repeated orders while a condition stays true.
logic.if_elseIf-ElseeventIn/conditiontrueOut/falseOutNoneSplits event flow by condition.
bool.expressionBool ExpressionDynamic variable inputsresultexpression, variableCount, variable aliasesReplaces multi-level Compare/AND/OR/NOT chains; supports and/or/not, `&&/
logic.bool_exprBool Expra/b/c/dresultexpressionLegacy boolean expression node with fixed variables a-d.
logic.ternarySelect / TernaryDynamic variable inputsresultexpression, variable aliasesTernary expression such as a ? b : c; useful for choosing colors, numbers, or text.
logic.select_valueSelect Valuecondition/trueValue/falseValueresultNoneSelects one of two values based on a boolean condition.
logic.gateGateeventIneventOutcooldownSec=10Event throttling. Important for high-frequency, Tick, and looped event flows.
logic.once_per_barOnce Per BareventIneventOutNoneAllows only one event per candle.

Expression node notes:

  • bool.expression, math.expression, and tool.number_expr support dynamic variable counts. variableCount ranges from 1 to 32.
  • Variables default to a/b/c...; use aliases such as close, emaFast, or atr to make expressions readable.
  • Boolean expressions are suitable for `close > ema and rsi order node riskInputs

## 9. Function Nodes and Order Nodes

Function nodes are Pine Script-style trading functions. They output `eventOut`, `triggered`, and `label`, which makes them suitable for chaining. Order nodes are terminal action nodes and are usually placed at the end of the trading chain.

### Function Nodes

| Node ID                 | Name                | Main inputs                             | Main outputs                 | Key parameters                                                                                                | Purpose and notes                                                                                                    |
| ----------------------- | ------------------- | --------------------------------------- | ---------------------------- | ------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `strategy.entry`      | strategy.entry      | `eventIn/when/symbol/riskInputs/plot` | `eventOut/triggered/label` | `enabled`, `entryId`, `direction`, `orderType`, `qtyMode`, `qty`, `limitOffsetPct`, `comment` | Generates long or short entry intent when `when` is true. `entryId` is a strategy tag, not an exchange order ID. |
| `strategy.cancel`     | strategy.cancel     | `eventIn/when/riskInputs/plot`        | `eventOut/triggered/label` | `enabled`, `orderId`, `comment`                                                                         | Cancels a specified exchange order. Live cancellation usually requires the real `orderId`.                         |
| `strategy.close`      | strategy.close      | `eventIn/when/symbol/riskInputs/plot` | `eventOut/triggered/label` | `enabled`, `entryId`, `orderType`, `qtyMode`, `qty`, `limitOffsetPct`, `comment`                | Closes the current symbol position by all, quantity, or percent.                                                     |
| `strategy.cancel_all` | strategy.cancel_all | `eventIn/when/riskInputs/plot`        | `eventOut/triggered/label` | `enabled`, `comment`                                                                                      | Generates cancel-all intent when the condition is true.                                                              |
| `strategy.close_all`  | strategy.close_all  | `eventIn/when/symbol/riskInputs/plot` | `eventOut/triggered/label` | `enabled`, `orderType`, `limitOffsetPct`, `comment`                                                   | Closes all positions for the current symbol when the condition is true.                                              |
| `strategy.exit`       | strategy.exit       | `eventIn/when/symbol/riskInputs/plot` | `eventOut/triggered/label` | `exitId`, `fromEntry`, `stop`, `limit`, `profit`, `loss`, `trailPoints`, `trailOffset`        | Pine-style exit rule with stop loss, take profit, and trailing stop settings.                                        |

### Order Nodes

| Node ID                  | Name                 | Main inputs                                                     | Output | Key parameters                                                                                    | Purpose and notes                                                                                                              |
| ------------------------ | -------------------- | --------------------------------------------------------------- | ------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| `strategy.entry_block` | Strategy Entry Block | `eventIn/longCondition/shortCondition/symbol/riskInputs/plot` | None   | `orderType`, `qtyMode`, `qty`, `preferLongWhenBoth`, `longLabel`, `shortLabel`        | Strategy-level entry block that accepts both long and short conditions. If both trigger, the preferred side can be configured. |
| `strategy.exit_block`  | Strategy Exit Block  | `eventIn/longCondition/shortCondition/symbol/riskInputs/plot` | None   | `orderType`, `qtyMode`, `qty`, `longLabel`, `shortLabel`                                | Strategy-level exit block that generates close intents directly from long/short exit conditions.                               |
| `order.place_market`   | Place Market Order   | `eventIn/sideInput/riskInputs/plot`                           | None   | `side=buy/sell/auto`, `qtyMode=fixed/percent/quantity`, `qty`                               | Generates market order intent.`qty` is currently interpreted as USDT amount; `percent` uses a percent of available funds.  |
| `order.place_limit`    | Place Limit Order    | `eventIn/sideInput/riskInputs/plot`                           | None   | `side`, `qtyMode`, `qty`, `priceOffsetPct`                                                | Generates limit order intent. BUY offsets downward, SELL offsets upward.                                                       |
| `order.cancel_order`   | Cancel Order         | `eventIn/riskInputs/plot`                                     | None   | `orderId`                                                                                       | Cancels a specified exchange order.                                                                                            |
| `order.close_position` | Close Position       | `eventIn/riskInputs/plot`                                     | None   | `qtyMode=all/quantity/percent`, `qty`, `orderType`, `priceOffsetPct`, `reduceOnly=true` | Closes the current position. Defaults to reduce-only.                                                                          |
| `order.set_tpsl`       | Set TP/SL            | `eventIn/riskInputs/plot`                                     | None   | `stopLossPct=1.0`, `takeProfitPct=2.0`                                                        | Sets take profit and stop loss intent for a position or order.                                                                 |

Order chain example:

OnBarClose(15m).out

-> Edge Trigger.eventIn

Compare.result

-> Edge Trigger.condition

Edge Trigger.eventOut

-> strategy.entry.eventIn

Symbol Selector.symbol

-> strategy.entry.symbol

risk.max_order_rate.intent

risk.max_position_size.intent

risk.stop_take_rule.intent

-> strategy.entry.riskInputs


## 10. State Nodes

State nodes remember variables and signals during runtime. Use `persistent_*` when the value must survive restarts.

| Node ID                  | Name              | Main inputs             | Main outputs                       | Parameters                        | Purpose and notes                                                                               |
| ------------------------ | ----------------- | ----------------------- | ---------------------------------- | --------------------------------- | ----------------------------------------------------------------------------------------------- |
| `state.var_set`        | Var Set           | `value`               | `value`                          | `key=signal`                    | Sets a strategy variable, usually scoped to the runtime instance.                               |
| `state.var_get`        | Var Get           | None                    | `value`                          | `key=signal`                    | Reads a strategy variable.                                                                      |
| `state.counter`        | Counter           | `eventIn`             | `value/eventOut`                 | `initialValue=0`, `step=1`    | Counts each event trigger. Useful for trigger statistics.                                       |
| `state.persistent_set` | Persistent KV Set | `eventIn/value`       | `value/eventOut`                 | `key=last_signal`               | Writes a cross-restart persistent variable.                                                     |
| `state.persistent_get` | Persistent KV Get | None                    | `value`                          | `key=last_signal`, `fallback` | Reads a persistent variable. Returns fallback when the key does not exist.                      |
| `state.rolling_window` | Rolling Window    | `eventIn/value`       | `values/latest/count/eventOut`   | `size=20`                       | Maintains a rolling window of the latest N numeric values.                                      |
| `state.last_signal`    | Last Signal       | `eventIn/signal`      | `signal/changed/eventOut`        | `key=signal`                    | Stores the previous signal and outputs whether it changed. Useful for avoiding repeated orders. |
| `state.overbought`     | Overbought State  | `value/threshold`     | `result`                         | `threshold=70`                  | Indicator value is greater than or equal to the threshold.                                      |
| `state.oversold`       | Oversold State    | `value/threshold`     | `result`                         | `threshold=30`                  | Indicator value is less than or equal to the threshold.                                         |
| `state.midline`        | Midline State     | `value/threshold`     | `result`                         | `threshold=50`                  | Indicator value is greater than or equal to the midline threshold.                              |
| `strategy.trend_state` | Trend State       | `changeUp/changeDown` | `state/stateCode/isLong/isShort` | `longCode=B`, `shortCode=S`   | Also a state node; maintains trend state from switch signals.                                   |

## 11. Tool Nodes

Tool nodes handle intermediate calculation and formatting. Prefer expression nodes for complex calculations and arithmetic nodes for simple operations.

| Node ID               | Name            | Main inputs             | Main outputs  | Parameters                                          | Purpose and notes                                                            |
| --------------------- | --------------- | ----------------------- | ------------- | --------------------------------------------------- | ---------------------------------------------------------------------------- |
| `math.expression`   | Math Expression | Dynamic variable inputs | `value`     | `expression`, `variableCount`, variable aliases | Numeric expression supporting `+ - * / %` and parentheses.                 |
| `tool.number_expr`  | Number Expr     | Dynamic variable inputs | `value`     | `expression`, `variableCount`, variable aliases | Legacy numeric expression node, useful for replacing Add/Sub/Mul/Div chains. |
| `tool.cast_number`  | Cast -> Number  | `value`               | `value`     | None                                                | Explicitly casts to number.                                                  |
| `tool.cast_integer` | Cast -> Int     | `value`               | `value`     | None                                                | Explicitly casts to integer.                                                 |
| `tool.cast_bool`    | Cast -> Bool    | `value`               | `value`     | None                                                | Explicitly casts to boolean.                                                 |
| `tool.clamp`        | Clamp           | `value`               | `value`     | `min=0`, `max=100`                              | Restricts a value to a range.                                                |
| `tool.normalize`    | Normalize       | `value`               | `value`     | `min=0`, `max=100`                              | Normalizes a value to 0-1.                                                   |
| `tool.add`          | Add             | `a/b`                 | `value`     | None                                                | Addition.                                                                    |
| `tool.sub`          | Sub             | `a/b`                 | `value`     | None                                                | Subtraction.                                                                 |
| `tool.mul`          | Mul             | `a/b`                 | `value`     | None                                                | Multiplication.                                                              |
| `tool.div`          | Div             | `a/b`                 | `value`     | None                                                | Division.                                                                    |
| `tool.map_symbol`   | Map Symbol      | `symbol`              | `symbol`    | `exchange=binance/okx/bybit`                      | Maps a symbol to the target exchange format.                                 |
| `tool.tag`          | JSON/Tag        | `value`               | `value/tag` | `tag`                                             | Adds a text tag or JSON fragment to data.                                    |
| `tool.round`        | Round/Precision | `value`               | `value`     | `precision=2`                                     | Handles numeric precision for prices, quantities, and chart display.         |

## 12. Chart Nodes

Chart nodes visualize the strategy. Some nodes receive `eventIn` to control whether the current bar is drawn; others are purely data-driven. Chart nodes usually do not participate in order decisions and are best used as side outputs.

### Common Chart Parameters

| Parameter       | Description                                                                                                         |
| --------------- | ------------------------------------------------------------------------------------------------------------------- |
| `pane`        | Display area:`main` main chart, `chart` chart layer, `volume` volume pane, `indicator:0/1` indicator panes. |
| `visible`     | Whether to display.                                                                                                 |
| `zIndex`      | Layer order, from -200 to 200. Higher values render above lower values.                                             |
| `layer`       | Render layer:`background`, `underlay`, `overlay`, `annotation`.                                             |
| `style`       | Plot style:`line`, `linebr`, `stepline`, `area`, `histogram`, `columns`, `circles`, `cross`.        |
| `strokeStyle` | Line style:`solid`, `dashed`, `dotted`.                                                                       |

### Chart Node Index

| Node ID                      | Name            | Main inputs                                             | Main outputs | Key parameters                                                                                         | Purpose and notes                                                                               |
| ---------------------------- | --------------- | ------------------------------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- |
| `chart.color`              | Color           | None                                                    | `color`    | `color=#FF38BDF8`                                                                                    | Outputs color text for reuse by multiple chart nodes.                                           |
| `chart.background`         | Background      | `eventIn/color/startValue/endValue/startTime/endTime` | None         | `color`, `rangeMode=bars/time`, `startBarsAgo/endBarsAgo`                                        | Draws a background region by candle range or time range.                                        |
| `chart.bar_color`          | Bar Color       | `eventIn`                                             | None         | `colorMode=single/trend/theme`, body/wick/border/up/down colors                                      | Changes candle colors, useful for visualizing trend state.                                      |
| `chart.plots`              | Plot            | `color/value`                                         | `plotRef`  | `style`, `color`, `lineWidth`, `histBase`, `offset`, `showLast`, `trackPrice`            | Draws indicator lines, columns, areas, and more. Outputs a Plot reference.                      |
| `strategy.plot_trend_line` | Plot Trend Line | `value/trend`                                         | `plotRef`  | `style`, `upColor`, `downColor`, `neutralColor`, `lineWidth`                                 | Indicator line that changes color by trend state.                                               |
| `chart.fill`               | Fill            | `color/plot1/plot2`                                   | None         | `color`, `showLast`, `fillGaps`                                                                  | Fills the area between two Plot/HLine references. Both references must be in the same pane.     |
| `chart.hline`              | HLine           | `price/color/startValue/endValue/startTime/endTime`   | `hlineRef` | `price`, `title`, `color`, `linestyle`, `linewidth`, `rangeMode`                           | Draws a horizontal line and can be used as a Fill reference.                                    |
| `chart.levels`             | Levels          | `value/color`                                         | None         | `value`, `color`, `lineWidth`, `strokeStyle`, `label`, range parameters                      | Draws price level lines for support, resistance, TP/SL references.                              |
| `chart.line`               | Line            | `startValue/endValue`                                 | None         | `lineColor`, `lineWidth`, `strokeStyle`, `leftBarsAgo/rightBarsAgo`                            | Draws a segment from a historical bar to current or future offset.                              |
| `chart.box`                | Box             | `top/bottom/text`                                     | None         | `fillColor`, `borderColor`, `textColor`, `borderWidth`, `leftBarsAgo/rightBarsAgo`           | Draws a price range box for consolidation zones or supply/demand zones.                         |
| `chart.tables`             | Tables          | `eventIn` and dynamic `value1...valueN`             | None         | `title`, `placement`, `itemCount=1-12`, `labelPosition`, `columnCount`, colors and alignment | Displays a chart dashboard.`itemCount` dynamically expands value inputs and label parameters. |
| `chart.text`               | Text            | `value`                                               | `text`     | `color`, `textFallback`, `size`, `barsAgo`                                                     | Outputs text. When a value is connected, it concatenates “text + value”.                      |
| `chart.shapes`             | Shapes          | `value/series/text`                                   | `shape`    | `shape`, `location=abovebar/belowbar/absolute`, colors, size, offset                               | Draws shape markers. If `series` is false, it usually does not draw.                          |
| `chart.plotchar`           | PlotChar        | `series/value/text/shape`                             | None         | `location`, `value`, `color`, `offset`, `yOffset`                                            | Draws text or shape markers by condition.`shape` supports multiple connections.               |
| `chart.entry_plot`         | Entry Plot      | None                                                    | `plotRef`  | `shape=arrow_right_sharp`, `size`, `textSize`                                                    | Outputs an entry chart template. Actual drawing happens when an order fills.                    |
| `chart.exit_plot`          | Exit Plot       | None                                                    | `plotRef`  | `shape=arrow_left_sharp`, `size`, `textSize`                                                     | Outputs an exit chart template. Actual drawing happens when an order fills.                     |

Common chart usage:

EMA.value -> chart.plots.value

RSI.value -> chart.tables.value1

Entry Plot.plotRef -> strategy.entry.plot

Exit Plot.plotRef -> strategy.close.plot


## 13. Common Strategy Templates

### 15m Execution, 1h Trend Filter

event.on_bar_close(timeframe=15m)

-> market.symbol_selector.eventIn

market.symbol_selector.symbol

-> market.get_ohlcv.symbol

market.get_ohlcv(timeframe=1h).close

-> indicator.ema(period=50)

market.get_ohlcv(timeframe=1h).close

-> indicator.ema(period=200)

EMA50.value > EMA200.value

-> logic.compare.result

logic.compare.result

-> strategy.entry.when

event.on_bar_close.out

-> logic.edge_trigger.eventIn

logic.compare.result

-> logic.edge_trigger.condition

logic.edge_trigger.eventOut

-> strategy.entry.eventIn


### Breakout Entry with ATR Risk

Get OHLCV.close -> indicator.donchian.series

Last Price.price -> signal.breakout.value

Donchian.upper -> signal.breakout.level

Get OHLCV -> indicator.atr

ATR.value -> strategy.atr_stop_block.atr

risk.max_order_rate.intent

risk.order_validation.intent

strategy.atr_stop_block.intent

-> strategy.entry.riskInputs


### Prevent Repeated Orders from the Same Signal

Compare.result -> state.last_signal.signal

OnBar.out -> state.last_signal.eventIn

state.last_signal.changed -> strategy.entry.when

state.last_signal.eventOut -> strategy.entry.eventIn


## 14. Troubleshooting

| Problem                        | Check first                                                                                                                                                     |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Blueprint cannot compile       | Whether there is an event source; whether port types match; whether data flow forms a loop; whether an input port has duplicate connections.                    |
| Strategy does not trigger      | Whether event timeframe is correct; whether `when` is true; whether `Edge Trigger` has already fired; whether date filter has expired.                      |
| Order node does not execute    | Whether `eventIn` is connected; whether `riskInputs` is connected; whether risk control rejected it; whether runtime mode allows trading.                   |
| High-frequency repeated orders | Add `logic.gate`, `logic.once_per_bar`, `state.last_signal`, and/or `risk.max_order_rate`.                                                              |
| 1h filter does not work        | Check whether `market.get_ohlcv.timeframe` is explicitly set to `1h`; do not accidentally use `runtime`.                                                  |
| Indicator is empty or abnormal | Whether `limit` covers the indicator period; whether input connects to the correct series; whether the backtest range has enough historical candles.          |
| Chart does not display         | Whether required chart inputs exist; whether `visible` is enabled; whether `pane/layer/zIndex` is reasonable; whether Fill references are in the same pane. |
| Type mismatch                  | Insert `tool.cast_number`, `tool.cast_integer`, or `tool.cast_bool`.                                                                                      |

## 15. Full Node ID Index

Use this index to quickly check `schemaId` in blueprint files.

| Category   | Node IDs                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Events     | `event.on_start`, `event.on_stop`, `event.on_bar`, `event.on_bar_open`, `event.on_bar_close`, `event.on_tick`, `event.on_timer`, `event.on_order_update`, `event.on_trade_transaction`, `event.on_position_update`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Market     | `market.symbol_selector`, `market.get_ohlcv`, `market.last_price`, `market.bid_ask`, `market.mark_price`, `market.account_snapshot`, `market.position_state`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| Indicators | `indicator.sma`, `indicator.ema`, `indicator.kama`, `indicator.rsi`, `indicator.atr`, `indicator.atr_median`, `indicator.bb`, `indicator.macd`, `indicator.donchian`, `indicator.candle_streak`, `indicator.adx`, `indicator.chop`, `indicator.vwap`, `indicator.stoch`, `indicator.stoch_rsi`, `indicator.highest`, `indicator.lowest`, `indicator.ichimoku`, `indicator.supertrend`, `indicator.fibonacci`, `indicator.cci`, `indicator.williams_r`, `indicator.parabolic_sar`, `indicator.obv`, `indicator.mfi`, `indicator.volume`, `indicator.keltner`, `indicator.roc`, `indicator.momentum`, `indicator.smoothed_momentum`, `indicator.wavetrend`, `indicator.aroon`, `indicator.cmf`, `indicator.pivot_points` |
| Signals    | `logic.cross_over`, `logic.cross_under`, `signal.enter_range`, `signal.leave_range`, `signal.breakout`, `signal.breakdown`, `strategy.date_range_filter`, `strategy.cross_signal`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Logic      | `logic.compare`, `logic.boolean_and`, `logic.boolean_or`, `logic.boolean_not`, `logic.edge_trigger`, `logic.if_else`, `bool.expression`, `logic.bool_expr`, `logic.ternary`, `logic.select_value`, `logic.gate`, `logic.once_per_bar`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Risk       | `risk.max_order_rate`, `risk.kill_switch`, `risk.order_validation`, `risk.max_position_size`, `risk.cooldown_after_loss`, `risk.daily_consecutive_loss_cooldown`, `risk.stop_take_rule`, `strategy.atr_stop_block`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Functions  | `strategy.entry`, `strategy.cancel`, `strategy.close`, `strategy.cancel_all`, `strategy.close_all`, `strategy.exit`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Orders     | `strategy.entry_block`, `strategy.exit_block`, `order.place_market`, `order.place_limit`, `order.cancel_order`, `order.close_position`, `order.set_tpsl`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| State      | `strategy.trend_state`, `state.var_set`, `state.var_get`, `state.counter`, `state.persistent_set`, `state.persistent_get`, `state.rolling_window`, `state.last_signal`, `state.overbought`, `state.oversold`, `state.midline`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| Tools      | `math.expression`, `tool.number_expr`, `tool.cast_number`, `tool.cast_integer`, `tool.cast_bool`, `tool.clamp`, `tool.normalize`, `tool.add`, `tool.sub`, `tool.mul`, `tool.div`, `tool.map_symbol`, `tool.tag`, `tool.round`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| Chart      | `chart.color`, `chart.background`, `chart.bar_color`, `chart.plots`, `strategy.plot_trend_line`, `chart.fill`, `chart.hline`, `chart.levels`, `chart.line`, `chart.box`, `chart.tables`, `chart.text`, `chart.shapes`, `chart.plotchar`, `chart.entry_plot`, `chart.exit_plot                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

Blueprint

BeginnerWorkbenchMarkets
Blueprint Node Reference | NavaX