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
| Indicator | Signature (after the output array) |
|---|---|
| Moving averages | INDICATOR_SMA / EMA / SMMA / LWMA(arr, symbol, tf, period, shift) |
| RSI | INDICATOR_RSI(arr, symbol, tf, period, shift) |
| VWAP | INDICATOR_VWAP(arr, symbol, tf, shift) |
| MACD | INDICATOR_MACD / MACD_SIGNAL / MACD_HISTOGRAM(arr, symbol, tf, fast, slow, signal, shift) |
| Bollinger Bands | INDICATOR_BOLINGER_BANDS_UPPER / MIDDLE / LOWER(arr, symbol, tf, period, deviation, shift) |
| Stochastic | INDICATOR_STOCHASTICK / STOCHASTICD(arr, symbol, tf, kPeriod, dPeriod, shift) |
| Supertrend | INDICATOR_SUPERTREND / SUPERTREND_DIRECTION(arr, symbol, tf, period, multiplier, shift) |
| Parabolic SAR | INDICATOR_PARABOLIC_SAR(arr, symbol, tf, step, max, shift) |
| Swing | INDICATOR_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.