HFT Tables: Technical Indicators
Adding an Indicator on a Symbol
ADD INDICATOR "sma" ("10") ON SYMBOL 2 COLUMN_NO 0 TICKS 1;To initialize an indicator on a symbol, define the indicator name (sma), its parameters in parenthesized quotes (e.g. "10" for window size), the symbol index (SYMBOL 2), the target column index, and the tick update frequency. Use column index -1 for indicators that track the L2 order book directly instead of a specific data column like OBI (Order Book Imbalance). Ticks here indicates how often the indicator will be updated it is intended for CPU efficiency to avoid calculations every tick.
Listing All Indicators on a Symbol
FETCH INDICATOR FROM HFT SYMBOL 2;
To check all technical indicators currently active on a specific symbol, execute this query. The database engine queries the active symbol mappings and returns a JSON payload containing the names of all registered indicators mapped to their respective internal active indices (e.g. {"sma": 0, "obi": 1}).
Available Indicators with their defined name
Simple Moving Average (sma)
Computes the moving average of a target table column over a specified window length. SMA updates incrementally on every tick by adding the latest value and subtracting the oldest value falling out of the window. This keeps execution time at constant O(1) complexity, independent of the window size, making it extremely fast.
Exponential Moving Average (ema)
Computes the exponentially smoothed moving average of a column's values. EMA applies a weighting multiplier to the most recent price data, making it more responsive to new price changes compared to SMA. This helps strategies identify shifts in trends faster while smoothing out sudden, short-lived spikes in volatile markets.
Order Book Imbalance (obi)
Measures the relative volume difference between buy (bids) and sell (asks) sides at the top of the L2 order book. It calculates the imbalance as the difference of bid and ask quantities scaled by the engine's scaling factor (10^6) and divided by the total top-of-book volume. This delivers a bounded, scaled integer value representing order book pressure without triggering floating-point overhead.
Relative Strength Index (rsi)
A momentum oscillator that measures the speed and change of price movements, typically over a 14-period window. It yields a scaled momentum metric indicating overbought or oversold conditions without heap allocation or floating-point division bottlenecks. This indicator is crucial for mean-reversion strategies looking to enter positions at market extremes.
Moving Average Convergence Divergence (macd)
A trend-following momentum indicator that shows the relationship between two moving averages (typically 12 EMA and 26 EMA) along with a 9 EMA signal line. Calculated natively inside the engine loop for sub-microsecond signal generation. It helps strategies identify shifts in trend direction, strength, and momentum by tracking moving average crossovers.
Volume Weighted Average Price (vwap)
Computes the average price of an asset weighted by total volume. VWAP updates continuously on each tick by tracking cumulative price times volume divided by cumulative volume, serving as a key benchmark for trade executions. Institutional algorithms frequently use VWAP to ensure order fills align with overall market liquidity.
Bollinger Bands (bollinger)
Consists of a middle band (SMA) and two outer bands representing standard deviations above and below the SMA. Used by strategies to gauge market volatility and identify dynamic support/resistance zones. When the bands contract, it indicates low volatility, often preceding a major price breakout, whereas wide bands indicate high volatility.
Average True Range (atr)
A volatility indicator that measures market volatility by decomposing the entire range of an asset price for that period. Useful for adaptive stop-loss and dynamic strategy sizing. By tracking historical range expansions, it helps algos adjust threshold parameters dynamically to prevent premature order stops during high volatility.
Stochastic Oscillator (stochastic)
A momentum indicator comparing a closing price to its price range over a certain period of time. The sensitivity of the oscillator is reducible by adjusting the time period or taking a moving average of the result. It operates on the assumption that prices tend to close near their highs in uptrends and near their lows in downtrends.
On-Balance Volume (obv)
A momentum indicator that uses volume flow to predict changes in stock price. It adds volume on up days and subtracts volume on down days to measure cumulative buying and selling pressure. Algos monitor OBV to detect institutional accumulation or distribution before the price action reflects the move.
Average Directional Index (adx)
A trend strength indicator that measures the overall strength of a trend. It fluctuates between 0 and 100, where values above 25 generally indicate a strong, active trend. This allows trading strategies to distinguish between trending and ranging markets, adapting execution rules accordingly to avoid sideways whip-saws.
Awesome Oscillator (awesome_osc)
A momentum indicator used to measure market momentum. It calculates the difference between a 34-period and 5-period Simple Moving Average of the bar's midpoints (H+L)/2. By comparing recent momentum with historical averages, it helps strategies spot trend reversals and entry signals based on zero-line crossings.
Commodity Channel Index (cci)
A momentum-based oscillator used to help determine when an investment vehicle is reaching overbought or oversold conditions. It measures the current price level relative to an average price level over a given period of time. Strategies use it to capture cyclical trends and identify trade setups near range extremes.
Donchian Channels (donchian_channels)
Consists of upper, lower, and median bands generated by moving maximums and minimums over a specified window. It is highly effective for identifying breakout strategies and range bounds. The channels automatically expand and contract, capturing the full volatility boundaries of recent price action.
Ichimoku Cloud (ichimoku)
A comprehensive collection of technical indicators that show support and resistance levels, as well as trend direction and momentum. It calculates multiple averages (Tenkan-sen, Kijun-sen, Senkou Span A/B) to plot a predictive cloud. The cloud acts as a dynamic support/resistance zone, showing the strength of the prevailing trend.
Keltner Channels (keltner_channels)
Volatility-based bands placed on either side of an asset's exponential moving average. The bands are set at a multiple of the Average True Range (ATR), helping traders identify overextended price moves. Breakouts above or below the channels signal strong trend acceleration or potential mean-reversion setups.
Money Flow Index (mfi)
A technical oscillator that uses both price and volume data to identify overbought or oversold signals in an asset. It is often referred to as volume-weighted RSI. It measures the rate at which money is flowing into or out of a security, providing reliable divergence signals before price turns.
Parabolic SAR (parabolic_sar)
A trend-following indicator used to determine the price direction of an asset and identify potential trend reversals. It plots dots above or below the price bars to signal optimal entry and exit points. High-frequency strategies use the SAR dots to trail stop-loss limits dynamically as a trend progresses.
Pivot Points (pivot_points)
Predictable turning points calculated using the high, low, and close prices of previous trading sessions. They provide traders with static, objective support and resistance levels. Because pivot levels are calculated at the start of a session, they serve as stable benchmarks for intraday target setups.
TRIX (trix)
A momentum oscillator that shows the rate of change of a triple-exponentially smoothed moving average. It helps filter out minor market noise and cycles to identify long-term trend reversals. By smoothing the data three times, it prevents false crossover signals common in highly volatile tick streams.
Volume (volume)
Captures the raw and rolling volume of trades and order book transactions. Used as a baseline indicator to validate breakouts, trends, and support/resistance zones. High volume confirms price movements, indicating strong participation, while low volume suggests weak conviction and potential consolidation.
Williams (williams)
A momentum indicator that is the inverse of the Fast Stochastic Oscillator. It reflects the level of the close relative to the highest high for the lookback period, oscillating between 0 and -100 to flag overbought/oversold levels. Strategies monitor it to execute rapid entries when prices snap back from lookback extremes.
Note: Here the names given in paranthesis are defined names for the indicators. You have to use these names in the ADD INDICATOR command as it is.
Note: Strategies and indicators are not stored in disk for a table. So, if a server restarts you will again have to apply the indicators by using ADD INDICATOR command.