Technical indicators computed on OHLC bars, accessible from your algo with a single call. Built-in library covers the essentials β custom indicators plug in via a clean virtual interface.
All indicators derive from indicatorCore_c β a minimal virtual base class.
Indicators are attached to OHLC series and updated automatically on each bar close.
indicatorCore_c Base Class| Virtual Method | Purpose |
|---|---|
setParams(json) |
Configure the indicator from JSON parameters |
getDataSize() |
Return the size of one data element in bytes |
getData() |
Return pointer to the raw data buffer |
update(ohlc, index) |
Compute the next value when a bar closes |
The base class also provides data_move() β a helper that shifts the data buffer
when older bars are evicted from the OHLC ring buffer. This keeps the indicator aligned
with the OHLC data without manual index management.
ohlcInfo_s
holds an array of indicatorInfo_s*. When a bar closes, the OHLC system calls
update() on every attached indicator, passing the completed bar. Your algo
accesses indicator values by referencing the OHLC + indicator by their config IDs β
no direct pointer management needed.
| Indicator | Class |
|---|---|
| SMA | Ind_AverageSMA |
| EMA | indAverageEMA |
| WMA | Ind_AverageWMA |
| HMA | indAverageHMA |
| ZLHMA | Ind_AverageZLHMA |
5 moving average variants: simple, exponential, weighted, Hull, and zero-lag Hull. Configurable period for each.
| Indicator | Class |
|---|---|
| MACD | Ind_Macd |
| RSI | Ind_RSI |
| Bollinger Bands | Ind_BollingerBand |
MACD with signal line and histogram. RSI with configurable period. Bollinger Bands with configurable period and sigma multiplier.
| Indicator | Class |
|---|---|
| ATR | Ind_AverageTrueRange |
| Bar Range | Ind_AverageBarRange |
| Trading Range | Ind_TradingRange |
ATR for volatility-based stop placement. Bar range for intra-bar volatility. Trading range for support/resistance detection.
The instrumentInfo_s struct provides convenience methods to retrieve indicator values
without navigating the OHLC/indicator hierarchy manually.
| Method | Returns |
|---|---|
GetIndicatorValue(ohlcId, indId, barIdx, valIdx) |
Value at a specific bar index |
GetIndicatorValueWorking(ohlcId, indId, valIdx) |
Current (in-progress) bar value |
GetIndicatorValueLast(ohlcId, indId, valIdx, offset) |
Most recent completed bar, with optional offset |
ohlcId and indId are configInfo_s references β
the same IDs used in the config file. valIdx selects which output value
(e.g., 0 for MACD line, 1 for signal line, 2 for histogram).
| Method | Returns |
|---|---|
findOhlc(duration) |
Find OHLC series by timeframe |
findOhlc(configId) |
Find OHLC series by config ID |
GetOhlcWorking(configId) |
Current in-progress bar |
GetOhlcLast(configId, offset) |
Completed bar with offset |
Each ohlcFull_s contains the standard OHLC prices (ohlc),
Heikin-Ashi prices (ohlcHA), volume, CVD, trade count, and timestamp.
Bar analysis helpers: IsGreen(), IsRed(), getRange(),
lengthBody(), lengthUpperWick(), lengthLowerWick().
configInfo_s IDs for your OHLC timeframe and indicators
(parsed from onSetParams()). Then call e.g.
instr->GetIndicatorValueLast(ohlcId, rsiId, 0) to get the latest RSI value,
or instr->GetIndicatorValue(ohlcId, macdId, 5, 2) to get the MACD histogram
from 5 bars ago. No pointers, no array indices β symbolic config IDs only.
Adding a custom indicator is straightforward: derive from indicatorCore_c,
implement the four virtual methods, and register it in the indicator store.
indicatorCore_csetParams(),
getDataSize(), getData(), update()
Indicators own a fixed-size data buffer. The OHLC system maintains
_OHLC_ITEM_COUNT (2048) bars total, keeping _OHLC_ITEM_KEEP
(256) bars when rotating. The data_move() method shifts your indicator's
data accordingly β you just implement the math in update().
Multi-value indicators (like MACD with line + signal + histogram) use
getDataSize() to declare their element width. The framework handles
the memory layout β your update() writes all output values for one bar.