Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Native indicator catalogue

All entries below are compiled into the current binary. They consume public trades and publish one finite f64 through quince.get("<name>"). A dash in Parameters means that the directive takes no arguments. period is the lookback length in trades; alpha is an exponential smoothing factor.

@using custom_ema:20

on trade(t) {
    feature ema = quince.get("custom_ema")
}

Some indicators require warm-up and therefore do not yield a value until enough trades have arrived. Statistical and microstructure features are descriptive; they must be replay-tested rather than interpreted as a standalone order signal.

Trend and momentum

IndicatorParametersDescription
custom_smaperiodSimple moving average of trade price; a slow, stable price baseline.
custom_emaperiodExponentially weighted moving average of price, with more weight on recent trades.
custom_wmaperiodLinearly weighted moving average that emphasizes newer prices.
custom_demaperiodDouble EMA, reducing lag relative to a single EMA.
custom_temaperiodTriple EMA, a more aggressive lag-reduced moving average.
custom_kamaperiod, fast, slowKaufman adaptive moving average; adapts smoothing to directional efficiency.
custom_linear_regressionperiodRolling least-squares slope of price, expressing local trend direction.
custom_momentumperiodDifference between current price and the price period trades ago.
custom_rocperiodPercentage rate of change over a rolling trade lookback.
custom_rsiperiodRelative Strength Index computed from trade-to-trade gains and losses.
custom_cmoperiodChande Momentum Oscillator, a signed gain/loss momentum measure.
custom_macd_signalfast, slow, signalMACD signal line derived from fast and slow EMAs of price.
custom_trixperiodRate of change of a triple-smoothed EMA; suppresses short-term noise.
custom_stochastic_kperiodCurrent price position within its rolling high-low range.
custom_williams_rperiodInverted high-low range oscillator indicating price location near extremes.
custom_vortexperiodDirectional-movement ratio over a rolling trade window.
custom_efficiency_ratioPrice displacement divided by total absolute path; values near one indicate a clean move.
custom_zscoreperiodPrice distance from its rolling mean in rolling standard deviations.

Volatility and range

IndicatorParametersDescription
custom_atrperiodTrade-level average true range, using absolute consecutive price changes.
custom_true_rangeAbsolute change from the previous trade price.
custom_bollinger_widthperiodWidth of a rolling price band; a compact proxy for dispersion.
custom_donchian_widthperiodDifference between the rolling high and low price.
custom_historical_volatilityperiodRolling volatility of log returns.
custom_ewma_volatilityalphaExponentially weighted volatility of log returns.
custom_parkinson_volatilityperiodParkinson-scaled rolling root-mean-square of trade log returns.
custom_return_varianceOnline variance of log returns.
custom_return_skewnessOnline skewness of log returns; identifies asymmetry in return distribution.
custom_return_kurtosisOnline excess-tailedness measure of log returns.
custom_log_returnNatural logarithm of current price divided by previous price.

Volume and money flow

IndicatorParametersDescription
signed_volumeCumulative buy quantity minus sell quantity.
custom_signed_volume_ratioSigned volume normalized by cumulative total volume.
custom_buy_volume_ratioCumulative fraction of traded quantity initiated by buyers.
custom_obvOn-balance volume: volume added or subtracted according to price direction.
custom_cvdCumulative volume delta: buy quantity minus sell quantity over time.
custom_vwapCumulative volume-weighted average trade price.
custom_vwmaperiodRolling volume-weighted moving average of price.
custom_mfiperiodMoney Flow Index based on typical-price changes and traded quantity.
custom_money_flowSigned typical-price times quantity flow.
custom_force_indexalphaSmoothed price-change times quantity measure.
custom_chaikin_oscillatorfast_alpha, slow_alphaDifference between fast and slow exponentially smoothed money flow.
custom_volume_rocperiodPercentage rate of change of trade quantity.
custom_volume_zscoreperiodTrade quantity relative to its rolling mean and deviation.
custom_large_trade_ratiothresholdCumulative share of trades whose quantity meets the threshold.
custom_average_trade_sizeRunning arithmetic mean of trade quantity.

Microstructure and price transforms

IndicatorParametersDescription
custom_trade_imbalanceBuy-versus-sell trade-count imbalance.
custom_trade_intensityTrade arrival intensity estimated from event timestamps.
custom_price_impactAbsolute price move per unit of current trade quantity.
custom_tick_directionSign of the most recent trade-to-trade price move.
custom_tick_run_lengthLength of the current uninterrupted directional tick run.
custom_median_priceRunning midpoint of the observed minimum and maximum trade price.
custom_typical_priceCurrent trade price, exposed through an explicit custom-indicator contract.
custom_logistic_regressionlearning_rate, l2Online logistic model of trade log returns; emits model buy-pressure probability in [0, 1].

Selecting a feature

Begin with one feature per hypothesis: trend (custom_ema or custom_linear_regression), volatility (custom_ewma_volatility), flow (custom_cvd or custom_buy_volume_ratio), or microstructure (custom_price_impact). Treat closely related variants as correlated features, not independent confirmation. Keep a strategy in shadow/replay mode until its fee- and slippage-adjusted out-of-sample behavior is understood.