Hey-LiSA is in development phase and pre-alpha. These docs are still in progress and not complete yet.

Indicators and external series

Indicators, state variable lines, and external series connect LiSA Script to derived values, strategy state, and outside data. Technical indicators are price-derived calculations used for strategy logic or charting. State variable lines plot strategy-owned variables over time. External series expose named local data streams that a strategy can read.

This page lists the indicator and external series features currently implemented.

Technical indicators

Technical indicators live in the top-level indicators array. A strategy that reads an indicator function must declare the matching indicator.

Price-derived technical indicators are available to current DCA and Trading strategies. Trading strategies declare daily or 4h. A moving average without an explicit interval uses that strategy timeframe; Trading strategies can also declare a weekly MA. External series and strategy state outputs remain DCA-only.

IndicatorDeclaration fieldsExpression reads
maperiod, mode of "simple", optional interval of "4h", "1d", or "1w", optional positive multiplier, optional name, optional color.ma(period[, offset]), ma(period, "4h"[, offset]), ma(period, "1w"[, offset]), ma(period, interval, "simple"[, offset])
highest_closeperiod, optional name, optional color.highest_close(period[, offset])
athOptional name, optional color.ath([offset])
pi_cycle_topOptional name, optional color.pi_cycle_ratio([offset]), pi_cycle_top_signal([offset])
rsiperiod, optional name, optional color.rsi(period[, offset])
atrperiod, optional name, optional color.atr(period[, offset])
supertrendperiod, positive factor, optional name.supertrend(period, factor[, offset]), supertrend_bullish(period, factor[, offset]), supertrend_bearish(period, factor[, offset])
donchianperiod, optional name, optional color.donchian(period, "lower" / "upper"[, offset])
bollinger_bandsperiod, stddev, optional name, optional color.bollinger_bands(period, stddev, "upper" / "middle" / "lower"[, offset])
macdfast_period, slow_period, signal_period, optional name, optional color.macd(fast_period, slow_period, signal_period, "line" / "signal" / "histogram"[, offset])
stochastick_period, smooth_period, d_period, optional name, optional color.stochastic(k_period, smooth_period, d_period, "k" / "d"[, offset])
adxperiod, optional name, optional color.adx(period[, offset]), plus_di(period[, offset]), minus_di(period[, offset])
parabolic_saracceleration, maximum, optional name, optional color.parabolic_sar(acceleration, maximum[, offset])
cciperiod, optional name, optional color.cci(period[, offset])
williams_rperiod, optional name, optional color.williams_r(period[, offset])
ichimokutenkan_period, kijun_period, senkou_span_b_period, optional name, optional color.ichimoku(tenkan_period, kijun_period, senkou_span_b_period, "tenkan" / "kijun" / "senkou_a" / "senkou_b" / "chikou"[, offset])

Examples:

{ "type": "ma", "mode": "simple", "period": 200, "interval": "1w", "name": "200W MA" }
{ "type": "ma", "mode": "simple", "period": 200, "interval": "4h", "name": "4h MA200" }
{ "type": "ma", "mode": "simple", "period": 200, "interval": "1w", "multiplier": 1.1, "name": "200W MA +10%" }
{ "type": "ma", "mode": "simple", "period": 730, "name": "2Y MA" }
{ "type": "ma", "mode": "simple", "period": 730, "multiplier": 5, "name": "2Y MA x5" }
{ "type": "highest_close", "period": 90, "name": "90D closing high" }
{ "type": "ath", "name": "BTC closing ATH" }
{ "type": "pi_cycle_top" }
{ "type": "rsi", "period": 14, "name": "RSI 14" }
{ "type": "atr", "period": 14, "name": "ATR 14" }
{ "type": "supertrend", "period": 10, "factor": 3, "name": "Supertrend 10 / 3" }
{ "type": "donchian", "period": 20, "name": "Donchian 20" }
{ "type": "macd", "fast_period": 12, "slow_period": 26, "signal_period": 9, "name": "MACD 12/26/9" }
{ "type": "bollinger_bands", "period": 20, "stddev": 2, "name": "Bollinger Bands 20" }
{ "type": "stochastic", "k_period": 14, "smooth_period": 3, "d_period": 3, "name": "Stochastic 14/3/3" }
{ "type": "adx", "period": 14, "name": "ADX 14" }
{ "type": "parabolic_sar", "acceleration": 0.02, "maximum": 0.2, "name": "Parabolic SAR" }
{ "type": "cci", "period": 20, "name": "CCI 20" }
{ "type": "williams_r", "period": 14, "name": "Williams %R 14" }
{ "type": "ichimoku", "tenkan_period": 9, "kijun_period": 26, "senkou_span_b_period": 52, "name": "Ichimoku 9/26/52" }

Duplicate declarations with the same indicator type and parameters are rejected.

Calculation parameters are explicit in executable expressions. For example, ATR uses atr(14), not atr(). Fourteen is the conventional ATR period, but any positive integer period is accepted.

Every indicator function has one registry-defined optional historical offset. Without an offset it reads the current completed signal candle. A trailing positive integer reads that many genuine strategy candles back. Zero, negative, and future offsets are rejected. Source omissions represented by nontradable 4h timeline slots do not count as genuine candles.

Moving averages require a complete window on the first selected candle. Prior local BTC history before the selected period supplies that window. For 4h Trading, Kraken intervals omitted because no trades occurred use internal previous-close, zero-activity values to preserve the regular clock; those values are nontradable. If the full 4h, daily, or weekly window is unavailable, the strategy-period is marked unavailable instead of warming up inside the period.

ath() is the highest BTC close from the earliest available local candle through the current candle. ath(offset) reads the corresponding historical value. It includes candles before the selected period and never reads future candles.

Supertrend uses hl2, Wilder ATR, recursive upper and lower bands, and explicit bullish or bearish states. Before its complete ATR window is available, its state is bearish and it has no plotted line. The backend colors its visible price overlay green while bullish and red while bearish.

Donchian channels use the highest high and lowest low from a complete window of genuine strategy candles. A structure stop can use offset 1 to read the completed channel before the signal candle without lookahead.

Price overlays include moving averages, available-history ATH, rolling highs, Supertrend, Donchian channels, Bollinger Bands, Parabolic SAR, Ichimoku, and Pi Cycle Top lines. Indicator panes include ATR, RSI, MACD, Stochastic, ADX, CCI, Williams %R, and bounded external series displays. Indicator calculations use local BTC candles and are not external series.

State variable lines

State variable lines are visual outputs, not technical indicators. They plot a strategy-owned variable that was updated by set actions.

{ "type": "state", "variable": "avg_entry", "name": "Average entry" }

Duplicate state lines for the same variable are rejected.

External series

External series are local non-price data streams. They must be declared before series(id) can read them.

{
  "external_series": [
    {
      "id": "fear_greed",
      "source": "alternative_me",
      "label": "Crypto Fear & Greed Index"
    }
  ]
}

id must be a lowercase series ID and unique within external_series. source must be a non-empty string. label must be readable and not slug-like.

series(id) reads the current completed candle. series(id, offset) reads a positive number of genuine strategy candles back. If a declared series does not cover the selected backtest period and required history, that strategy-period is marked unavailable instead of being partially tested.