Indicator Blocks Reference ========================== Indicators are mathematical calculations applied to price or volume data. Drag them from the **Indicators** panel onto the canvas and connect them to comparison or signal blocks. Every indicator has an **Offset** field — a positive integer that shifts the value back in time. ``Offset = 0`` means *today*, ``Offset = 1`` means *yesterday*, and so on. This is useful for comparing the current value to a previous one. .. tip:: Parameters marked with ⚙ can be added to the **Optimizer** for automatic tuning. Enter comma-separated values (e.g. ``14, 21, 28``) to test multiple settings at once. ---- Trend / Overlap --------------- .. _sma: SMA — Simple Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Calculates the arithmetic mean of the closing price over the last *N* candles. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``50`` - Number of candles in the lookback window. * - **Offset** - ``0`` - Shift value back N bars. 0 = current bar. **Formula:** ``SMA = (C₁ + C₂ + … + Cₙ) / n`` **Common uses:** Identify trend direction; cross-overs between short and long SMA generate buy/sell signals. A rising 50-day SMA means price is in an uptrend on average. ---- .. _ema: EMA — Exponential Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Like SMA but weights recent prices more heavily, so it reacts faster to price changes. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``50`` - Lookback window. Shorter = more responsive, more noise. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``EMA = Price × k + EMA_prev × (1 − k)`` where ``k = 2 / (period + 1)`` **Common uses:** Trend-following systems; often faster to signal reversals than SMA. ---- .. _wma: WMA — Weighted Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Assigns linearly increasing weights to each bar, so the most recent bar has the highest weight. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``30`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``WMA = (n×Cₙ + (n-1)×Cₙ₋₁ + … + 1×C₁) / (n×(n+1)/2)`` **Common uses:** Smoother response than SMA with less lag than EMA. ---- .. _dema: DEMA — Double Exponential Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Applies EMA twice then subtracts the second from the first to reduce lag. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``30`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``DEMA = 2 × EMA(n) − EMA(EMA(n))`` **Common uses:** Fast trend identification with reduced false signals compared to a single EMA. ---- .. _tema: TEMA — Triple Exponential Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Further reduces lag by computing EMA three times. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``30`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``TEMA = 3×EMA − 3×EMA(EMA) + EMA(EMA(EMA))`` **Common uses:** Very responsive moving average; best for volatile, fast-moving markets. ---- .. _vwma: VWMA — Volume-Weighted Moving Average ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Weights each price by its trading volume — high-volume bars count more. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``20`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``VWMA = Σ(Closeᵢ × Volumeᵢ) / Σ(Volumeᵢ)`` **Common uses:** More accurate representation of the "true" average price. If price > VWMA, buyers are in control; if price < VWMA, sellers are. ---- .. _sar: SAR — Parabolic SAR ~~~~~~~~~~~~~~~~~~~~~ Plots dots above (bearish) or below (bullish) the price. When the dots flip sides, a trend reversal is signalled. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Acceleration** ⚙ - ``0.02`` - Step factor; increases each bar a new extreme is made. * - **Maximum** ⚙ - ``0.2`` - Upper limit for the acceleration factor. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Trailing stop-loss placement; exit long when Close crosses below SAR. ---- .. _oscillators: Oscillators ----------- .. _rsi: RSI — Relative Strength Index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Measures the speed and magnitude of recent price changes on a scale of 0–100. Values above ``70`` indicate overbought; below ``30`` indicate oversold. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Number of bars for the average gain/loss calculation. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``RSI = 100 − 100 / (1 + RS)`` where ``RS = Avg Gain / Avg Loss`` **Interpretation:** .. list-table:: :header-rows: 1 :widths: 25 75 * - RSI value - Meaning * - < 30 - Oversold — potential bounce / buy setup. * - 30 – 70 - Neutral range. * - > 70 - Overbought — potential pullback / sell setup. * - Divergence - Price makes new high but RSI doesn't → weakening momentum. ---- .. _stoch: Stochastic Oscillator ~~~~~~~~~~~~~~~~~~~~~~ Compares the current close to the high-low range over a lookback window, producing two smoothed lines: **%K** (fast) and **%D** (slow). .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Fast-K Period** ⚙ - ``14`` - Bars used for the raw %K calculation. * - **Slow-K Period** ⚙ - ``3`` - Smoothing applied to %K. * - **Slow-D Period** ⚙ - ``3`` - Smoothing applied to Slow-K to produce %D. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``%K = (Close − Lowest Low) / (Highest High − Lowest Low) × 100`` **Common uses:** Buy when %K crosses above %D below 20; sell when %K crosses below %D above 80. ---- .. _stochrsi: StochRSI — Stochastic RSI ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Applies the Stochastic formula to RSI values instead of price, making it more sensitive than either indicator alone. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **RSI Period** ⚙ - ``14`` - Period for the underlying RSI. * - **FastK Period** ⚙ - ``5`` - Smoothing for %K. * - **FastD Period** ⚙ - ``3`` - Smoothing for %D. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Detecting short-term overbought/oversold extremes within an existing trend. ---- .. _crsi: CRSI — Connors RSI ~~~~~~~~~~~~~~~~~~~~ A composite oscillator combining three components: a short RSI, a "streak" RSI (consecutive up/down days), and a percentile rank of recent returns. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **RSI Length** ⚙ - ``3`` - Period for the base RSI component. * - **Streak Length** ⚙ - ``2`` - Period for the streak RSI (up/down day run). * - **Percentile Rank Length** ⚙ - ``52`` - Lookback for the percentile rank of 1-day returns. * - **Timeframe** ⚙ - ``252`` - Trading days used in the percentile calculation. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Mean-reversion entries — buy below 10, sell above 90. ---- .. _cci: CCI — Commodity Channel Index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Measures deviation of price from its statistical mean. Positive values mean price is above average; negative means below. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``CCI = (Typical Price − SMA) / (0.015 × Mean Deviation)`` **Common uses:** Values above +100 signal overbought; below −100 signal oversold. ---- .. _cmo: CMO — Chande Momentum Oscillator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Similar to RSI but uses the sum of both up and down days in the denominator. Oscillates between −100 and +100. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Overbought above +50; oversold below −50. ---- .. _ultosc: Ultimate Oscillator ~~~~~~~~~~~~~~~~~~~~ Combines three different timeframes into one oscillator to reduce false signals. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period 1** ⚙ - ``7`` - Short-term window. * - **Period 2** ⚙ - ``14`` - Medium-term window. * - **Period 3** ⚙ - ``28`` - Long-term window. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Buy divergence: price makes lower low, oscillator makes higher low. Overbought above 70, oversold below 30. ---- .. _willr: Williams %R ~~~~~~~~~~~~ Measures momentum. Like the Stochastic but inverted — ranges from −100 to 0. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``%R = (Highest High − Close) / (Highest High − Lowest Low) × −100`` **Common uses:** Oversold below −80; overbought above −20. ---- Momentum -------- .. _macd: MACD — Moving Average Convergence Divergence ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tracks the relationship between two EMAs. Produces three outputs: - **MACD line** — Fast EMA minus Slow EMA. - **Signal line** — EMA of the MACD line. - **Histogram** — MACD line minus Signal line. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Fast Period** ⚙ - ``12`` - Bars for the fast EMA. * - **Slow Period** ⚙ - ``26`` - Bars for the slow EMA. * - **Signal Period** ⚙ - ``9`` - Bars for smoothing the MACD line. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Buy when MACD crosses above the Signal line; sell when it crosses below. A positive histogram means bullish momentum is accelerating. ---- .. _ppo: PPO — Percentage Price Oscillator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Like MACD but expressed as a percentage difference — useful for comparing assets with different price levels. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Fast Period** ⚙ - ``12`` - Fast EMA period. * - **Slow Period** ⚙ - ``26`` - Slow EMA period. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``PPO = (Fast EMA − Slow EMA) / Slow EMA × 100`` ---- .. _trix: TRIX ~~~~~ 1-day Rate-of-Change of a triple-smoothed EMA. Crosses above zero are bullish. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``30`` - Lookback window for each EMA layer. * - **Offset** - ``0`` - Shift back N bars. ---- .. _momentum: Momentum ~~~~~~~~~ Ranks stocks in the universe by their historical Rate-of-Change over *N* bars. Returns the **top-ranked** symbols — use it as the input to a rebalance block. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``189`` - Bars (trading days) used to measure momentum (ROC). .. note:: This block returns a **list of symbols** ranked highest to lowest by momentum. Connect it to the *Selected* input of a **Rebalance: Enter** block. ---- Directional Movement -------------------- .. _adx: .. _adxr: ADXR — Average Directional Index Rating ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Measures trend *strength* (not direction). High values mean a strong trend (up or down); low values mean ranging, sideways market. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Interpretation:** .. list-table:: :header-rows: 1 :widths: 25 75 * - Value - Meaning * - < 20 - No trend / choppy market. Avoid trend-following strategies. * - 20 – 40 - Developing trend. * - > 40 - Strong trend in place. ---- .. _dx: DX — Directional Index ~~~~~~~~~~~~~~~~~~~~~~~ The raw precursor to ADX. Measures the difference between +DI and −DI lines. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. ---- .. _volatility: Volatility ---------- .. _bbands: BBands — Bollinger Bands ~~~~~~~~~~~~~~~~~~~~~~~~~ Plots a middle band (SMA) with upper and lower bands at a set number of standard deviations. The bands *squeeze* during low volatility and *expand* during high volatility. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``20`` - Lookback for the middle SMA and standard deviation. * - **Upper Dev** ⚙ - ``2`` - Standard deviations above the middle band. * - **Lower Dev** ⚙ - ``2`` - Standard deviations below the middle band. * - **MA Type** - SMA - Moving average type for the middle band. * - **Offset** - ``0`` - Shift back N bars. **Outputs:** ``Upper Band``, ``Middle Band``, ``Lower Band`` **Common uses:** Mean-reversion — buy at lower band, sell at upper band. Breakout — buy when price closes above upper band after a squeeze. ---- .. _atr: ATR — Average True Range ~~~~~~~~~~~~~~~~~~~~~~~~~ Measures market volatility as the average of the "true range" — the largest of: High − Low, abs(High − Prev Close), abs(Low − Prev Close). Does **not** indicate direction — only magnitude of movement. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Bars to average the true range over. * - **Offset** - ``0`` - Shift back N bars. **True Range** = max of: High − Low, abs(High − Prev Close), abs(Low − Prev Close). **Common uses:** Position sizing (risk a fixed multiple of ATR per trade); stop-loss placement at Close − 2 × ATR. ---- .. _natr: NATR — Normalized ATR ~~~~~~~~~~~~~~~~~~~~~~ ATR expressed as a percentage of the close price — makes it comparable across different-priced assets. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``NATR = ATR / Close × 100`` ---- .. _stddev: StdDev — Standard Deviation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Measures price dispersion around the mean. Higher values = more volatile. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``5`` - Lookback window. * - **NbDev** - ``1`` - Multiplier (usually left at 1). * - **Offset** - ``0`` - Shift back N bars. ---- Volume ------ .. _obv: OBV — On Balance Volume ~~~~~~~~~~~~~~~~~~~~~~~~ Cumulative sum of volume — adds volume on up days, subtracts on down days. The direction of OBV predicts price moves. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Bullish if OBV is rising while price is flat — accumulation. Bearish if OBV is falling while price is flat — distribution. ---- .. _mfi: MFI — Money Flow Index ~~~~~~~~~~~~~~~~~~~~~~~~ A volume-weighted RSI. Ranges 0–100. Values above 80 = overbought; below 20 = oversold. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Formula:** Uses Typical Price × Volume to compute positive/negative money flow, then scales as RSI. ---- .. _cmf: CMF — Chaikin Money Flow ~~~~~~~~~~~~~~~~~~~~~~~~~ Measures money flow as the sum of the Accumulation/Distribution ratio, normalised by volume. Ranges from −1 to +1. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``20`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Common uses:** Above 0 = buying pressure; below 0 = selling pressure. ---- .. _bop: BOP — Balance of Power ~~~~~~~~~~~~~~~~~~~~~~~ Measures the strength of buyers vs. sellers by comparing the close relative to the open within the full daily range. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Offset** - ``0`` - Shift back N bars. **Formula:** ``BOP = (Close − Open) / (High − Low)`` **Range:** −1 (sellers dominated) to +1 (buyers dominated). ---- .. _adosc: ADOSC — Accumulation/Distribution Oscillator ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The difference between a fast and slow EMA of the Accumulation/Distribution line. Positive = accumulation; Negative = distribution. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Fast Period** ⚙ - ``3`` - Period for the fast A/D EMA. * - **Slow Period** ⚙ - ``10`` - Period for the slow A/D EMA. * - **Offset** - ``0`` - Shift back N bars. ---- Cycle ----- .. _aroon: Aroon ~~~~~~ Measures how recently price made its highest high and lowest low within the lookback window. Produces two lines: **AroonUp** and **AroonDown** (0–100 each). .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. **Interpretation:** AroonUp near 100 = price hit a recent high → uptrend. AroonDown near 100 = price hit a recent low → downtrend. ---- .. _aroonosc: Aroon Oscillator ~~~~~~~~~~~~~~~~~ AroonUp minus AroonDown. Ranges from −100 to +100. Positive = uptrend; Negative = downtrend; Near zero = no trend. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Period** ⚙ - ``14`` - Lookback window. * - **Offset** - ``0`` - Shift back N bars. ---- .. _htsine: HT Sine — Hilbert Transform SineWave ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Uses the Hilbert Transform to detect market cycles. Outputs a **Sine** line and a **Lead Sine** line. When the Sine crosses the Lead Sine, a cycle turning point is signalled. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Offset** - ``0`` - Shift back N bars. .. warning:: This is an advanced indicator. Works best in range-bound (non-trending) markets. ---- Index ----- .. _index_value: Index Value ~~~~~~~~~~~~ Returns the price of the benchmark index (NASDAQ or SPY) at the current date. Use it to make decisions based on the broad market — for example, only buy stocks when the index is above its 200-day SMA. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Offset** - ``0`` - Shift back N bars (0 = today, 1 = yesterday). .. note:: The index source is set in the **Config** block (NASDAQ or SPY). ---- .. _index_weekly_close: Index Weekly Close ~~~~~~~~~~~~~~~~~~~ Returns the most recent weekly closing price of the benchmark index. Useful for strategies that only act on weekly data. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Offset** - ``0`` - Shift back N weeks. ---- .. _index_weekly_quantile: Index Weekly Quantile ~~~~~~~~~~~~~~~~~~~~~~ Returns the *q*-th percentile of the benchmark's weekly closes over the full history. Use this to set dynamic thresholds — e.g. "only buy if the index is above its median weekly close". .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Quantile** - ``50`` - Percentile level (0 = min, 100 = max, 50 = median). * - **Offset** - ``0`` - Shift back N bars. ---- Threshold Value --------------- .. _threshold: Threshold Value ~~~~~~~~~~~~~~~~ A plain number block used as the right-hand side of comparisons. Drop it into the **B** slot of a comparison block to set a fixed level. .. list-table:: :header-rows: 1 :widths: 25 15 60 * - Parameter - Default - Description * - **Value** ⚙ - ``0`` - Numeric constant. Supports comma-separated values for the Optimizer. **Example:** Connect RSI → *Greater Than* → Threshold (``30``) to create "RSI > 30".