Docs / Native Indicators

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 → Value
i.EMAperiod, source0 → Value
i.Bollingerperiod, std_dev, source0 Middle · 1 Upper · 2 Lower
i.Ichimokutenkan, kijun, senkou0 Tenkan · 1 Kijun · 2 SpanA · 3 SpanB · 4 Chikou
i.SARstep, max_step0 → Value
i.Supertrendperiod, multiplier0 Value · 1 Direction (+1/-1)
i.Pivotmethod, timeframe0 Pivot · 1 R1 · 2 S1 · 3 R2 · 4 S2
i.ZigZagdeviation, depth, backstep0 → Value
i.MACross(from strategy params)0 Fast MA · 1 Slow MA
Oscillator
i.RSIperiod, source0 → Value (0–100)
i.MACDfast, slow, signal, source0 MACD · 1 Signal · 2 Histogram
i.Stochastick_period, d_period, slowing0 %K · 1 %D
i.Momentumperiod, source0 → Value
i.DeMarkerperiod0 → Value (0–1)
i.WilliamsRperiod0 → Value (−100–0)
i.RVIperiod0 → Value
Volatility
i.ATRperiod0 → Value
i.StdDevperiod, source0 → Value
Volume
i.OBV0 → Value
i.MFIperiod0 → Value (0–100)
i.CMFperiod0 → Value (−1–+1)
i.ForceIndexperiod0 → Value

Price Source & MA Type Enums

Price.* — Price Source
Price.ClosePrice.OpenPrice.HighPrice.LowPrice.MedianPrice.TypicalPrice.Weighted
MA.* — MA Type
MA.SMAMA.EMAMA.WMAMA.HMAMA.DEMAMA.TEMAMA.TMA
Pivot.Method
Pivot.TraditionalPivot.FibonacciPivot.Woodie
Pivot.Timeframe
Pivot.DailyPivot.WeeklyPivot.Monthly

Signal Helpers

Function / PropertyParametersReturnsDescription
CrossOver(a,b)double[] a, bboolTrue on the bar where a crossed above b.
CrossUnder(a,b)double[] a, bboolTrue on the bar where a crossed below b.
Highest(series,n)double[] s, int ndoubleMaximum value over the last n bars.
Lowest(series,n)double[] s, int ndoubleMinimum value over the last n bars.
Rising(series,n)double[] s, int nboolTrue if the series has risen for n consecutive bars.
Falling(series,n)double[] s, int nboolTrue 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); }
}