# Node reference

> Every node type in the node library, grouped by category, with its inputs and outputs.

Source: https://quantraider.com/docs/graph-nodes

These are the built-in nodes in the **Node library**, grouped by the categories the library shows. Sockets carry a number, a boolean (true or false) or a list of numbers (`number[]`).

Click a node in the library, drag it onto the canvas, or right-click the canvas to add it. See [Build logic with the graph editor](/docs/graph-editor).

## Data

| Node | Outputs |
|---|---|
| Data | Open, Close, High, Low, Time, Volume, Spread at high, Spread at low (all numbers) |

The Data node gives you the candle the graph is looking at. Most graphs start here.

| Node | Outputs | Settings |
|---|---|---|
| Source | Value | Value, timezone |

**Source** gives one value of the current candle without wiring: open, high, low, close, volume, hl2 (high + low) / 2, hlc3 (high + low + close) / 3, ohlc4, hlcc4, the time in milliseconds, or a part of the time (hour, minute, weekday with 1 = Monday, day of month, month, year) in the timezone you choose. Markets without volume read 0.

## Indicator

| Node | Inputs | Outputs | Settings |
|---|---|---|---|
| SMA | Data | SMA | Period |
| EMA | Data | EMA | Period |
| ATR | High, Low, Close | ATR | Period (14 by default) |
| RSI | Close | RSI | Period (14 by default) |
| MACD | Data | Histogram, MACD, Signal | Fast period, Slow period, Signal period |
| PricePoint | Price, Timestamp | none | Name |
| NumberIndicator | Value | none | Name |
| SelectionIndicator | One boolean input per option | none | Name, default option |

| MovingAverage | Value | Average | Type (SMA, EMA, RMA, WMA), Length |

SMA is a simple moving average and EMA an exponential moving average. ATR is the average true range.

**MovingAverage** offers four averages: SMA, EMA, RMA (Wilder's smoothing, also called SMMA) and WMA (linearly weighted). Its EMA and RMA start from the simple average of the first Length values, as on TradingView, so they match TradingView values once enough candles have passed. The older EMA node starts from the first value instead and reaches the same values after its warm-up.

PricePoint, NumberIndicator and SelectionIndicator record a value under a name you choose. Use them for values you want stored with a trade.

## Math

| Node | Inputs | Outputs |
|---|---|---|
| Add, Subtract, Multiply, Divide | A, B | Result |
| GetNthValue | Values, Position | Result (setting: n) |
| Min, Max | Values | The minimum or maximum, and its Position |
| Sum, Average | Values | The sum or the average |
| Math | A, B | Result (setting: function) |

**Math** applies a function: abs, -A, sign, sqrt, exp, ln, log10, round, floor, ceil, A ^ B, min, max or A mod B. Functions of A alone ignore B. A result that is not defined, such as the square root of a negative number or the logarithm of 0, is 0. Divide also returns 0 when B is 0.

## Conditional

| Node | Inputs | Outputs | Notes |
|---|---|---|---|
| GreaterThan, LessThan, EqualTo | A, B | Result (boolean) | Compares two numbers. |
| If | Condition, If true, If false | Value | Picks one of two numbers. |
| Time | Time | Active (boolean) | A trading schedule. See below. |
| Compare | A, B | Result (boolean) | A > B, A >= B, A < B, A <= B, A = B or A != B. Equality can allow a tolerance. |
| Cross | A, B | Crossed (boolean) | True on the candle where A crosses above B, below B, or either. |
| NewPeriod | Time | New period (boolean) | True on the first candle of each day, week, month or year. See below. |

**Cross** works like TradingView's crossover: A crosses above B when A is above B now and was at or below B one candle earlier. It is never true on the first candle.

### The NewPeriod node

Connect the Data node's **Time** output to it. The output is true on the first candle of each new period, and on the very first candle.

- **Period**: day, week (starting Monday), month or year.
- **Timezone** and **Session start**: when a new period begins. The forex trading day, for example, starts at 17:00 in America/New_York.
- **Warm-up candles**: how much history values that restart each period need before signals are trusted, for example one day of candles for a daily VWAP.

Use it as the **Reset** of a Cumulative node or the **Condition** of a ValueWhen node to build session values such as VWAP or the previous day's high.

### The Time node

Connect the Data node's **Time** output to it. The output **Active** is true while the schedule applies.

- **Schedule**: **At or after** or **Time range**.
- **Start (inclusive)** and, for a time range, **End (exclusive)**.
- **Session start days**: the weekdays the session starts on. Overnight ranges belong to the day they start. With no days selected the output is always false.
- **Timezone**: UTC by default.

## Logic

| Node | Inputs | Outputs |
|---|---|---|
| And, Or | A, B | Result |
| Not | A | Result |

## Persistent

| Node | Inputs | Outputs | Notes |
|---|---|---|---|
| PreviousValue | Value | Previous | Remembers the value it received before the current one. |
| SlidingWindow | Value | Values (list) | Collects recent values into a list. Setting: Period. |
| History | Value | Result | The value N candles ago, the change since then, or the change in percent. Settings: Result, N candles. |
| Direction | Value | Result (boolean) | Rising: above each of the previous N values. Falling: below each of them. |
| Rolling | Value, Second | Result | A statistic over the last Length values. See below. |
| Cumulative | Value, Reset | Result | Running sum, maximum or minimum, restarted when Reset is true. |
| BarsSince | Condition | Bars, Seen | Candles since the condition was last true (0 on that candle). |
| ValueWhen | Condition, Value | Value, Seen | The value on the candle where the condition was true. Occurrence 0 is the most recent. |
| Feedback | Value | Previous | The value it received on the previous candle. The only node that may close a loop. |

**Rolling** statistics: sum, standard deviation and variance (of the whole window, as TradingView's stdev), median, highest, lowest, candles since the highest or lowest (a tie counts from the most recent candle), percent rank (the share of the previous Length values that are at or below the current one), linear regression value and slope, mean absolute deviation, and the correlation of Value with Second.

**Seen** on BarsSince and ValueWhen is false until the condition has been true once. Until then Bars counts the candles evaluated so far and Value is 0.

**Feedback** is for values that depend on their own previous value, like a trailing stop, Supertrend or Parabolic SAR. Wire a later result back into its input: its output is that result from one candle earlier, or **First candle value** on the first candle. Everywhere else a loop is not allowed. **Warm-up candles** adds history so the value can settle before signals are used.

### How values behave at the start of the history

Every node gives a number on every candle. While fewer candles than a window needs exist, Rolling, MovingAverage and History use the candles that are available. Before a trade can be signalled the graph is warmed up with as many earlier candles as its longest window needs, the same way in backtests, previews and live trading. Cumulative, BarsSince, ValueWhen and Feedback carry their value from the first evaluated candle, so their level can depend on where the history starts unless they restart with a condition.

## Constant

| Node | Output |
|---|---|
| Number | A number you type in. |
| Boolean | True or false. |

## Visualize

These nodes draw on the chart. They do not change the trades.

| Node | Input | Settings |
|---|---|---|
| VisualizeLine | Data | Colour, thickness |
| VisualizeHistogram | Data | Colour, thickness |
| VisualizeArrow | Signal (boolean) | Colour, position (above or below the bar) |

## Execution

| Node | Inputs | Settings |
|---|---|---|
| TradeEntry | Trigger, Entry Price, and one price pin for each stop loss and take profit | Direction, Entry price type, named stop losses and take profits |

TradeEntry opens a trade when **Trigger** is true.

- **Direction** is **Buy** or **Sell**.
- **Entry price type** is **Price** or **Market**.
- Use **Add** to add more stop loss or take profit pins and give each a name. Each named pin takes an exit price. Connected pins are recorded when Trigger is true.

TradeEntry is available in trading graphs only, not in indicator graphs.

## Custom

A **Custom** node is a group of nodes packed into one. Right-click a node and choose **Group into custom node** to create one, or add a reusable graph from **My graphs** or **Published** in the library.

The **Published** tab also lists the **QuantRaider built-in** indicators, such as RSI, MACD and Bollinger Bands, all built from the nodes on this page. See [Built-in indicators](/docs/built-in-indicators).
