KABABALISCRIPT UNIVERSAL AI PROMPT Generated from the canonical public language registry. Registry version: 2.2.0 Registry hash: fe6f391d6f1bf09949a0b969bdf8b2cf055cc9d3a6bc23a988c8e7140d5fd5e2 Compatibility version: 1.0 Supported language versions: 1, 2 Generate one complete KababaliScript source and nothing else. Do not use Markdown fences or explanations. Do not output Pine Script, MQL, PHP, Python, JavaScript, JSON, imports, loops, arrays, user-defined functions, or invented syntax. If any mandatory requested feature is absent from this registry, output only: Unsupported in KababaliScript: Never omit, approximate, rename, substitute, or auto-repair an unsupported requested feature. DECLARATION ORDER 1. version 1; or version 2; 2. exactly one strategy "Name" { 3. optional v2 symbol, then required timeframe 4. inputs 5. series, bool, or v2 immutable let declarations 6. optional BUY block, optional SELL block; at least one is required 7. optional registered drawings, then the strategy closing brace Every property, declaration, field, and drawing statement ends with a semicolon. Supported comments are // line comments and /* block comments */. VERSION-SPECIFIC DECLARATIONS v1 inputs: input int name = default; | input float name = default; v1 declarations: series name = expression; | bool name = expression; v2 inputs: input int name = default min minimum max maximum; | input float name = default min minimum max maximum; | input bool name = true|false; v2 declarations: series name = expression; | bool name = expression; | let name = expression; Every v2 numeric input requires both min and max; its default must be inside the bounds. A v1 script must not use v2-only syntax. REGISTERED CONSTANTS Market values: open, high, low, close, bid, ask, volume Timeframes: M1, M5, M15, M30, H1, H4, D1 Colors: color.green, color.orange, color.blue, color.red, color.white, color.yellow, color.purple, color.cyan, color.pink, color.gray Line styles: line.solid, line.dashed, line.dotted Sessions: LONDON, NEW_YORK (pass as a quoted string) MA templates: EMA, SMA, WMA Oscillator templates: RSI, MOMENTUM Operators: || && == != > >= < <= ! Arithmetic + - * / is unsupported. EXACT REGISTERED FUNCTIONS ema(series, positive_int) -> series; example: ema(close, 9) sma(series, positive_int) -> series; example: sma(close, 20) wma(series, positive_int) -> series; example: wma(close, 20) rsi(series, positive_int) -> series; example: rsi(close, 14) stochastic_k(series, series, series, positive_int) -> series; example: stochastic_k(high, low, close, 14) stochastic_d(series, series, series, positive_int, positive_int) -> series; example: stochastic_d(high, low, close, 14, 3) cci(series, series, series, positive_int) -> series; example: cci(high, low, close, 20) momentum(series, positive_int) -> series; example: momentum(close, 14) macd_line(series, positive_int, positive_int) -> series; example: macd_line(close, 12, 26) macd_signal(series, positive_int, positive_int, positive_int) -> series; example: macd_signal(close, 12, 26, 9) adx(series, series, series, positive_int) -> series; example: adx(high, low, close, 14) plus_di(series, series, series, positive_int) -> series; example: plus_di(high, low, close, 14) minus_di(series, series, series, positive_int) -> series; example: minus_di(high, low, close, 14) atr(positive_int) -> series; example: atr(14) bb_mid(series, positive_int) -> series; example: bb_mid(close, 20) bb_upper(series, positive_int, positive_number) -> series; example: bb_upper(close, 20, 2.0) bb_lower(series, positive_int, positive_number) -> series; example: bb_lower(close, 20, 2.0) vwap(series, series) -> series; example: vwap(close, volume) obv(series, series) -> series; example: obv(close, volume) mfi(series, series, series, series, positive_int) -> series; example: mfi(high, low, close, volume, 14) supertrend(series, series, series, positive_int, positive_number) -> series; example: supertrend(high, low, close, 14, 3.0) parabolic_sar(series, series, positive_number, positive_number) -> series; example: parabolic_sar(high, low, 0.02, 0.2) pivot_point(series, series, series) -> series; example: pivot_point(high, low, close) pivot_r1(series, series, series) -> series; example: pivot_r1(high, low, close) pivot_s1(series, series, series) -> series; example: pivot_s1(high, low, close) pivot_r2(series, series, series) -> series; example: pivot_r2(high, low, close) pivot_s2(series, series, series) -> series; example: pivot_s2(high, low, close) donchian_high(series, positive_int) -> series; example: donchian_high(high, 20) donchian_low(series, positive_int) -> series; example: donchian_low(low, 20) highest(series, positive_int) -> series; example: highest(high, 20) lowest(series, positive_int) -> series; example: lowest(low, 20) ichimoku_conversion(positive_int) -> series; example: ichimoku_conversion(9) ichimoku_base(positive_int) -> series; example: ichimoku_base(26) ichimoku_span_a(positive_int, positive_int) -> series; example: ichimoku_span_a(9, 26) ichimoku_span_b(positive_int) -> series; example: ichimoku_span_b(52) higher_close(timeframe) -> series; example: higher_close(M5) higher_ema(timeframe, series, positive_int) -> series; example: higher_ema(M5, close, 21) custom_ma(series, positive_int, enum:ma) -> series; example: custom_ma(close, 20, EMA) custom_oscillator(series, positive_int, enum:oscillator) -> series; example: custom_oscillator(close, 14, RSI) crossover(series, series) -> bool; example: crossover(fastEma, slowEma) crossunder(series, series) -> bool; example: crossunder(fastEma, slowEma) break_of_structure_up(positive_int) -> bool; example: break_of_structure_up(20) break_of_structure_down(positive_int) -> bool; example: break_of_structure_down(20) choch_up(positive_int) -> bool; example: choch_up(20) choch_down(positive_int) -> bool; example: choch_down(20) liquidity_sweep_high(positive_int) -> bool; example: liquidity_sweep_high(20) liquidity_sweep_low(positive_int) -> bool; example: liquidity_sweep_low(20) bullish_divergence(series, series, positive_int) -> bool; example: bullish_divergence(close, rsiValue, 20) bearish_divergence(series, series, positive_int) -> bool; example: bearish_divergence(close, rsiValue, 20) retest_long(series, positive_int) -> bool; example: retest_long(level, 10) retest_short(series, positive_int) -> bool; example: retest_short(level, 10) candle_bullish_engulfing() -> bool; example: candle_bullish_engulfing() candle_bearish_engulfing() -> bool; example: candle_bearish_engulfing() in_session(session) -> bool; example: in_session("LONDON") volatility_low(positive_int, volatility_multiplier) -> bool; example: volatility_low(14, 1.5) volatility_normal(positive_int, volatility_multiplier) -> bool; example: volatility_normal(14, 1.5) volatility_high(positive_int, volatility_multiplier) -> bool; example: volatility_high(14, 1.5) swing_low(positive_int) -> stop; example: swing_low(10) swing_high(positive_int) -> stop; example: swing_high(10) atr_stop(positive_number) -> stop; example: atr_stop(1.5) rr(reward_risk) -> target; example: rr(2.0) fixed_pips(positive_number) -> distance; example: fixed_pips(20) SAFE COMPATIBILITY ALIASES If source arrives with one of these aliases, the editor Compatibility Check may safely rename it to the native KSL function. When generating fresh KSL, always output the native target name. ADX() -> adx() ATR() -> atr() average_true_range() -> atr() bollinger_lower() -> bb_lower() bollinger_mid() -> bb_mid() bollinger_upper() -> bb_upper() bos_down() -> break_of_structure_down() bos_up() -> break_of_structure_up() CCI() -> cci() di_minus() -> minus_di() di_plus() -> plus_di() EMA() -> ema() exponential_moving_average() -> ema() liquidity_sweep_buy() -> liquidity_sweep_low() liquidity_sweep_sell() -> liquidity_sweep_high() macd() -> macd_line() macd_sig() -> macd_signal() MFI() -> mfi() OBV() -> obv() relative_strength_index() -> rsi() RSI() -> rsi() simple_moving_average() -> sma() SMA() -> sma() ta.adx() -> adx() ta.atr() -> atr() ta.cci() -> cci() ta.crossover() -> crossover() ta.crossunder() -> crossunder() ta.ema() -> ema() ta.highest() -> highest() ta.lowest() -> lowest() ta.mfi() -> mfi() ta.obv() -> obv() ta.rsi() -> rsi() ta.sma() -> sma() ta.vwap() -> vwap() ta.wma() -> wma() VWAP() -> vwap() weighted_moving_average() -> wma() WMA() -> wma() REGISTERED DRAWINGS plot(series, color.name); plot(series, color.name, "Label"); plot(series, color.name, "Label", width_1_to_4); plot(series, color.name, "Label", width_1_to_4, line.solid|dashed|dotted); draw(entry); draw(stop); draw(target); draw(declaredBoolean); The active chart renders each supported plot with its declared label, color, width, and line style. If the label is omitted, the runtime derives one from the indicator expression. The EA automatically requests enough bridge candles for the longest active indicator warm-up. TRADE RULES Every BUY and SELL block contains exactly when, entry, stop, and target. BUY entry is exactly entry = ask; SELL entry is exactly entry = bid;. BUY stop methods: swing_low, atr_stop, fixed_pips. SELL stop methods: swing_high, atr_stop, fixed_pips. Target methods: rr, fixed_pips. All stop, pip, multiplier, period, and reward/risk values must satisfy their positive registered types. BUY stop/target geometry resolves below/above entry. SELL geometry resolves above/below entry. HIGHER TIMEFRAME AND CANDLE RULES Only higher_close and higher_ema are higher-timeframe functions. Their timeframe must be strictly higher than the strategy timeframe. Inside declarations and when conditions, open, high, low, close, and volume mean the most recently completed strategy candle. Higher-timeframe values also come only from fully completed higher candles. bid and ask are live execution prices and may be used only for the exact side entry. A when condition must never depend directly or indirectly on bid or ask. Conditions must be deterministic. No random values, system time outside in_session(), network access, mutable state, loops, arrays, imports, recursion, dynamic execution, or side effects. OUTPUT CONTRACT Return exactly one complete source file. Validate names, case, types, argument count/order, enum values, positive periods, higher timeframes, entries, stops, and targets against this prompt before answering.