KABABALIKABABALISCRIPT DOCS
OFFICIAL EXECUTABLE REGISTRY

KababaliScript Language Reference

This page is generated from the same native registry used by the compiler. If a function is not listed as executable here, the KSL editor must not silently assume it exists.

Executable functions62
Series indicators39
Boolean conditions18
Safe compatibility aliases40
SUPPORTED NOW

Executable functions

These are compiler-registered and runtime-backed. Search before asking an AI to generate a complex strategy.

ema()series
ema(series, positive_int)
ema(close, 9)
sma()series
sma(series, positive_int)
sma(close, 20)
wma()series
wma(series, positive_int)
wma(close, 20)
rsi()series
rsi(series, positive_int)
rsi(close, 14)
stochastic_k()series
stochastic_k(series, series, series, positive_int)
stochastic_k(high, low, close, 14)
stochastic_d()series
stochastic_d(series, series, series, positive_int, positive_int)
stochastic_d(high, low, close, 14, 3)
cci()series
cci(series, series, series, positive_int)
cci(high, low, close, 20)
momentum()series
momentum(series, positive_int)
momentum(close, 14)
macd_line()series
macd_line(series, positive_int, positive_int)
macd_line(close, 12, 26)
macd_signal()series
macd_signal(series, positive_int, positive_int, positive_int)
macd_signal(close, 12, 26, 9)
adx()series
adx(series, series, series, positive_int)
adx(high, low, close, 14)
plus_di()series
plus_di(series, series, series, positive_int)
plus_di(high, low, close, 14)
minus_di()series
minus_di(series, series, series, positive_int)
minus_di(high, low, close, 14)
atr()series
atr(positive_int)
atr(14)
bb_mid()series
bb_mid(series, positive_int)
bb_mid(close, 20)
bb_upper()series
bb_upper(series, positive_int, positive_number)
bb_upper(close, 20, 2.0)
bb_lower()series
bb_lower(series, positive_int, positive_number)
bb_lower(close, 20, 2.0)
vwap()series
vwap(series, series)
vwap(close, volume)
obv()series
obv(series, series)
obv(close, volume)
mfi()series
mfi(series, series, series, series, positive_int)
mfi(high, low, close, volume, 14)
supertrend()series
supertrend(series, series, series, positive_int, positive_number)
supertrend(high, low, close, 14, 3.0)
parabolic_sar()series
parabolic_sar(series, series, positive_number, positive_number)
parabolic_sar(high, low, 0.02, 0.2)
pivot_point()series
pivot_point(series, series, series)
pivot_point(high, low, close)
pivot_r1()series
pivot_r1(series, series, series)
pivot_r1(high, low, close)
pivot_s1()series
pivot_s1(series, series, series)
pivot_s1(high, low, close)
pivot_r2()series
pivot_r2(series, series, series)
pivot_r2(high, low, close)
pivot_s2()series
pivot_s2(series, series, series)
pivot_s2(high, low, close)
donchian_high()series
donchian_high(series, positive_int)
donchian_high(high, 20)
donchian_low()series
donchian_low(series, positive_int)
donchian_low(low, 20)
highest()series
highest(series, positive_int)
highest(high, 20)
lowest()series
lowest(series, positive_int)
lowest(low, 20)
ichimoku_conversion()series
ichimoku_conversion(positive_int)
ichimoku_conversion(9)
ichimoku_base()series
ichimoku_base(positive_int)
ichimoku_base(26)
ichimoku_span_a()series
ichimoku_span_a(positive_int, positive_int)
ichimoku_span_a(9, 26)
ichimoku_span_b()series
ichimoku_span_b(positive_int)
ichimoku_span_b(52)
higher_close()series
higher_close(timeframe)
higher_close(M5)
higher_ema()series
higher_ema(timeframe, series, positive_int)
higher_ema(M5, close, 21)
custom_ma()series
custom_ma(series, positive_int, enum:ma)
custom_ma(close, 20, EMA)
custom_oscillator()series
custom_oscillator(series, positive_int, enum:oscillator)
custom_oscillator(close, 14, RSI)
crossover()bool
crossover(series, series)
crossover(fastEma, slowEma)
crossunder()bool
crossunder(series, series)
crossunder(fastEma, slowEma)
break_of_structure_up()bool
break_of_structure_up(positive_int)
break_of_structure_up(20)
break_of_structure_down()bool
break_of_structure_down(positive_int)
break_of_structure_down(20)
choch_up()bool
choch_up(positive_int)
choch_up(20)
choch_down()bool
choch_down(positive_int)
choch_down(20)
liquidity_sweep_high()bool
liquidity_sweep_high(positive_int)
liquidity_sweep_high(20)
liquidity_sweep_low()bool
liquidity_sweep_low(positive_int)
liquidity_sweep_low(20)
bullish_divergence()bool
bullish_divergence(series, series, positive_int)
bullish_divergence(close, rsiValue, 20)
bearish_divergence()bool
bearish_divergence(series, series, positive_int)
bearish_divergence(close, rsiValue, 20)
retest_long()bool
retest_long(series, positive_int)
retest_long(level, 10)
retest_short()bool
retest_short(series, positive_int)
retest_short(level, 10)
candle_bullish_engulfing()bool
candle_bullish_engulfing()
candle_bullish_engulfing()
candle_bearish_engulfing()bool
candle_bearish_engulfing()
candle_bearish_engulfing()
in_session()bool
in_session(session)
in_session("LONDON")
volatility_low()bool
volatility_low(positive_int, volatility_multiplier)
volatility_low(14, 1.5)
volatility_normal()bool
volatility_normal(positive_int, volatility_multiplier)
volatility_normal(14, 1.5)
volatility_high()bool
volatility_high(positive_int, volatility_multiplier)
volatility_high(14, 1.5)
swing_low()stop
swing_low(positive_int)
swing_low(10)
swing_high()stop
swing_high(positive_int)
swing_high(10)
atr_stop()stop
atr_stop(positive_number)
atr_stop(1.5)
rr()target
rr(reward_risk)
rr(2.0)
fixed_pips()distance
fixed_pips(positive_number)
fixed_pips(20)
AI / PROFESSIONAL STRATEGY IMPORT

Safe compatibility aliases

The Compatibility Checker can rename these known terms to native KSL. It does not change the trading logic or invent missing features.

AI / alternate nameNative KSLCategory
ADX()adx()Common naming
ATR()atr()Common naming
average_true_range()atr()Common naming
bollinger_lower()bb_lower()Common naming
bollinger_mid()bb_mid()Common naming
bollinger_upper()bb_upper()Common naming
bos_down()break_of_structure_down()Common naming
bos_up()break_of_structure_up()Common naming
CCI()cci()Common naming
di_minus()minus_di()Common naming
di_plus()plus_di()Common naming
EMA()ema()Common naming
exponential_moving_average()ema()Common naming
liquidity_sweep_buy()liquidity_sweep_low()Common naming
liquidity_sweep_sell()liquidity_sweep_high()Common naming
macd()macd_line()Common naming
macd_sig()macd_signal()Common naming
MFI()mfi()Common naming
OBV()obv()Common naming
relative_strength_index()rsi()Common naming
RSI()rsi()Common naming
simple_moving_average()sma()Common naming
SMA()sma()Common naming
ta.adx()adx()AI/Pine compatibility
ta.atr()atr()AI/Pine compatibility
ta.cci()cci()AI/Pine compatibility
ta.crossover()crossover()AI/Pine compatibility
ta.crossunder()crossunder()AI/Pine compatibility
ta.ema()ema()AI/Pine compatibility
ta.highest()highest()AI/Pine compatibility
ta.lowest()lowest()AI/Pine compatibility
ta.mfi()mfi()AI/Pine compatibility
ta.obv()obv()AI/Pine compatibility
ta.rsi()rsi()AI/Pine compatibility
ta.sma()sma()AI/Pine compatibility
ta.vwap()vwap()AI/Pine compatibility
ta.wma()wma()AI/Pine compatibility
VWAP()vwap()Common naming
weighted_moving_average()wma()Common naming
WMA()wma()Common naming
CORE STRUCTURE

Minimal KSL v2 strategy

version 2;
strategy "Professional Setup" {
  timeframe = M5;
  input int period = 21 min 2 max 100;
  let trend = ema(close, period);
  let buySignal = close > trend;

  buy {
    when = buySignal;
    entry = ask;
    stop = atr_stop(1.5);
    target = rr(2.0);
  }

  plot(trend, color.green, "EMA");
  draw(buySignal);
}
LIVE-TRADING SAFETY

What KSL refuses

  • Unknown indicators or functions that have no runtime implementation
  • Loops, arrays, imports, arbitrary network/database access, or dynamic execution
  • Forming-candle dependencies for strategy conditions
  • Silent conversion of unsupported strategy meaning
  • Activation when validation fails

An admin registry entry marked Draft is documentation only. It becomes safely convertible only when mapped to an already executable native function; a genuinely new indicator still requires tested runtime implementation.

RECOMMENDED PROFESSIONAL FLOW

AI strategy → Compatibility Check → Validate → Activate

1Write the ideaTrader describes the exact rules.
2Generate KSLAI uses this registry and prompt guide.
3Check CompatibilityNative, convertible, or unsupported capabilities are identified.
4ValidateThe compiler remains the final authority.
5WATCH firstClosed-candle behavior is audited before live execution.