Native Indicators
CoreXTrader includes 30+ built-in indicator engines implemented in optimised Rust. Use Native.Source(i.Name) to select one and Native.Fetch(index, buf) to retrieve output buffers.
Indicator Registry
Trend
i.MAperiod, ma_type, source0 → Valuei.EMAperiod, source0 → Valuei.Bollingerperiod, std_dev, source0 Middle · 1 Upper · 2 Loweri.Ichimokutenkan, kijun, senkou0 Tenkan · 1 Kijun · 2 SpanA · 3 SpanB · 4 Chikoui.SARstep, max_step0 → Valuei.Supertrendperiod, multiplier0 Value · 1 Direction (+1/-1)i.Pivotmethod, timeframe0 Pivot · 1 R1 · 2 S1 · 3 R2 · 4 S2i.ZigZagdeviation, depth, backstep0 → Valuei.MACross(from strategy params)0 Fast MA · 1 Slow MAOscillator
i.RSIperiod, source0 → Value (0–100)i.MACDfast, slow, signal, source0 MACD · 1 Signal · 2 Histogrami.Stochastick_period, d_period, slowing0 %K · 1 %Di.Momentumperiod, source0 → Valuei.DeMarkerperiod0 → Value (0–1)i.WilliamsRperiod0 → Value (−100–0)i.RVIperiod0 → ValueVolatility
i.ATRperiod0 → Valuei.StdDevperiod, source0 → ValueVolume
i.OBV—0 → Valuei.MFIperiod0 → Value (0–100)i.CMFperiod0 → Value (−1–+1)i.ForceIndexperiod0 → ValuePrice Source & MA Type Enums
Price.* — Price Source
Price.ClosePrice.OpenPrice.HighPrice.LowPrice.MedianPrice.TypicalPrice.WeightedMA.* — MA Type
MA.SMAMA.EMAMA.WMAMA.HMAMA.DEMAMA.TEMAMA.TMAPivot.Method
Pivot.TraditionalPivot.FibonacciPivot.WoodiePivot.Timeframe
Pivot.DailyPivot.WeeklyPivot.MonthlySignal Helpers
| Function / Property | Parameters | Returns | Description |
|---|---|---|---|
CrossOver(a,b) | double[] a, b | bool | True on the bar where a crossed above b. |
CrossUnder(a,b) | double[] a, b | bool | True on the bar where a crossed below b. |
Highest(series,n) | double[] s, int n | double | Maximum value over the last n bars. |
Lowest(series,n) | double[] s, int n | double | Minimum value over the last n bars. |
Rising(series,n) | double[] s, int n | bool | True if the series has risen for n consecutive bars. |
Falling(series,n) | double[] s, int n | bool | True if the series has fallen for n consecutive bars. |
Wiring Reference — Ichimoku
Ichimoku — full native wiringTDSL
Init() {
Native.Source(i.Ichimoku);
Native.Init(Symbol(), Timeframe);
Native.Parameter(9, 26, 52, 26); // tenkan, kijun, senkou, displacement
Native.Bind(Ichi);
}
Ichi.calculate() {
int len = length(close());
series double tenkan_buf[]; series double kijun_buf[];
series double span_a_buf[]; series double span_b_buf[];
tenkan_buf[] = create_array(len); kijun_buf[] = create_array(len);
span_a_buf[] = create_array(len); span_b_buf[] = create_array(len);
Native.Fetch(0, tenkan_buf); Native.Fetch(1, kijun_buf);
Native.Fetch(2, span_a_buf); Native.Fetch(3, span_b_buf);
struct IchiResult { double tenkan; double kijun; double span_a; double span_b; }
return IchiResult { tenkan:tenkan_buf, kijun:kijun_buf, span_a:span_a_buf, span_b:span_b_buf };
}
Tick() {
bool above_cloud = Symbol.Bid() > Math.Max(Ichi.span_a(0), Ichi.span_b(0));
bool tk_cross = Ichi.tenkan(1) < Ichi.kijun(1) && Ichi.tenkan(0) > Ichi.kijun(0);
if (tk_cross && above_cloud && Position.Count() == 0) { Trade.Buy(Symbol(), 0.1); }
}