SutraLipi docs grammar v1

Indicators

An indicator call is a statement that fills an output array: INDICATOR_NAME(outputArray, symbol, timeframe, ...params). Read the result with [0] (current) and [1] (previous).

float[] sma20;
float[] rsi14;

onTick {
    INDICATOR_SMA(sma20, nifty, H1, 20, 1);
    INDICATOR_RSI(rsi14, nifty, M15, 14, 1);

    if (Close(nifty, M15, 0) > sma20[0] && rsi14[0] < 30) {
        OrderSend(nifty, BUY, 1, 0, 0, 0, INTRADAY, DAY, "pullback");
    }
}

Built-in indicators

IndicatorSignature (after the output array)
Moving averagesINDICATOR_SMA / EMA / SMMA / LWMA(arr, symbol, tf, period, shift)
RSIINDICATOR_RSI(arr, symbol, tf, period, shift)
VWAPINDICATOR_VWAP(arr, symbol, tf, shift)
MACDINDICATOR_MACD / MACD_SIGNAL / MACD_HISTOGRAM(arr, symbol, tf, fast, slow, signal, shift)
Bollinger BandsINDICATOR_BOLINGER_BANDS_UPPER / MIDDLE / LOWER(arr, symbol, tf, period, deviation, shift)
StochasticINDICATOR_STOCHASTICK / STOCHASTICD(arr, symbol, tf, kPeriod, dPeriod, shift)
SupertrendINDICATOR_SUPERTREND / SUPERTREND_DIRECTION(arr, symbol, tf, period, multiplier, shift)
Parabolic SARINDICATOR_PARABOLIC_SAR(arr, symbol, tf, step, max, shift)
SwingINDICATOR_SWING(arr, symbol, tf)

Ready to run this? Build and backtest strategies in the SutraLipi algo trading platform — no-code builder, tick-level backtesting and one-click live execution. Browse all documentation topics.

Code copied — paste it into the editor with Ctrl+V.