v1.0.2

Dynamic Inputs

Kafal provides built-in compiler directives that allow you to expose parameters and metadata directly to the host application's user interface.

The @input Directive

The @input directive instructs the compiler to extract the variable into a UI schema. Supported types include :int, :float, :bool, and :enum.

// Numerical Inputs (Integers and Floats)
@input len:int = 14 min=1 max=100 step=1 title="RSI Length" group="Momentum"

// Boolean Toggles
@input show_lines:bool = true title="Show Moving Averages"

// Dropdown Menus (Enum)
@input src:enum = close options="open,high,low,close" title="Source Price"

Script Metadata

The define directive configures script-level metadata. This is typically used to tell the charting frontend how to render the output (e.g., overlay=true).

// Script Metadata
define name="Institutional VWAP" short_name="InstVWAP" overlay=true precision=2
define category="Volume" tags="vwap,institutional"