API Documentation
Submodules
OnlineTechnicalIndicators is organized into submodules for better code organization:
OnlineTechnicalIndicators.Candlesticks — Module
CandlesticksSubmodule containing candlestick/OHLCV data structures and utilities.
Exports
OHLCV: Candlestick data structure (Open, High, Low, Close, Volume, Time)OHLCVFactory: Factory for creating OHLCV instances from vectorsValueExtractor: Module with functions to extract values from candlesticks
Example
using OnlineTechnicalIndicators.Candlesticks: OHLCV, OHLCVFactory
# Create a single candlestick
candle = OHLCV(100.0, 105.0, 98.0, 103.0; volume=1000.0)
# Create multiple candlesticks from vectors
factory = OHLCVFactory(opens, highs, lows, closes; volume=volumes)
candles = collect(factory)OnlineTechnicalIndicators.Internals — Module
InternalsSubmodule containing internal utility functions for indicator implementation.
Note: These are internal implementation details. While exported for advanced use cases, the API may change between minor versions.
Exports
Type Queries
is_multi_input: Check if an indicator requires OHLCV inputis_multi_output: Check if an indicator produces multiple output valuesexpected_return_type: Get the expected return type of an indicator
Value Utilities
has_output_value: Check if an indicator has a valid output valuehas_valid_values: Check if a circular buffer has enough valid valuesalways_true: Utility function that always returns trueis_valid: Check if a value is not missing
Calculation Functions
_fit!: Internal fit function for OnlineStatsBase integration_calculate_new_value: Calculate new value from internal state_calculate_new_value_only_from_incoming_data: Calculate value from incoming data only
OnlineTechnicalIndicators.Indicators — Module
OnlineTechnicalIndicators.IndicatorsThe Indicators module provides access to all technical indicators for financial analysis.
Categories
- SISO (Single Input, Single Output): SMA, EMA, RSI, MACD, etc.
- SIMO (Single Input, Multiple Output): BB, MACD, StochRSI, KST
- MISO (Multiple Input, Single Output): AccuDist, ATR, OBV, etc.
- MIMO (Multiple Input, Multiple Output): Stoch, ADX, SuperTrend, etc.
Usage
using OnlineTechnicalIndicators.Indicators
# Create indicators
sma = SMA{Float64}(period=14)
ema = EMA{Float64}(period=10)
rsi = RSI{Float64}(period=14)
# Feed data
for price in prices
fit!(sma, price)
fit!(ema, price)
fit!(rsi, price)
end
# Get values
println(value(sma))
println(value(ema))
println(value(rsi))See also: OnlineTechnicalIndicators.Patterns
OnlineTechnicalIndicators.Patterns — Module
OnlineTechnicalIndicators.PatternsThe Patterns module provides access to all candlestick pattern recognition indicators.
Categories
- Single Candle Patterns: Doji, Hammer, ShootingStar, Marubozu, SpinningTop
- Two Candle Patterns: Engulfing, Harami, PiercingDarkCloud, Tweezer
- Three Candle Patterns: Star, ThreeSoldiersCrows, ThreeInside
- Composite Detector: CandlestickPatternDetector
Usage
using OnlineTechnicalIndicators.Patterns
# Create pattern detectors
doji = Doji{OHLCV{Missing,Float64,Float64}}()
hammer = Hammer{OHLCV{Missing,Float64,Float64}}()
# Or use the comprehensive detector
detector = CandlestickPatternDetector{OHLCV{Missing,Float64,Float64}}()
# Feed data
for candle in candles
fit!(doji, candle)
fit!(detector, candle)
end
# Get values
println(value(doji))
println(value(detector))See also: OnlineTechnicalIndicators.Indicators
OnlineTechnicalIndicators.Wrappers — Module
OnlineTechnicalIndicators.WrappersThe Wrappers module provides access to wrapper/decorator types for composing indicators.
Wrapper types extend or modify the behavior of other indicators without changing their underlying implementation. They follow the decorator pattern to add functionality like smoothing, DAG integration, or other transformations.
Exports
Smoother: Generic wrapper that applies a moving average to any indicator's outputDAGWrapper: Wrapper for StatDAG integration withfit!infrastructure
Usage
using OnlineTechnicalIndicators.Wrappers
# Create a smoother that applies SMA(14) to TrueRange
smoother = Smoother(TrueRange; period=14, ma=SMA)
# Feed data
for candle in ohlcv_data
fit!(smoother, candle)
end
println(value(smoother))See also: OnlineTechnicalIndicators.Factories
OnlineTechnicalIndicators.Factories — Module
OnlineTechnicalIndicators.FactoriesThe Factories module provides access to factory functions for creating indicator instances.
Factory functions provide a convenient way to create indicators with specific type parameters or configurations, abstracting away the details of type parameterization.
Exports
MovingAverage: Factory function for creating moving average indicators
Usage
using OnlineTechnicalIndicators.Factories
# Create a moving average factory with Float64 type
factory = MovingAverage(Float64)
ma = factory(SMA, period=10) # Creates SMA{Float64}(period=10)Deprecated
MAFactory: UseMovingAverageinstead (deprecated alias maintained for backward compatibility)
See also: OnlineTechnicalIndicators.Wrappers
Candlesticks Module
The Candlesticks module contains OHLCV (Open, High, Low, Close, Volume) types and related utilities.
OnlineTechnicalIndicators.Candlesticks.OHLCV — Type
OHLCV{Ttime,Tprice,Tvol}Represents OHLCV (Open, High, Low, Close, Volume) candlestick data with optional timestamp.
Fields
open::Tprice: Opening price of the periodhigh::Tprice: Highest price during the periodlow::Tprice: Lowest price during the periodclose::Tprice: Closing price of the periodvolume::Tvol: Trading volume during the period (optional, defaults tomissing)time::Ttime: Timestamp of the candlestick (optional, defaults tomissing)
OnlineTechnicalIndicators.Candlesticks.OHLCVFactory — Type
OHLCVFactory{Ttime,Tprice,Tvol}Factory for creating multiple OHLCV candlesticks from vectors of price data.
Fields
open::Vector{Tprice}: Vector of opening priceshigh::Vector{Tprice}: Vector of high priceslow::Vector{Tprice}: Vector of low pricesclose::Vector{Tprice}: Vector of closing pricesvolume::Vector{Tvol}: Vector of volumes (optional)time::Vector{Ttime}: Vector of timestamps (optional)
Use Base.collect(factory) to generate a vector of OHLCV instances.
The ValueExtractor submodule provides helper functions for extracting values from candlesticks:
extract_open(candle)- Get the open priceextract_high(candle)- Get the high priceextract_low(candle)- Get the low priceextract_close(candle)- Get the close priceextract_volume(candle)- Get the volume
Internals Module
The Internals module contains internal utility functions used by indicator implementations. These are exposed for users who want to implement custom indicators.
OnlineTechnicalIndicators.Internals.is_multi_input — Function
is_multi_input(ind::Type{<:TechnicalIndicator}) -> BoolCheck if an indicator type requires OHLCV (multi-field) input data.
Returns false by default. Indicator submodules extend this for specific types.
OnlineTechnicalIndicators.Internals.is_multi_output — Function
is_multi_output(ind::Type{<:TechnicalIndicator}) -> BoolCheck if an indicator type produces multiple output values (e.g., MACD, Bollinger Bands).
Returns true if the indicator is a subtype of TechnicalIndicatorMultiOutput.
OnlineTechnicalIndicators.Internals.expected_return_type — Function
expected_return_type(ind::TechnicalIndicatorSingleOutput) -> TypeGet the expected return type for a single-output indicator instance.
expected_return_type(ind::TechnicalIndicatorMultiOutput) -> TypeGet the expected return type for a multi-output indicator instance.
For multi-output indicators, this returns the corresponding *Val type (e.g., MACDVal for MACD).
expected_return_type(IND::Type{<:TechnicalIndicatorMultiOutput}) -> TypeGet the expected return type for a multi-output indicator type.
OnlineTechnicalIndicators.Internals.has_output_value — Function
has_output_value(ind::OnlineStat) -> BoolCheck if an indicator has a valid (non-missing) output value.
has_output_value(cb::CircBuff) -> BoolCheck if a circular buffer has a valid (non-missing) last value.
OnlineTechnicalIndicators.Internals.has_valid_values — Function
has_valid_values(sequence::CircBuff, window; exact=false) -> BoolCheck if a circular buffer has enough valid (non-missing) values for a given window.
Arguments
sequence: The circular buffer to checkwindow: The required number of valid valuesexact: Iftrue, checks that exactlywindowvalues are valid (for initialization)
OnlineTechnicalIndicators.Internals.is_valid — Function
is_valid(x) -> BoolCheck if a value is valid (not missing).
Returns false for missing, true for any other value.
OnlineTechnicalIndicators.Internals.always_true — Function
always_true(x) -> BoolUtility function that always returns true. Used as default input filter.
OnlineTechnicalIndicators.Internals._calculate_new_value — Function
_calculate_new_value(ind)Calculate a new indicator value from internal state.
This is an abstract function that must be implemented by each indicator type.
OnlineTechnicalIndicators.Internals._calculate_new_value_only_from_incoming_data — Function
_calculate_new_value_only_from_incoming_data(ind, data)Calculate a new indicator value directly from incoming data (without using internal state).
This is an abstract function that must be implemented by indicators that don't maintain input history.
Internal Fit Implementation
The OnlineStatsBase._fit! method for TechnicalIndicator types is implemented in the Internals module. This function:
- Applies input filter and modifier (if present in legacy indicators)
- Updates the input values circular buffer (if present)
- Fits sub-indicators (if present)
- Calculates and stores the new indicator value
Wrappers Module
The Wrappers module contains wrapper/decorator types for composing indicators.
OnlineTechnicalIndicators.Indicators.Smoother — Type
Smoother(InnerType::Type{<:TechnicalIndicator}; period = SMOOTHER_PERIOD, ma = SMA, input_modifier_return_type = OHLCV{Missing,Float64,Float64})The Smoother type implements a generic smoothing wrapper that applies a moving average to any indicator's output.
Smoother wraps an inner indicator (e.g., TrueRange, IntradayRange, OBV) and applies a configurable moving average to smooth its output values. This provides a reusable pattern for creating "averaged" versions of indicators like ATR, ADR, ARDR, and SOBV.
Parameters
InnerType::Type{<:TechnicalIndicator}: The type of inner indicator to smooth (passed as first argument)period::Integer = 14: The number of periods for the moving averagema::Type = SMA: The moving average type to use (SMA, EMA, SMMA, WMA, etc.)input_modifier_return_type::Type = OHLCV{Missing,Float64,Float64}: Input OHLCV type
Formula
Smoother = MA(InnerIndicator, period)Input
OHLCV candlestick data compatible with the inner indicator's requirements.
Returns
Union{Missing,T} - The smoothed value, or missing during the warm-up period.
Examples
# Create a smoother that applies SMA(14) to TrueRange (similar to ATR with SMA)
smoother = Smoother(TrueRange; period=14, ma=SMA)
# Create a smoother that applies SMMA(14) to TrueRange (like standard ATR)
smoother = Smoother(TrueRange; period=14, ma=SMMA)
# Create a smoother for IntradayRange with EMA(10)
smoother = Smoother(IntradayRange; period=10, ma=EMA)
# Feed data
for candle in ohlcv_data
fit!(smoother, candle)
end
println(value(smoother))See also: ATR, ADR, ARDR, SOBV, TrueRange, IntradayRange, OBV
OnlineTechnicalIndicators.DAGWrapper — Type
DAGWrapperWrapper struct that integrates OnlineStatsChains.StatDAG with OnlineTechnicalIndicators' fit! infrastructure.
DAGWrapper allows composed indicators (like DEMA, TEMA, T3) to use StatDAG internally while maintaining compatibility with the standard OnlineStat fit! interface. When fit! is called on an indicator that uses DAGWrapper, data is automatically forwarded to the DAG's source node and propagated through all connected edges.
Fields
dag::StatDAG: The underlying OnlineStatsChains StatDAG that manages the indicator chainsource_node::Symbol: The entry point node where data is fed into the DAGstats::Vector{OnlineStat}: Vector of OnlineStats for compatibility checks with Series infrastructure
Usage Pattern
DAGWrapper is typically used internally by composed indicators:
using OnlineStatsChains
# Inside a composed indicator constructor (e.g., DEMA)
dag = StatDAG()
add_node!(dag, :ma1, EMA{Float64}(period=10))
add_node!(dag, :ma2, EMA{Float64}(period=10))
connect!(dag, :ma1, :ma2, filter = !ismissing)
# Wrap for compatibility with fit! infrastructure
sub_indicators = DAGWrapper(dag, :ma1, [dag.nodes[:ma1].stat])When fit!(indicator, data) is called on an indicator using DAGWrapper internally, data flows to the source node and automatically propagates through all filtered edges.
See also: Indicators.DEMA, Indicators.TEMA, Indicators.T3, Indicators.TRIX
Factories Module
The Factories module contains factory functions for creating indicator instances.
OnlineTechnicalIndicators.MovingAverage — Type
MovingAverageFactory for creating moving average indicators with a specific type parameter.
Fields
T::Type: The type parameter to use when constructing the moving average indicator
Usage
factory = MovingAverage(Float64)
ma = factory(SMA, period = 10) # Creates SMA{Float64}(period = 10)See also: Indicators.SMA, Indicators.EMA, Indicators.SMMA, Indicators.WMA, Indicators.DEMA, Indicators.TEMA, Indicators.KAMA, Indicators.HMA, Indicators.McGinleyDynamic
OnlineTechnicalIndicators.MAFactory — Type
MAFactoryDEPRECATED: Use MovingAverage instead.
MAFactory is a deprecated alias for MovingAverage. It is maintained for backward compatibility but will be removed in a future version.
Migration
# Old (deprecated):
factory = MAFactory(Float64)
# New (recommended):
factory = MovingAverage(Float64)Indicators (alphabetically ordered)
OnlineTechnicalIndicators.Indicators.ADR — Type
ADR{Tohlcv}(; period = ADR_PERIOD, ma = SMA, input_modifier_return_type = Tohlcv)The ADR type implements an Average Day Range indicator.
ADR measures the average absolute price range by calculating the moving average of IntradayRange (High - Low) over a specified period. Unlike ATR, ADR ignores gaps from the previous close, making it ideal for intraday volatility analysis.
Parameters
period::Integer = 14: The number of periods for averaging the Intraday Rangema::Type = SMA: The moving average type to use (default: Simple Moving Average)input_modifier_return_type::Type = Tohlcv: Input type (must be OHLCV-compatible)
Input
OHLCV candlestick data with high and low fields.
Formula
IntradayRange = High - Low
ADR = MA(IntradayRange, period)Returns
Union{Missing,T} - The average day range value, or missing during the warm-up period.
See also: Smoother, ARDR, IntradayRange, ATR, TrueRange, OHLCV
OnlineTechnicalIndicators.Indicators.ARDR — Type
ARDR{Tohlcv}(; period = ARDR_PERIOD, ma = SMA, input_modifier_return_type = Tohlcv)The ARDR type implements an Average Relative Day Range indicator.
ARDR measures the average percentage price range by calculating the moving average of RelativeIntradayRange ((High - Low) * 100 / Open) over a specified period. This enables cross-asset volatility comparison by normalizing the range as a percentage.
Parameters
period::Integer = 14: The number of periods for averaging the Relative Intraday Rangema::Type = SMA: The moving average type to use (default: Simple Moving Average)input_modifier_return_type::Type = Tohlcv: Input type (must be OHLCV-compatible)
Input
OHLCV candlestick data with open, high, and low fields.
Formula
RelativeIntradayRange = (High - Low) * 100 / Open
ARDR = MA(RelativeIntradayRange, period)Returns
Union{Missing,T} - The average relative day range as a percentage, or missing during the warm-up period. Bars with Open=0 are skipped in the average.
See also: Smoother, ADR, RelativeIntradayRange, ATR, NATR, OHLCV
OnlineTechnicalIndicators.Indicators.ADX — Type
ADX{Tohlcv}(; di_period = ADX_DI_PERIOD, adx_period = ADX_PERIOD, input_modifier_return_type = Tohlcv)The ADX type implements an Average Directional Index indicator.
ADX measures trend strength regardless of direction. Values above 25 suggest a strong trend, while values below 20 indicate a weak or non-trending market. The +DI and -DI lines show directional movement: +DI > -DI suggests uptrend, -DI > +DI suggests downtrend.
Parameters
di_period::Integer = 14: Period for directional indicator calculationadx_period::Integer = 14: Period for ADX smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
+DM = high - high_prev (if positive and > -DM, else 0)
-DM = low_prev - low (if positive and > +DM, else 0)
+DI = 100 × smoothed(+DM) / ATR
-DI = 100 × smoothed(-DM) / ATR
DX = 100 × |+DI - -DI| / (+DI + -DI)
ADX = smoothed(DX)Input
Requires OHLCV data with high, low, and close fields.
Output
ADXVal: Containsadx(trend strength 0-100),plus_di, andminus_di
Returns
Union{Missing,ADXVal} - The ADX values, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.ALMA — Type
ALMA{T}(; period = ALMA_PERIOD, offset = ALMA_OFFSET, sigma = ALMA_SIGMA, input_modifier_return_type = T)The ALMA type implements an Arnaud Legoux Moving Average indicator.
ALMA uses a Gaussian distribution to weight prices, providing a smooth moving average that can be tuned to emphasize either recent or older data. The offset parameter controls where the curve peaks (1 = recent, 0 = older), and sigma controls the width.
Parameters
period::Integer = 9: The number of periods for the moving averageoffset::Number = 0.85: Controls the Gaussian peak location (0 to 1, higher = more recent)sigma::Number = 6.0: Controls the Gaussian curve width (higher = smoother)input_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
m = floor((period - 1) × offset)
s = period / sigma
w[i] = exp(-((i - 1 - m)²) / (2 × s²))
ALMA = sum(price[i] × w[i]) / sum(w)Returns
Union{Missing,T} - The ALMA value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.AO — Type
AO{Tohlcv}(; fast_period = AO_FAST_PERIOD, slow_period = AO_SLOW_PERIOD, fast_ma = SMA, slow_ma = SMA, input_modifier_return_type = Tohlcv)The AO type implements an Awesome Oscillator indicator.
The Awesome Oscillator measures market momentum by comparing short-term momentum to long-term momentum. It uses the median price (high + low) / 2 and calculates the difference between a fast and slow moving average of this median price.
Parameters
fast_period::Integer = 3: The period for the fast moving averageslow_period::Integer = 21: The period for the slow moving averagefast_ma::Type = SMA: The moving average type for the fast periodslow_ma::Type = SMA: The moving average type for the slow periodinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Median Price = (high + low) / 2
AO = SMA(Median Price, fast_period) - SMA(Median Price, slow_period)Input
Requires OHLCV data with high and low fields.
Returns
Union{Missing,T} - The awesome oscillator value. Positive values indicate bullish momentum, negative values indicate bearish momentum. Returns missing during warm-up.
OnlineTechnicalIndicators.Indicators.ATR — Type
ATR{Tohlcv}(; period = ATR_PERIOD, ma = SMMA, input_modifier_return_type = Tohlcv)The ATR type implements an Average True Range indicator.
ATR measures market volatility by calculating the average of True Range values over a period. Developed by J. Welles Wilder Jr., it's commonly used for position sizing and stop-loss placement.
Parameters
period::Integer = 3: The number of periods for averaging the True Rangema::Type = SMMA: The moving average type to use (default: Smoothed Moving Average)input_modifier_return_type::Type = Tohlcv: Input type (must be OHLCV-compatible)
Input
OHLCV candlestick data with high, low, and close fields.
Formula
True Range = max(High - Low, |High - Close_prev|, |Low - Close_prev|)
ATR = MA(True Range, period)Returns
Union{Missing,T} - The average true range value, or missing during the warm-up period.
See also: Smoother, TrueRange, NATR, IntradayRange, RelativeIntradayRange, ADR, ARDR, OHLCV
OnlineTechnicalIndicators.Indicators.AccuDist — Type
AccuDist{Tohlcv}(; input_modifier_return_type = Tohlcv)The AccuDist type implements an Accumulation/Distribution Line (ADL) indicator.
The Accumulation/Distribution Line measures the cumulative flow of money into and out of a security. It uses the relationship between the close price and the trading range, weighted by volume. Rising ADL suggests accumulation (buying), falling ADL suggests distribution (selling).
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
MFI = ((close - low) - (high - close)) / (high - low) # Money Flow Multiplier
MFV = MFI × volume # Money Flow Volume
ADL = ADL_prev + MFV # Cumulative sumReturns previous value if high equals low (avoids division by zero).
Input
Requires OHLCV data with high, low, close, and volume fields.
Returns
Union{Missing,T} - The cumulative accumulation/distribution value. Available from the first observation.
See also: ChaikinOsc, OBV, ForceIndex, MFI
OnlineTechnicalIndicators.Indicators.Aroon — Type
Aroon{Tohlcv}(; period = Aroon_PERIOD, input_modifier_return_type = Tohlcv)The Aroon type implements an Aroon indicator.
The Aroon indicator measures the time since the most recent high and low within a period. It helps identify trend strength and potential reversals. Aroon Up near 100 indicates a strong uptrend (recent high), while Aroon Down near 100 indicates a strong downtrend.
Parameters
period::Integer = 10: The lookback period for the calculationinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Aroon Up = 100 × (period - days_since_high) / period
Aroon Down = 100 × (period - days_since_low) / periodInput
Requires OHLCV data with high and low fields.
Output
AroonVal: Containsupanddownvalues (0-100 scale)
Returns
Union{Missing,AroonVal} - The Aroon values, or missing during warm-up (first period observations).
OnlineTechnicalIndicators.Indicators.BB — Type
BB{T}(; period = BB_PERIOD, std_dev_mult = BB_STD_DEV_MULT, ma = SMA, input_modifier_return_type = T)The BB type implements a Bollinger Bands indicator.
Bollinger Bands consist of a middle band (moving average) with upper and lower bands at standard deviation intervals. They adapt to volatility: widening during volatile periods and contracting during calm periods. Price touching bands may signal reversals.
Parameters
period::Integer = 5: Period for the moving average and standard deviationstd_dev_mult::Number = 2.0: Multiplier for standard deviation bandsma::Type = SMA: Moving average type for central bandinput_modifier_return_type::Type = T: Output value type
Formula
Central = SMA(close, period)
Upper = Central + (std_dev_mult × StdDev(close, period))
Lower = Central - (std_dev_mult × StdDev(close, period))Output
BBVal: Containsupper,central, andlowerband values
Returns
Union{Missing,BBVal} - The band values, or missing during warm-up.
See also: KeltnerChannels, DonchianChannels, StdDev
OnlineTechnicalIndicators.Indicators.BOP — Type
BOP{Tohlcv}(; input_modifier_return_type = Tohlcv)The BOP type implements a Balance Of Power indicator.
Balance of Power measures the strength of buyers vs sellers by comparing the close relative to the open within the high-low range. Values near +1 indicate strong buying pressure (close near high), while values near -1 indicate strong selling pressure (close near low).
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
BOP = (close - open) / (high - low)Returns the previous value if high equals low (division by zero).
Input
Requires OHLCV data with open, high, low, and close fields.
Returns
Union{Missing,T} - The balance of power value in range [-1, 1]. Available from the first observation.
OnlineTechnicalIndicators.Indicators.CCI — Type
CCI{Tohlcv}(; period = CCI_PERIOD, input_modifier_return_type = Tohlcv)The CCI type implements a Commodity Channel Index.
CCI measures how far the current typical price deviates from its statistical mean. Developed by Donald Lambert, it's used to identify cyclical trends and overbought/oversold conditions.
Parameters
period::Integer = 3: The lookback period for the moving average and mean deviationinput_modifier_return_type::Type = Tohlcv: Input type (must be OHLCV-compatible)
Input
OHLCV candlestick data with high, low, and close fields.
Formula
Typical Price = (High + Low + Close) / 3
CCI = (Typical Price - SMA(Typical Price)) / (0.015 * Mean Deviation)The constant 0.015 ensures that approximately 70-80% of CCI values fall between -100 and +100.
Returns
Union{Missing,T} - The CCI value, or missing during the warm-up period. Values above +100 indicate overbought, below -100 indicate oversold.
OnlineTechnicalIndicators.Indicators.CHOP — Type
CHOP{Tohlcv}(; period = CHOP_PERIOD, input_modifier_return_type = Tohlcv)The CHOP type implements a Choppiness Index indicator.
The Choppiness Index measures whether the market is trending or trading sideways (choppy). Values near 100 indicate a very choppy, range-bound market, while values near 0 indicate a strong trend. The indicator is useful for timing trend-following strategies.
Parameters
period::Integer = 14: The number of periods for the calculationinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
CHOP = 100 × log10(sum(ATR, period) / (highest_high - lowest_low)) / log10(period)Input
Requires OHLCV data with high, low, and close fields.
Returns
Union{Missing,T} - The choppiness index value (0-100), or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.ChaikinOsc — Type
ChaikinOsc{Tohlcv}(; fast_period = ChaikinOsc_FAST_PERIOD, slow_period = ChaikinOsc_SLOW_PERIOD, fast_ma = EMA, slow_ma = EMA, input_modifier_return_type = Tohlcv)The ChaikinOsc type implements a Chaikin Oscillator.
The Chaikin Oscillator measures the momentum of the Accumulation/Distribution Line (ADL) by calculating the difference between fast and slow moving averages of the ADL. It helps identify buying or selling pressure in the market. Positive values suggest accumulation, negative values suggest distribution.
Parameters
fast_period::Integer = 5: Period for the fast moving averageslow_period::Integer = 7: Period for the slow moving averagefast_ma::Type = EMA: Moving average type for the fast periodslow_ma::Type = EMA: Moving average type for the slow periodinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
ChaikinOsc = EMA(AccuDist, fast_period) - EMA(AccuDist, slow_period)Input
Requires OHLCV data with high, low, close, and volume fields.
Returns
Union{Missing,T} - The Chaikin Oscillator value, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.ChandeKrollStop — Type
ChandeKrollStop{Tohlcv}(; atr_period = ChandeKrollStop_ATR_PERIOD, atr_mult = ChandeKrollStop_ATR_MULT, period = ChandeKrollStop_PERIOD, input_modifier_return_type = Tohlcv)The ChandeKrollStop type implements a Chande Kroll Stop indicator.
The Chande Kroll Stop is a volatility-based trailing stop indicator that adapts to market conditions using ATR. It calculates stop levels for both long and short positions, helping traders set protective stops that account for normal price fluctuations.
Parameters
atr_period::Integer = 5: Period for ATR calculationatr_mult::Number = 2.0: Multiplier for ATR (controls stop distance)period::Integer = 3: Period for stop level smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
High Stop = max(high, atr_period) - ATR × atr_mult
Low Stop = min(low, atr_period) + ATR × atr_mult
Short Stop = max(High Stop, period)
Long Stop = min(Low Stop, period)Input
Requires OHLCV data with high, low, and close fields.
Output
ChandeKrollStopVal: Containsshort_stopandlong_stoplevels
Returns
Union{Missing,ChandeKrollStopVal} - The stop levels, or missing during warm-up.
See also: ATR, SuperTrend, ParabolicSAR
OnlineTechnicalIndicators.Indicators.CoppockCurve — Type
CoppockCurve{T}(; fast_roc_period = CoppockCurve_FAST_ROC_PERIOD, slow_roc_period = CoppockCurve_SLOW_ROC_PERIOD, wma_period = CoppockCurve_WMA_PERIOD, input_modifier_return_type = T)The CoppockCurve type implements a Coppock Curve indicator.
The Coppock Curve is a long-term momentum indicator originally designed to identify major buying opportunities in stock market indices. It combines two Rate of Change indicators smoothed with a Weighted Moving Average. Buy signals occur when the curve crosses above zero.
Parameters
fast_roc_period::Integer = 11: Period for the fast ROCslow_roc_period::Integer = 14: Period for the slow ROCwma_period::Integer = 10: Period for the WMA smoothinginput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
CoppockCurve = WMA(ROC(fast_period) + ROC(slow_period), wma_period)Returns
Union{Missing,T} - The Coppock Curve value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.DEMA — Type
DEMA{T}(; period = DEMA_PERIOD, ma = EMA, input_modifier_return_type = T)The DEMA type implements a Double Exponential Moving Average indicator using OnlineStatsChains v0.2.0 with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges (v0.2.0 feature) to organize the 2-stage MA chain. Each connection uses filter = !ismissing to automatically skip missing values during propagation, eliminating the need for nested conditional logic.
The DAG structure provides:
- Clear organization of the 2-stage MA pipeline (:ma1 → :ma2)
- Automatic propagation through filtered edges
- Named access to each stage for debugging and inspection
- Clean separation of concerns (structure vs computation)
- Support for any moving average type via MovingAverage factory (EMA, SMA, WMA, etc.)
Benefits over manual chaining:
- No nested if statements for missing value handling
- No manual fit! calls in calculatenew_value
- Clear visualization of data flow
- Easier to modify (add/remove stages, change filters)
Formula
DEMA = 2 * MA1 - MA2 where MA1 is the MA of price and MA2 is the MA of MA1. The type of moving average (EMA, SMA, etc.) is specified by the ma parameter.
OnlineTechnicalIndicators.Indicators.DPO — Type
DPO{T}(; period = DPO_PERIOD, ma = SMA, input_modifier_return_type = T)The DPO type implements a Detrended Price Oscillator indicator.
DPO removes the trend from prices to help identify cycles and overbought/oversold levels. It compares a past price to a moving average, effectively filtering out longer-term trends and emphasizing shorter-term cycles.
Parameters
period::Integer = 20: The number of periods for the moving averagema::Type = SMA: The moving average type used for detrendinginput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
DPO = price[period/2 + 1 days ago] - SMA(price, period)The price is shifted back by (period/2 + 1) to align with the center of the moving average.
Returns
Union{Missing,T} - The detrended price oscillator value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.DonchianChannels — Type
DonchianChannels{Tohlcv}(; period = DonchianChannels_ATR_PERIOD, input_modifier_return_type = Tohlcv)The DonchianChannels type implements a Donchian Channels indicator.
Donchian Channels plot the highest high and lowest low over a period, with a central line at the midpoint. Breakouts above the upper channel signal potential uptrends, while breaks below the lower channel signal potential downtrends. Also known as price channels.
Parameters
period::Integer = 5: The lookback period for channel calculationinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Upper = highest_high(period)
Lower = lowest_low(period)
Central = (Upper + Lower) / 2Input
Requires OHLCV data with high and low fields.
Output
DonchianChannelsVal: Containsupper,central, andlowerchannel values
Returns
Union{Missing,DonchianChannelsVal} - The channel values, or missing during warm-up.
See also: KeltnerChannels, BB, GannHiloActivator
OnlineTechnicalIndicators.Indicators.EMA — Type
EMA{T}(; period = EMA_PERIOD, input_modifier_return_type = T)The EMA type implements an Exponential Moving Average indicator.
EMA gives more weight to recent prices, making it more responsive to new information than a simple moving average. The weighting decreases exponentially for older data points.
Parameters
period::Integer = 3: The number of periods for the EMA calculationinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
multiplier = 2 / (period + 1)
EMA = price * multiplier + EMA_prev * (1 - multiplier)The first EMA value is calculated as a simple average of the first period prices.
Returns
Union{Missing,T} - The exponential moving average value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.EMV — Type
EMV{Tohlcv}(; period = EMV_PERIOD, volume_div = EMV_VOLUME_DIV, ma = SMA, input_modifier_return_type = Tohlcv)The EMV type implements an Ease of Movement indicator.
EMV relates price change to volume, showing how easily a price can move. High positive values indicate the price is moving up on low volume (easy upward movement), while high negative values indicate easy downward movement. The indicator is smoothed with a moving average.
Parameters
period::Integer = 20: The number of periods for the moving average smoothingvolume_div::Integer = 10000: Divisor for volume normalization (typically 10000)ma::Type = SMA: The moving average type used for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Distance = ((high + low) / 2) - ((high_prev + low_prev) / 2)
Box Ratio = (volume / volume_div) / (high - low)
EMV = MA(Distance / Box Ratio, period)Input
Requires OHLCV data with high, low, and volume fields.
Returns
Union{Missing,T} - The smoothed ease of movement value, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.ForceIndex — Type
ForceIndex{Tohlcv}(; period = ForceIndex_PERIOD, ma = EMA, input_modifier_return_type = Tohlcv)The ForceIndex type implements a Force Index indicator.
The Force Index combines price change and volume to measure the strength behind price movements. Large positive values indicate strong buying pressure, while large negative values indicate strong selling pressure. The raw values are smoothed with a moving average.
Parameters
period::Integer = 3: The period for the moving average smoothingma::Type = EMA: The moving average type used for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Raw Force = (close - close_prev) × volume
Force Index = MA(Raw Force, period)Input
Requires OHLCV data with close and volume fields.
Returns
Union{Missing,T} - The smoothed force index value, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.GannHiloActivator — Type
GannHiloActivator{Tohlcv}(; period = GANN_HILO_PERIOD, input_modifier_return_type = Tohlcv)The GannHiloActivator type implements a Gann HiLo Activator indicator.
The Gann HiLo Activator helps identify trend direction and potential entry/exit points. It calculates simple moving averages of the highest highs and lowest lows over a period. When price closes above the high line, it signals an uptrend; below the low line signals a downtrend.
Parameters
period::Integer = 14: The lookback period for calculating highs/lowsinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Highest High = max(high, period)
Lowest Low = min(low, period)
High Line = SMA(Highest High, period)
Low Line = SMA(Lowest Low, period)Input
Requires OHLCV data with high and low fields.
Output
GannHiloActivatorVal: Containshigh(resistance) andlow(support) values
Returns
Union{Missing,GannHiloActivatorVal} - The high and low lines, or missing during warm-up.
See also: SMA, DonchianChannels, SuperTrend
OnlineTechnicalIndicators.Indicators.GannSwingChart — Type
GannSwingChart{T}(; min_bars=GANN_SWING_MIN_BARS, input_modifier_return_type = T)The GannSwingChart type implements Gann Swing Chart analysis for trend detection.
This indicator identifies:
- Upswings: Two consecutive higher highs
- Downswings: Two consecutive lower lows
- Trend changes: When prices break previous swing peaks/valleys
Parameters
min_bars: Minimum number of bars to confirm a swing (default: 2)
Output
GannSwingChartVal: Contains trend state, swing levels, and change signals
OnlineTechnicalIndicators.Indicators.HMA — Type
HMA{T}(; period = HMA_PERIOD, input_modifier_return_type = T)The HMA type implements a Hull Moving Average indicator.
HMA was developed by Alan Hull to reduce lag while maintaining smoothness. It combines multiple WMAs at different periods to achieve this goal, using square root of period for the final smoothing.
Parameters
period::Integer = 20: The base period for the Hull Moving Averageinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
WMA1 = WMA(price, period)
WMA2 = WMA(price, period/2)
Raw_HMA = 2 * WMA2 - WMA1
HMA = WMA(Raw_HMA, sqrt(period))Returns
Union{Missing,T} - The Hull Moving Average value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.IntradayRange — Type
IntradayRange{Tohlcv}(; input_modifier_return_type = Tohlcv)The IntradayRange type implements an Intraday Range indicator.
Intraday Range measures the absolute price range within a single bar, calculated as the difference between the high and low prices. Unlike True Range, it does not consider gaps from the previous close, making it ideal for intraday analysis where overnight gaps are not relevant.
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type (must havehighandlowfields)
Formula
IntradayRange = High - LowInput
Requires OHLCV data with high and low fields.
Returns
Union{Missing,T} - The absolute bar range. Available from the first observation (no warm-up).
See also: RelativeIntradayRange, ADR, TrueRange, ATR
OnlineTechnicalIndicators.Indicators.KAMA — Type
KAMA{T}(; period = KAMA_PERIOD, fast_ema_constant_period = KAMA_FAST_EMA_CONSTANT_PERIOD, slow_ema_constant_period = KAMA_SLOW_EMA_CONSTANT_PERIOD, input_modifier_return_type = T)The KAMA type implements Kaufman's Adaptive Moving Average indicator.
KAMA adapts its smoothing based on market volatility using an Efficiency Ratio (ER). In trending markets (high ER), it moves quickly like a fast EMA. In sideways markets (low ER), it moves slowly like a slow EMA.
Parameters
period::Integer = 14: The lookback period for the efficiency ratio calculationfast_ema_constant_period::Integer = 2: Period for fast EMA smoothing constantslow_ema_constant_period::Integer = 30: Period for slow EMA smoothing constantinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
ER = |Price_change| / Σ|Price_i - Price_{i-1}| (Efficiency Ratio)
SC = (ER * (fast_SC - slow_SC) + slow_SC)² (Smoothing Constant)
KAMA = KAMA_prev + SC * (Price - KAMA_prev)Returns
Union{Missing,T} - The adaptive moving average value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.KST — Type
KST{T}(;
roc1_period = KST_ROC1_PERIOD,
roc1_ma_period = KST_ROC1_MA_PERIOD,
roc2_period = KST_ROC2_PERIOD,
roc2_ma_period = KST_ROC2_MA_PERIOD,
roc3_period = KST_ROC3_PERIOD,
roc3_ma_period = KST_ROC3_MA_PERIOD,
roc4_period = KST_ROC4_PERIOD,
roc4_ma_period = KST_ROC4_MA_PERIOD,
signal_period = KST_SIGNAL_PERIOD,
ma = SMA,
input_modifier_return_type = T
)The KST type implements Know Sure Thing indicator using OnlineStatsChains with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges to organize 4 parallel ROC→MA chains. Each chain computes ROC at different periods, then smooths with a moving average.
The DAG structure provides:
- Clear organization of 4 parallel ROC→MA pipelines
- Automatic propagation through filtered edges
- Named access to each stage for debugging
Formula
KST = 1ROC1_MA + 2ROC2MA + 3*ROC3MA + 4*ROC4MA Signal = MA(KST, signalperiod)
Output
KSTVal: A value containingkstandsignalvalues
OnlineTechnicalIndicators.Indicators.KVO — Type
KVO{Tohlcv}(; fast_period = KVO_FAST_PERIOD, slow_period = KVO_SLOW_PERIOD, ma = EMA, input_modifier_return_type = Tohlcv)The KVO type implements a Klinger Volume Oscillator.
The Klinger Volume Oscillator measures the long-term trend of money flow while remaining sensitive to short-term fluctuations. It uses volume and price to determine if money is flowing into or out of a security. Crossovers of the fast and slow EMAs generate signals.
Parameters
fast_period::Integer = 5: Period for the fast moving averageslow_period::Integer = 10: Period for the slow moving averagema::Type = EMA: Moving average type used for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
HLC = high + low + close
Trend = +1 if HLC > HLC_prev, -1 otherwise
dm = high - low
cm = dm + cm_prev (if trend unchanged) or dm + dm_prev (if trend changes)
VF = volume × |2 × (dm/cm) - 1| × trend × 100
KVO = EMA(VF, fast_period) - EMA(VF, slow_period)Input
Requires OHLCV data with high, low, close, and volume fields.
Returns
Union{Missing,T} - The Klinger Volume Oscillator value, or missing during warm-up.
See also: OBV, ChaikinOsc, ForceIndex
OnlineTechnicalIndicators.Indicators.KeltnerChannels — Type
KeltnerChannels{Tohlcv}(; ma_period = KeltnerChannels_MA_PERIOD, atr_period = KeltnerChannels_ATR_PERIOD, atr_mult_up = KeltnerChannels_ATR_MULT_UP, atr_mult_down = KeltnerChannels_ATR_MULT_DOWN, ma = EMA, input_modifier_return_type = Tohlcv)The KeltnerChannels type implements a Keltner Channels indicator.
Keltner Channels are volatility-based envelopes set above and below a moving average. They use ATR to determine channel width. Price touching the upper channel suggests overbought conditions, while touching the lower channel suggests oversold conditions.
Parameters
ma_period::Integer = 10: Period for the central moving averageatr_period::Integer = 10: Period for ATR calculationatr_mult_up::Number = 2.0: ATR multiplier for upper channelatr_mult_down::Number = 3.0: ATR multiplier for lower channelma::Type = EMA: Moving average type for central bandinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Central = EMA(close, ma_period)
Upper = Central + (atr_mult_up × ATR)
Lower = Central - (atr_mult_down × ATR)Input
Requires OHLCV data with high, low, and close fields.
Output
KeltnerChannelsVal: Containsupper,central, andlowerchannel values
Returns
Union{Missing,KeltnerChannelsVal} - The channel values, or missing during warm-up.
See also: BB, DonchianChannels, ATR
OnlineTechnicalIndicators.Indicators.MACD — Type
MACD{T}(; fast_period = MACD_FAST_PERIOD, slow_period = MACD_SLOW_PERIOD, signal_period = MACD_SIGNAL_PERIOD, ma = EMA, input_modifier_return_type = T)The MACD type implements a Moving Average Convergence Divergence indicator.
MACD shows the relationship between two moving averages. The MACD line crossing above the signal line is a bullish signal, while crossing below is bearish. The histogram visualizes the difference between MACD and signal for easier trend identification.
Parameters
fast_period::Integer = 12: Period for the fast moving averageslow_period::Integer = 26: Period for the slow moving averagesignal_period::Integer = 9: Period for the signal linema::Type = EMA: Moving average type (typically EMA)input_modifier_return_type::Type = T: Output value type
Formula
MACD Line = EMA(fast_period) - EMA(slow_period)
Signal Line = EMA(MACD Line, signal_period)
Histogram = MACD Line - Signal LineOutput
MACDVal: Containsmacd,signal, andhistogramvalues
Returns
Union{Missing,MACDVal} - The MACD values, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.MassIndex — Type
MassIndex{Tohlcv}(; ma_period = MassIndex_MA_PERIOD, ma_ma_period = MassIndex_MA_MA_PERIOD, ma_ratio_period = MassIndex_MA_RATIO_PERIOD, ma = EMA, input_modifier_return_type = Tohlcv)The MassIndex type implements a Mass Index indicator.
The Mass Index identifies potential reversals by measuring the range between high and low prices. It looks for "reversal bulges" where the index rises above 27 and then falls below 26.5, which often precedes a price reversal regardless of direction.
Parameters
ma_period::Integer = 9: Period for the first EMA of the high-low rangema_ma_period::Integer = 9: Period for the second EMA (of the first EMA)ma_ratio_period::Integer = 10: Period to sum the EMA ratioma::Type = EMA: Moving average type used for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Single EMA = EMA(high - low, ma_period)
Double EMA = EMA(Single EMA, ma_ma_period)
EMA Ratio = Single EMA / Double EMA
Mass Index = sum(EMA Ratio, ma_ratio_period)Input
Requires OHLCV data with high and low fields.
Returns
Union{Missing,T} - The Mass Index value, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.McGinleyDynamic — Type
McGinleyDynamic{T}(; period = McGinleyDynamic_PERIOD, input_modifier_return_type = T)The McGinleyDynamic type implements a McGinley Dynamic indicator.
The McGinley Dynamic is an adaptive moving average that automatically adjusts its speed based on market volatility. It speeds up in trending markets and slows down in ranging markets, reducing whipsaws compared to traditional moving averages.
Parameters
period::Integer = 14: The base period for the calculationinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
MD = MD_prev + (price - MD_prev) / (period × (price / MD_prev)^4)The first value is calculated as a simple average of the first period prices.
Returns
Union{Missing,T} - The McGinley Dynamic value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.MeanDev — Type
MeanDev{T}(; period = MeanDev_PERIOD, ma = SMA, input_modifier_return_type = T)The MeanDev type implements a Mean Deviation indicator.
Mean Deviation (also called Mean Absolute Deviation) measures the average distance of data points from their mean. It's a measure of dispersion similar to standard deviation but uses absolute values instead of squares.
Parameters
period::Integer = 3: The lookback period for the calculationma::Type = SMA: The moving average type to use for the meaninput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
MeanDev = Σ|price_i - MA(price)| / period
Returns
Union{Missing,T} - The mean deviation value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.MFI — Type
MFI{Tohlcv}(; period = MFI_PERIOD, input_modifier_return_type = Tohlcv)The MFI type implements a Money Flow Index indicator.
The Money Flow Index (MFI) is a momentum oscillator that measures the flow of money into and out of a security over a specified period of time. It is related to the Relative Strength Index (RSI) but incorporates volume, making it a volume-weighted RSI. Values above 80 indicate overbought conditions, below 20 indicate oversold.
Parameters
period::Integer = 14: The lookback period for calculating money flow sumsinput_modifier_return_type::Type = Tohlcv: Input OHLCV type (must havehigh,low,close,volumefields)
Formula
Typical Price (TP) = (High + Low + Close) / 3
Raw Money Flow = TP × Volume
If TP > TP_prev: Positive Money Flow = Raw Money Flow
If TP < TP_prev: Negative Money Flow = Raw Money Flow
If TP = TP_prev: No contribution (neutral)
Money Flow Ratio = Sum(Positive MF, period) / Sum(Negative MF, period)
MFI = 100 - (100 / (1 + Money Flow Ratio))Input
Requires OHLCV data with high, low, close, and volume fields.
Returns
Union{Missing,T} - The MFI value (0-100), or missing during warm-up (first period observations).
See also: RSI, OBV, AccuDist, ChaikinOsc
OnlineTechnicalIndicators.Indicators.NATR — Type
NATR{Tohlcv}(; period = ATR_PERIOD, ma = SMMA, input_modifier_return_type = Tohlcv)The NATR type implements a Normalized Average True Range indicator.
NATR expresses the Average True Range as a percentage of the closing price, making it easier to compare volatility across different securities regardless of their price levels. Higher NATR values indicate higher volatility relative to the price.
Parameters
period::Integer = 3: The number of periods for the ATR calculationma::Type = SMMA: The moving average type used for smoothing (default is Wilder's SMMA)input_modifier_return_type::Type = Tohlcv: Input OHLCV type (must havehigh,low,closefields)
Formula
NATR = (ATR / close) × 100Input
Requires OHLCV data with high, low, and close fields.
Returns
Union{Missing,T} - The normalized ATR as a percentage, or missing during the warm-up period (first period - 1 observations). Returns missing if close price is zero.
OnlineTechnicalIndicators.Indicators.OBV — Type
OBV{Tohlcv}(; input_modifier_return_type = Tohlcv)The OBV type implements an On Balance Volume indicator.
OBV is 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, creating a cumulative total that can confirm price trends or warn of potential reversals.
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type (must havecloseandvolumefields)
Formula
If close > close_prev: OBV = OBV_prev + volume
If close < close_prev: OBV = OBV_prev - volume
If close = close_prev: OBV = OBV_prevInput
Requires OHLCV data with close and volume fields.
Returns
Union{Missing,T} - The cumulative on-balance volume value. Available from the first observation.
See also: SOBV, AccuDist, ChaikinOsc, MFI
OnlineTechnicalIndicators.Indicators.ParabolicSAR — Type
ParabolicSAR{Tohlcv}(; init_accel_factor = ParabolicSAR_INIT_ACCEL_FACTOR, accel_factor_inc = ParabolicSAR_ACCEL_FACTOR_INC, max_accel_factor = ParabolicSAR_MAX_ACCEL_FACTOR, input_modifier_return_type = Tohlcv)The ParabolicSAR type implements a Parabolic Stop and Reverse indicator.
Parabolic SAR provides potential entry and exit points by trailing price with an accelerating curve. The SAR value acts as a trailing stop: below price in uptrends (support) and above price in downtrends (resistance). When price crosses SAR, trend reverses.
Parameters
init_accel_factor::Number = 0.02: Initial acceleration factoraccel_factor_inc::Number = 0.02: AF increment on new extrememax_accel_factor::Number = 0.2: Maximum acceleration factorinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
SAR = SAR_prev + AF × (EP - SAR_prev)
AF increases by accel_factor_inc each time EP updates (capped at max_accel_factor)
EP = highest high (uptrend) or lowest low (downtrend)Trend reverses when price crosses SAR.
Input
Requires OHLCV data with high and low fields.
Output
ParabolicSARVal: Containsvalue(SAR level),trend(UP/DOWN),ep, andaccel_factor
Returns
Union{Missing,ParabolicSARVal} - The SAR values, or missing during initialization.
See also: SuperTrend, ChandeKrollStop, ATR
OnlineTechnicalIndicators.Indicators.PeakValleyDetector — Type
PeakValleyDetector{T}(; lookback=PEAK_VALLEY_LOOKBACK, input_modifier_return_type = T)The PeakValleyDetector type identifies significant peaks and valleys in price data.
This indicator detects:
- Peaks: Local high points where price is higher than surrounding bars
- Valleys: Local low points where price is lower than surrounding bars
- Support/Resistance levels based on these peaks and valleys
Parameters
lookback: Number of bars to look back/forward for peak/valley confirmation (default: 5)
Output
PeakValleyVal: Contains peak/valley levels and detection signals
Implements REQ-003: Identify peaks and valleys of each swing
OnlineTechnicalIndicators.Indicators.PivotsHL — Type
PivotsHL{Tohlcv}(; high_period = PivotsHL_HIGH_PERIOD, low_period = PivotsHL_LOW_PERIOD, memory = PivotsHL_MEMORY, input_modifier_return_type = Tohlcv)The PivotsHL type implements a High/Low Pivots indicator.
PivotsHL identifies significant high and low pivot points in price data. A pivot high occurs when price makes a local maximum, and a pivot low occurs when price makes a local minimum within the lookback period.
Parameters
high_period::Integer = 7: Lookback period for identifying pivot highslow_period::Integer = 7: Lookback period for identifying pivot lowsmemory::Integer = 3: Number of pivot points to storeinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Input
Requires OHLCV data with high and low fields.
Output
PivotsHLVal: Containsohlcv(data at pivot),type(HIGH/LOW),isnew(Bool)
Returns
Always returns missing (pivot values stored in output_values CircBuff). Use has_output_value(ind) to check if pivots exist and access via ind.output_values.
See also: DonchianChannels, SuperTrend
OnlineTechnicalIndicators.Indicators.RelativeIntradayRange — Type
RelativeIntradayRange{Tohlcv}(; input_modifier_return_type = Tohlcv)The RelativeIntradayRange type implements a Relative Intraday Range indicator.
Relative Intraday Range measures the percentage price range within a single bar, calculated as the absolute range divided by the open price, expressed as a percentage. This allows comparison of volatility across assets with different price levels.
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type (must haveopen,high, andlowfields)
Formula
RelativeIntradayRange = (High - Low) * 100 / OpenInput
Requires OHLCV data with open, high, and low fields.
Returns
Union{Missing,T} - The percentage bar range. Returns missing if Open is zero. Available from the first observation (no warm-up).
See also: IntradayRange, ARDR, TrueRange, ATR, NATR
OnlineTechnicalIndicators.Indicators.ROC — Type
ROC{T}(; period = ROC_PERIOD, input_modifier_return_type = T)The ROC type implements a Rate Of Change indicator.
ROC measures the percentage change in price between the current price and the price period bars ago. It oscillates above and below zero, indicating bullish or bearish momentum.
Parameters
period::Integer = 3: The lookback period for calculating the rate of changeinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
ROC = 100 * (current_price - price_n_periods_ago) / price_n_periods_ago
Returns
Union{Missing,T} - Rate of change as a percentage, or missing during the warm-up period (first period observations).
OnlineTechnicalIndicators.Indicators.RSI — Type
RSI{T}(; period = RSI_PERIOD, input_modifier_return_type = T)The RSI type implements a Relative Strength Index indicator.
RSI is a momentum oscillator that measures the speed and magnitude of recent price changes to evaluate overbought or oversold conditions. Developed by J. Welles Wilder Jr.
Parameters
period::Integer = 3: The lookback period for calculating average gains and lossesinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
RS = Average Gain / Average Loss
RSI = 100 - (100 / (1 + RS))where Average Gain and Average Loss are calculated using SMMA (Smoothed Moving Average).
Returns
Union{Missing,T} - RSI value between 0 and 100, or missing during the warm-up period. Values above 70 typically indicate overbought conditions, below 30 indicate oversold.
OnlineTechnicalIndicators.Indicators.RetracementCalculator — Type
RetracementCalculator{T}(; retracement_pct=0.38, input_modifier_return_type = T)The RetracementCalculator type calculates retracement levels for swing trading.
This indicator calculates:
- 38% retracement levels for both long and short positions
- Current retracement percentage from swing peaks/valleys
- Signals when specific retracement levels are hit
Parameters
retracement_pct: Retracement percentage to calculate (default: 0.38 for 38%)
Output
RetracementVal: Contains retracement levels and hit signals
Implements REQ-310 to REQ-313: Calculate and monitor 38% retracement levels
OnlineTechnicalIndicators.Indicators.SFX — Type
SFX{Tohlcv}(; atr_period = SFX_ATR_PERIOD, std_dev_period = SFX_STD_DEV_PERIOD, std_dev_smoothing_period = SFX_STD_DEV_SMOOTHING_PERIOD, ma = SMA, input_modifier_return_type = Tohlcv)The SFX type implements an SFX (Smoothed Forex) volatility indicator.
SFX combines Average True Range with standard deviation to measure market volatility. Comparing ATR to smoothed standard deviation helps identify when volatility is expanding or contracting, useful for timing entries and setting stop losses.
Parameters
atr_period::Integer = 12: Period for ATR calculationstd_dev_period::Integer = 12: Period for standard deviationstd_dev_smoothing_period::Integer = 3: Period for smoothing std devma::Type = SMA: Moving average type for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
ATR = Average True Range over atr_period
StdDev = Standard Deviation of close over std_dev_period
MA_StdDev = SMA(StdDev, std_dev_smoothing_period)Input
Requires OHLCV data with high, low, and close fields.
Output
SFXVal: Containsatr,std_dev, andma_std_devvalues
Returns
Union{Missing,SFXVal} - The SFX values. std_dev available early, others after warm-up.
OnlineTechnicalIndicators.Indicators.SMA — Type
SMA{T}(; period = SMA_PERIOD, input_modifier_return_type = T)The SMA type implements a Simple Moving Average indicator.
SMA calculates the arithmetic mean of prices over a specified period. It gives equal weight to all prices in the period, providing a smooth representation of price trends.
Parameters
period::Integer = 3: The number of periods for the moving averageinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
SMA = (P1 + P2 + ... + Pn) / n
where n is the period and P1...Pn are the prices in the window.
Returns
Union{Missing,T} - The simple moving average value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.SMMA — Type
SMMA{T}(; period = SMMA_PERIOD, input_modifier_return_type = T)The SMMA type implements a Smoothed Moving Average indicator.
SMMA (also known as Wilder's Moving Average or Modified Moving Average) applies more smoothing than EMA, making it less reactive to price changes. It's commonly used in indicators like RSI and ATR.
Parameters
period::Integer = 3: The number of periods for the smoothed averageinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
SMMA = (SMMA_prev * (period - 1) + price) / periodThe first SMMA value is calculated as a simple average of the first period prices.
Returns
Union{Missing,T} - The smoothed moving average value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.SOBV — Type
SOBV{Tohlcv}(; period = SOBV_PERIOD, ma = SMA, input_modifier_return_type = Tohlcv)The SOBV type implements a Smoothed On Balance Volume indicator.
SOBV applies a moving average to the On Balance Volume (OBV) indicator, reducing noise and making the trend clearer. This helps filter out short-term fluctuations in the cumulative volume measure.
Parameters
period::Integer = 20: The number of periods for smoothing the OBVma::Type = SMA: The moving average type used for smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
SOBV = MA(OBV, period)Where OBV is the On Balance Volume indicator.
Input
Requires OHLCV data with close and volume fields.
Returns
Union{Missing,T} - The smoothed on-balance volume value, or missing during the warm-up period (first period - 1 observations after OBV becomes available).
OnlineTechnicalIndicators.Indicators.STC — Type
STC{T}(; fast_macd_period = STC_FAST_MACD_PERIOD, slow_macd_period = STC_SLOW_MACD_PERIOD, stoch_period = STC_STOCH_PERIOD, stoch_smoothing_period = STC_STOCH_SMOOTHING_PERIOD, ma = SMA, input_modifier_return_type = T)The STC type implements a Schaff Trend Cycle indicator.
STC combines MACD with double Stochastic smoothing to identify cyclical trends. It oscillates between 0 and 100, with values above 75 indicating overbought conditions and below 25 indicating oversold conditions. It often leads price reversals.
Parameters
fast_macd_period::Integer = 5: Fast EMA period for MACDslow_macd_period::Integer = 10: Slow EMA period for MACDstoch_period::Integer = 10: Lookback period for Stochasticstoch_smoothing_period::Integer = 3: Smoothing for Stochastic %Dma::Type = SMA: Moving average type for Stochastic smoothinginput_modifier_return_type::Type = T: Output value type
Formula
1. MACD = EMA(fast) - EMA(slow)
2. Stoch1 = Stochastic(MACD)
3. Stoch2 = Stochastic(Stoch1.%D)
4. STC = clamp(Stoch2.%D, 0, 100)Returns
Union{Missing,T} - The STC value (0-100), or missing during warm-up.
OnlineTechnicalIndicators.Indicators.StdDev — Type
StdDev{T}(; period = StdDev_PERIOD, input_modifier_return_type = T)The StdDev type implements a Standard Deviation indicator.
Standard Deviation measures the dispersion of data points from their mean. Higher values indicate greater volatility. Often used with Bollinger Bands.
Parameters
period::Integer = 3: The lookback period for the calculationinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
StdDev = sqrt(Σ(price_i - mean)² / period)
This is the population standard deviation (divides by n, not n-1).
Returns
Union{Missing,T} - The standard deviation value, or missing during the warm-up period.
OnlineTechnicalIndicators.Indicators.Stoch — Type
Stoch{Tohlcv}(; period = STOCH_PERIOD, smoothing_period = STOCH_SMOOTHING_PERIOD, ma = SMA, input_modifier_return_type = Tohlcv)The Stoch type implements the Stochastic Oscillator indicator.
The Stochastic Oscillator compares a security's closing price to its price range over a given period. It generates values between 0 and 100, where readings above 80 indicate overbought conditions and below 20 indicate oversold conditions.
Parameters
period::Integer = 14: The lookback period for high/low rangesmoothing_period::Integer = 3: Period for %D line smoothingma::Type = SMA: Moving average type for %D smoothinginput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
%K = 100 × (close - lowest_low) / (highest_high - lowest_low)
%D = SMA(%K, smoothing_period)Input
Requires OHLCV data with high, low, and close fields.
Output
StochVal: Containsk(%K fast line) andd(%D slow line) values
Returns
Union{Missing,StochVal} - The stochastic values, available from the first observation (%D becomes available after smoothing_period observations).
OnlineTechnicalIndicators.Indicators.StochRSI — Type
StochRSI{T}(; rsi_period = StochRSI_RSI_PERIOD, stoch_period = StochRSI_STOCH_PERIOD, k_smoothing_period = StochRSI_K_SMOOTHING_PERIOD, d_smoothing_period = StochRSI_D_SMOOTHING_PERIOD, ma = SMA, input_modifier_return_type = Tval)The StochRSI type implements Stochastic RSI indicator using OnlineStatsChains with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges to organize the smoothing chain: smoothedk → valuesd
The RSI is computed separately and the stochastic oscillator is applied to it, then the result goes through a 2-stage smoothing process.
Formula
RSI = RSI(price, rsiperiod) K = 100 * (RSI - min(RSI, stochperiod)) / (max(RSI, stochperiod) - min(RSI, stochperiod)) smoothedK = MA(K, ksmoothingperiod) D = MA(smoothedK, dsmoothingperiod)
Output
StochRSIVal: A value containingkanddvalues
OnlineTechnicalIndicators.Indicators.SuperTrend — Type
SuperTrend{Tohlcv}(; atr_period = SuperTrend_ATR_PERIOD, mult = SuperTrend_MULT, input_modifier_return_type = Tohlcv)The SuperTrend type implements a Super Trend indicator.
SuperTrend is a trend-following indicator that uses ATR to create dynamic support and resistance levels. It flips between acting as support (in uptrends) and resistance (in downtrends), making it useful for trailing stops and trend identification.
Parameters
atr_period::Integer = 10: Period for ATR calculationmult::Integer = 3: ATR multiplier for band widthinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
HLA = (high + low) / 2
Upper Band = HLA + (mult × ATR)
Lower Band = HLA - (mult × ATR)
SuperTrend = Lower Band (in uptrend) or Upper Band (in downtrend)The indicator switches bands when price crosses through.
Input
Requires OHLCV data with high, low, and close fields.
Output
SuperTrendVal: Containsvalue(the SuperTrend level) andtrend(UP or DOWN)
Returns
Union{Missing,SuperTrendVal} - The SuperTrend value and direction, or missing during warm-up.
See also: ATR, ParabolicSAR, ChandeKrollStop
OnlineTechnicalIndicators.Indicators.SupportResistanceLevel — Type
SupportResistanceLevel{T}(; input_modifier_return_type = T)The SupportResistanceLevel type calculates and monitors support and resistance levels.
This indicator tracks:
- Support levels from previous swing valleys
- Resistance levels from previous swing peaks
- Break signals when price penetrates these levels
Output
SupportResistanceLevelVal: Contains S/R levels and break signals
Implements REQ-040 to REQ-043: Support/Resistance level calculation and monitoring
OnlineTechnicalIndicators.Indicators.T3 — Type
T3{T}(; period = T3_PERIOD, factor = T3_FACTOR, ma = EMA, input_modifier_return_type = T)The T3 type implements a T3 Moving Average indicator using OnlineStatsChains v0.2.0 with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges (v0.2.0 feature) to organize the 6-stage MA chain. Each connection uses filter = !ismissing to automatically skip missing values during propagation, eliminating the need for nested conditional logic.
The DAG structure provides:
- Clear organization of the 6-stage MA pipeline (:ma1 → :ma2 → ... → :ma6)
- Automatic propagation through filtered edges
- Named access to each stage for debugging and inspection
- Clean separation of concerns (structure vs computation)
- Support for any moving average type via MovingAverage factory (EMA, SMA, WMA, etc.)
Benefits over manual chaining:
- No nested if statements for missing value handling
- No manual fit! calls in calculatenew_value
- Clear visualization of data flow
- Easier to modify (add/remove stages, change filters)
OnlineTechnicalIndicators.Indicators.TEMA — Type
TEMA{T}(; period = TEMA_PERIOD, ma = EMA, input_modifier_return_type = T)The TEMA type implements a Triple Exponential Moving Average indicator using OnlineStatsChains v0.2.0 with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges (v0.2.0 feature) to organize the 3-stage MA chain. Each connection uses filter = !ismissing to automatically skip missing values during propagation, eliminating the need for nested conditional logic.
The DAG structure provides:
- Clear organization of the 3-stage MA pipeline (:ma1 → :ma2 → :ma3)
- Automatic propagation through filtered edges
- Named access to each stage for debugging and inspection
- Clean separation of concerns (structure vs computation)
- Support for any moving average type via MovingAverage factory (EMA, SMA, WMA, etc.)
Benefits over manual chaining:
- No nested if statements for missing value handling
- No manual fit! calls in calculatenew_value
- Clear visualization of data flow
- Easier to modify (add/remove stages, change filters)
Formula
TEMA = 3 * MA1 - 3 * MA2 + MA3 where MA1 is the MA of price, MA2 is the MA of MA1, and MA3 is the MA of MA2. The type of moving average (EMA, SMA, etc.) is specified by the ma parameter.
OnlineTechnicalIndicators.Indicators.TRIX — Type
TRIX{T}(; period = TRIX_PERIOD, ma = EMA, input_modifier_return_type = T)The TRIX type implements a TRIX Moving Average indicator using OnlineStatsChains v0.2.0 with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges (v0.2.0 feature) to organize the 3-stage MA chain. Each connection uses filter = !ismissing to automatically skip missing values during propagation, eliminating the need for nested conditional logic.
The DAG structure provides:
- Clear organization of the 3-stage MA pipeline (:ma1 → :ma2 → :ma3)
- Automatic propagation through filtered edges
- Named access to each stage for debugging and inspection
- Clean separation of concerns (structure vs computation)
- Support for any moving average type via MovingAverage factory (EMA, SMA, WMA, etc.)
Benefits over manual chaining:
- No nested if statements for missing value handling
- No manual fit! calls in calculatenew_value
- Clear visualization of data flow
- Easier to modify (add/remove stages, change filters)
Formula
TRIX = 10000 * (MA3current - MA3previous) / MA3_previous where MA1 is the MA of price, MA2 is the MA of MA1, and MA3 is the MA of MA2. The type of moving average (EMA, SMA, etc.) is specified by the ma parameter. The result is expressed as a percentage rate of change (* 10000 for basis points).
OnlineTechnicalIndicators.Indicators.TrueRange — Type
TrueRange{Tohlcv}(; input_modifier_return_type = Tohlcv)The TrueRange type implements a True Range indicator.
True Range measures the greatest of the following:
- Current high minus current low
- Absolute value of current high minus previous close
- Absolute value of current low minus previous close
This captures the full range of price movement including any gaps from the previous close. True Range is the building block for the Average True Range (ATR) indicator.
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type (must havehigh,low,closefields)
Formula
TR = max(high - low, |high - close_prev|, |low - close_prev|)For the first observation, TR = high - low (no previous close available).
Input
Requires OHLCV data with high, low, and close fields.
Returns
Union{Missing,T} - The true range value. Available from the first observation.
See also: ATR, NATR, IntradayRange, RelativeIntradayRange
OnlineTechnicalIndicators.Indicators.TSI — Type
TSI{T}(; fast_period = TSI_FAST_PERIOD, slow_period = TSI_SLOW_PERIOD, ma = EMA, input_modifier_return_type = T)The TSI type implements a True Strength Index indicator using OnlineStatsChains with filtered edges.
Implementation Details
Uses OnlineStatsChains.StatDAG with filtered edges to organize two parallel 2-stage MA chains:
- Price momentum chain: slowma → fastma (for momentum)
- Absolute momentum chain: absslowma → absfastma (for normalization)
Each connection uses filter = !ismissing to automatically skip missing values during propagation.
The DAG structure provides:
- Clear organization of parallel MA pipelines
- Automatic propagation through filtered edges
- Named access to each stage for debugging
- Support for any moving average type via MovingAverage factory
Formula
TSI = 100 * (doublesmoothedmomentum / doublesmoothedabsolute_momentum) where momentum = price[t] - price[t-1]
OnlineTechnicalIndicators.Indicators.TTM — Type
TTM{Tohlcv}(; period = TTM_PERIOD, bb_std_dev_mult = TTM_BB_STD_DEV_MULT, kc_atr_mult = TTM_KC_ATR_MULT, ma = SMA, input_modifier_return_type = Tohlcv)The TTM type implements a TTM Squeeze indicator.
The TTM Squeeze identifies periods of low volatility (squeeze) that often precede significant price moves. When Bollinger Bands move inside Keltner Channels, volatility is contracting (squeeze on). The histogram shows momentum direction for trade timing.
Parameters
period::Integer = 20: Period for BB, KC, and linear regressionbb_std_dev_mult::Number = 2.0: Standard deviation multiplier for Bollinger Bandskc_atr_mult::Number = 2.0: ATR multiplier for Keltner Channelsma::Type = SMA: Moving average type for calculationsinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Squeeze = BB.upper < KC.upper AND BB.lower > KC.lower
Delta = close - (Donchian.central + MA) / 2
Histogram = Linear regression of Delta over periodInput
Requires OHLCV data with high, low, and close fields.
Output
TTMVal: Containssqueeze(Bool) andhistogram(momentum value)
Returns
Union{Missing,TTMVal} - The squeeze status and momentum, or missing during warm-up.
See also: BB, KeltnerChannels, DonchianChannels
OnlineTechnicalIndicators.Indicators.UO — Type
UO{Tohlcv}(; fast_period = UO_FAST_PERIOD, mid_period = UO_MID_PERIOD, slow_period = UO_SLOW_PERIOD, input_modifier_return_type = Tohlcv)The UO type implements an Ultimate Oscillator.
The Ultimate Oscillator combines short, medium, and long-term price momentum into a single oscillator. By using three timeframes, it aims to reduce false signals and better capture momentum across market cycles. Values above 70 suggest overbought, below 30 oversold.
Parameters
fast_period::Integer = 3: The period for the fast averagemid_period::Integer = 5: The period for the medium averageslow_period::Integer = 7: The period for the slow averageinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
BP = close - min(low, close_prev) # Buying Pressure
TR = max(high, close_prev) - min(low, close_prev) # True Range
Avg = sum(BP, period) / sum(TR, period)
UO = 100 × (4 × Avg_fast + 2 × Avg_mid + Avg_slow) / 7Input
Requires OHLCV data with high, low, and close fields.
Returns
Union{Missing,T} - The ultimate oscillator value (0-100), or missing during warm-up (first slow_period observations).
OnlineTechnicalIndicators.Indicators.VTX — Type
VTX{Tohlcv}(; period = VTX_PERIOD, input_modifier_return_type = Tohlcv)The VTX type implements a Vortex Indicator.
The Vortex Indicator identifies trend direction and trend reversals by analyzing the relationship between price movement and true range. +VI rising above -VI suggests an uptrend, while -VI rising above +VI suggests a downtrend.
Parameters
period::Integer = 14: The lookback period for the calculationinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
+VM = |high - low_prev|
-VM = |low - high_prev|
+VI = sum(+VM, period) / sum(TR, period)
-VI = sum(-VM, period) / sum(TR, period)Where TR is the True Range.
Input
Requires OHLCV data with high, low, and close fields.
Output
VTXVal: Containsplus_vtx(+VI) andminus_vtx(-VI) values
Returns
Union{Missing,VTXVal} - The vortex indicator values, or missing during warm-up.
OnlineTechnicalIndicators.Indicators.VWAP — Type
VWAP{Tohlcv}(; input_modifier_return_type = Tohlcv)The VWAP type implements a Volume Weighted Average Price indicator.
VWAP calculates the average price weighted by volume from the beginning of the trading session. It represents the average price a security has traded at throughout the day, and is commonly used as a trading benchmark by institutional investors.
Parameters
input_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
Typical Price = (high + low + close) / 3
VWAP = cumsum(Typical Price × volume) / cumsum(volume)Input
Requires OHLCV data with high, low, close, and volume fields.
Returns
Union{Missing,T} - The cumulative VWAP value. Available from the first observation. Returns missing if total volume is zero.
OnlineTechnicalIndicators.Indicators.VWMA — Type
VWMA{Tohlcv}(; period = VWMA_PERIOD, input_modifier_return_type = Tohlcv)The VWMA type implements a Volume Weighted Moving Average indicator.
VWMA weights each price by its associated volume, giving more importance to prices that occurred during high-volume periods. This helps identify the "true" average price by considering trading activity.
Parameters
period::Integer = 3: The number of periods for the moving averageinput_modifier_return_type::Type = Tohlcv: Input OHLCV type
Formula
VWMA = sum(close × volume) / sum(volume)Calculated over the specified period.
Input
Requires OHLCV data with close and volume fields.
Returns
Union{Missing,T} - The volume-weighted moving average value, or missing during the warm-up period (first period - 1 observations).
OnlineTechnicalIndicators.Indicators.WMA — Type
WMA{T}(; period = WMA_PERIOD, input_modifier_return_type = T)The WMA type implements a Weighted Moving Average indicator.
WMA assigns linearly increasing weights to more recent data points, giving them greater influence on the average. The most recent observation has weight period, the second most recent has weight period - 1, and so on.
Parameters
period::Integer = 3: The number of periods for the weighted averageinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
WMA = Σ(weight_i * price_i) / Σ(weight_i)
where weight_i = period - i + 1 for i from 1 to period, and the denominator equals period * (period + 1) / 2.
Returns
Union{Missing,T} - The weighted moving average value. Returns values immediately as this indicator has no warm-up period.
OnlineTechnicalIndicators.Indicators.ZLEMA — Type
ZLEMA{T}(; period = ZLEMA_PERIOD, input_modifier_return_type = T)The ZLEMA type implements a Zero Lag Exponential Moving Average indicator.
ZLEMA reduces the lag inherent in traditional moving averages by adding a momentum term that compensates for the lag. This makes it more responsive to recent price changes while still providing smoothing.
Parameters
period::Integer = 20: The number of periods for the ZLEMA calculationinput_modifier_return_type::Type = T: Output value type (defaults to input type)
Formula
lag = (period - 1) / 2
adjusted_price = price + (price - price[lag])
ZLEMA = EMA(adjusted_price, period)Returns
Union{Missing,T} - The zero lag exponential moving average value, or missing during the warm-up period (first lag observations).
Indicator Value Types (alphabetically ordered)
OnlineTechnicalIndicators.Indicators.ADXVal — Type
ADXVal{Tval}Return value type for Average Directional Index indicator.
Fields
adx::Union{Missing,Tval}: Average Directional Index value (trend strength)plus_di::Tval: Plus Directional Indicator (+DI)minus_di::Tval: Minus Directional Indicator (-DI)
See also: ADX
OnlineTechnicalIndicators.Indicators.AroonVal — Type
AroonVal{Tval}Return value type for Aroon indicator.
Fields
up::Tval: Aroon Up (time since highest high)down::Tval: Aroon Down (time since lowest low)
See also: Aroon
OnlineTechnicalIndicators.Indicators.BBVal — Type
BBVal{Tval}Return value type for Bollinger Bands indicator containing three bands.
Fields
lower::Tval: Lower band (central - stddevmult * standard deviation)central::Tval: Central band (moving average)upper::Tval: Upper band (central + stddevmult * standard deviation)
See also: BB
OnlineTechnicalIndicators.Indicators.ChandeKrollStopVal — Type
ChandeKrollStopVal{Tval}Return value type for Chande Kroll Stop indicator.
Fields
short_stop::Tval: Short stop level (for short positions)long_stop::Tval: Long stop level (for long positions)
See also: ChandeKrollStop
OnlineTechnicalIndicators.Indicators.DonchianChannelsVal — Type
DonchianChannelsVal{Tval}Return value type for Donchian Channels indicator.
Fields
lower::Tval: Lower channel (lowest low over period)central::Tval: Central line (midpoint between upper and lower)upper::Tval: Upper channel (highest high over period)
See also: DonchianChannels
OnlineTechnicalIndicators.Indicators.GannHiloActivatorVal — Type
GannHiloActivatorVal{T}A struct representing the result of the Gann HiLo Activator calculation.
high: The calculated high value ormissingif not enough data.low: The calculated low value ormissingif not enough data.
OnlineTechnicalIndicators.Indicators.GannSwingChartVal — Type
GannSwingChartVal{T}A struct representing the result of the Gann Swing Chart calculation.
trend: Current trend state (:uptrend or :downtrend)swing_high: Current swing high value or missingswing_low: Current swing low value or missingtrend_changed: Boolean indicating if trend changed in this period
OnlineTechnicalIndicators.Indicators.KSTVal — Type
KSTVal{Tval}Return value type for Know Sure Thing (KST) indicator.
Fields
kst::Tval: KST line (weighted sum of smoothed ROC values)signal::Union{Missing,Tval}: Signal line (moving average of KST)
See also: KST
OnlineTechnicalIndicators.Indicators.KeltnerChannelsVal — Type
KeltnerChannelsVal{Tval}Return value type for Keltner Channels indicator.
Fields
lower::Tval: Lower channel (central - ATR * multiplier)central::Tval: Central line (moving average)upper::Tval: Upper channel (central + ATR * multiplier)
See also: KeltnerChannels
OnlineTechnicalIndicators.Indicators.MACDVal — Type
MACDVal{Tval}Return value type for Moving Average Convergence Divergence indicator.
Fields
macd::Union{Missing,Tval}: MACD line (fast MA - slow MA)signal::Union{Missing,Tval}: Signal line (MA of MACD line)histogram::Union{Missing,Tval}: MACD histogram (MACD - signal)
See also: MACD
OnlineTechnicalIndicators.Indicators.ParabolicSARVal — Type
ParabolicSARVal{Tval}Return value type for Parabolic SAR indicator.
Fields
value::Tval: SAR value (stop and reverse price level)trend::SARTrend.TrendEnum: Current trend direction (UP or DOWN)ep::Tval: Extreme point (highest high or lowest low)accel_factor::Tval: Current acceleration factor
See also: ParabolicSAR
OnlineTechnicalIndicators.Indicators.PeakValleyVal — Type
PeakValleyVal{T}A struct representing detected peaks and valleys.
peak: Current peak value or missingvalley: Current valley value or missingpeak_bar_index: Index of peak bar or missingvalley_bar_index: Index of valley bar or missingis_new_peak: Boolean indicating if this is a newly detected peakis_new_valley: Boolean indicating if this is a newly detected valley
OnlineTechnicalIndicators.Indicators.PivotsHLVal — Type
PivotsHLVal{Tohlcv}Return value type for High/Low Pivots indicator.
Fields
ohlcv::Tohlcv: OHLCV data at the pivot pointtype::HLType.HLTypeEnum: Type of pivot (HIGH or LOW)isnew::Bool: Whether this is a new pivot point
See also: PivotsHL
OnlineTechnicalIndicators.Indicators.RetracementVal — Type
RetracementVal{T}A struct representing retracement calculation results.
retracement_38_long: 38% retracement level for long positions (B - (B-A) × 0.38)retracement_38_short: 38% retracement level for short positions (B + (A-B) × 0.38)swing_start: Point A of the swingswing_end: Point B of the swingcurrent_retracement_pct: Current retracement percentage from swing_endis_38_retracement_hit: Boolean indicating if 38% retracement was hit
OnlineTechnicalIndicators.Indicators.SFXVal — Type
SFXVal{Tval}Return value type for SFX indicator.
Fields
atr::Union{Missing,Tval}: Average True Rangestd_dev::Tval: Standard deviation of pricema_std_dev::Union{Missing,Tval}: Moving average of standard deviation
See also: SFX
OnlineTechnicalIndicators.Indicators.StochRSIVal — Type
StochRSIVal{Tval}Return value type for Stochastic RSI indicator.
Fields
k::Tval: %K line (stochastic of RSI)d::Union{Missing,Tval}: %D line (smoothed %K)
See also: StochRSI
OnlineTechnicalIndicators.Indicators.StochVal — Type
StochVal{Tprice}Return value type for Stochastic oscillator indicator.
Fields
k::Tprice: %K line (fast stochastic)d::Union{Missing,Tprice}: %D line (slow stochastic, smoothed %K)
See also: Stoch
OnlineTechnicalIndicators.Indicators.SuperTrendVal — Type
SuperTrendVal{Tval}Return value type for Super Trend indicator.
Fields
value::Tval: Super Trend value (support/resistance level)trend::Trend.TrendEnum: Current trend direction (UP or DOWN)
See also: SuperTrend
OnlineTechnicalIndicators.Indicators.SupportResistanceLevelVal — Type
SupportResistanceLevelVal{T}A struct representing support and resistance levels.
support_level: Current support level (previous valley)resistance_level: Current resistance level (previous peak)support_active: Boolean indicating if support is holdingresistance_active: Boolean indicating if resistance is holdingsupport_broken: Boolean indicating if support was broken this periodresistance_broken: Boolean indicating if resistance was broken this period
OnlineTechnicalIndicators.Indicators.TTMVal — Type
TTMVal{Tval}Return value type for TTM Squeeze indicator.
Fields
squeeze::Bool: Squeeze status (true = squeeze on, false = squeeze off)histogram::Tval: Momentum histogram value
See also: TTM
OnlineTechnicalIndicators.Indicators.VTXVal — Type
VTXVal{Tval}Return value type for Vortex Indicator.
Fields
plus_vtx::Tval: Plus Vortex Indicator (+VI)minus_vtx::Tval: Minus Vortex Indicator (-VI)
See also: VTX
Pattern Detectors
OnlineTechnicalIndicators.Patterns.Doji — Type
Doji{Tohlcv}(; body_tolerance = DOJI_BODY_TOLERANCE, input_modifier_return_type = Tohlcv)The Doji type implements a Doji candlestick pattern detector.
A Doji is characterized by having an open and close that are virtually equal, indicating indecision in the market.
Parameters
body_tolerance: Maximum ratio of body size to full range to be considered a Doji (default: 0.1)
Output
SingleCandlePatternVal: Pattern value with detected Doji type, confidence, and direction
OnlineTechnicalIndicators.Patterns.Hammer — Type
Hammer{Tohlcv}(; body_ratio = HAMMER_BODY_RATIO, shadow_ratio = HAMMER_SHADOW_RATIO, upper_shadow_tolerance = HAMMER_UPPER_SHADOW_TOLERANCE, input_modifier_return_type = Tohlcv)The Hammer type implements Hammer and Hanging Man candlestick pattern detectors.
A Hammer is a bullish reversal pattern with a small body at the top and a long lower shadow. A Hanging Man is the same pattern but appears at the end of an uptrend (bearish).
Parameters
body_ratio: Maximum ratio of body to total range (default: 0.33)shadow_ratio: Minimum ratio of lower shadow to body (default: 2.0)upper_shadow_tolerance: Maximum ratio of upper shadow to total range (default: 0.1)
Output
SingleCandlePatternVal: Pattern value with HAMMER or HANGING_MAN
OnlineTechnicalIndicators.Patterns.ShootingStar — Type
ShootingStar{Tohlcv}(; body_ratio = SHOOTING_STAR_BODY_RATIO, shadow_ratio = SHOOTING_STAR_SHADOW_RATIO, lower_shadow_tolerance = SHOOTING_STAR_LOWER_SHADOW_TOLERANCE, input_modifier_return_type = Tohlcv)The ShootingStar type implements Shooting Star and Inverted Hammer candlestick pattern detectors.
A Shooting Star is a bearish reversal pattern with a small body at the bottom and a long upper shadow. An Inverted Hammer is the same pattern but appears at the end of a downtrend (bullish).
Parameters
body_ratio: Maximum ratio of body to total range (default: 0.33)shadow_ratio: Minimum ratio of upper shadow to body (default: 2.0)lower_shadow_tolerance: Maximum ratio of lower shadow to total range (default: 0.1)
Output
SingleCandlePatternVal: Pattern value with SHOOTINGSTAR or INVERTEDHAMMER
OnlineTechnicalIndicators.Patterns.Marubozu — Type
Marubozu{Tohlcv}(; shadow_tolerance = MARUBOZU_SHADOW_TOLERANCE, input_modifier_return_type = Tohlcv)The Marubozu type implements Marubozu candlestick pattern detector.
A Marubozu is characterized by having little to no shadows (wicks), indicating strong directional momentum. A bullish Marubozu closes at/near the high, a bearish one closes at/near the low.
Parameters
shadow_tolerance: Maximum ratio of shadow to total range (default: 0.05)
Output
SingleCandlePatternVal: Pattern value with MARUBOZUBULLISH or MARUBOZUBEARISH
OnlineTechnicalIndicators.Patterns.SpinningTop — Type
SpinningTop{Tohlcv}(; body_ratio = SPINNING_TOP_BODY_RATIO, min_shadow_ratio = SPINNING_TOP_MIN_SHADOW_RATIO, input_modifier_return_type = Tohlcv)The SpinningTop type implements Spinning Top candlestick pattern detector.
A Spinning Top has a small body with relatively long shadows on both sides, indicating indecision with buying and selling pressure roughly equal.
Parameters
body_ratio: Maximum ratio of body to total range (default: 0.25)min_shadow_ratio: Minimum ratio of each shadow to total range (default: 0.3)
Output
SingleCandlePatternVal: Pattern value with SPINNING_TOP
OnlineTechnicalIndicators.Patterns.Engulfing — Type
Engulfing{Tohlcv}(; min_body_ratio = ENGULFING_MIN_BODY_RATIO, input_modifier_return_type = Tohlcv)The Engulfing type implements Bullish and Bearish Engulfing candlestick pattern detector.
An Engulfing pattern occurs when a candle's body completely engulfs the previous candle's body.
- Bullish Engulfing: Down candle followed by up candle that engulfs it
- Bearish Engulfing: Up candle followed by down candle that engulfs it
Parameters
min_body_ratio: Minimum ratio of current body to previous body (default: 1.1)
Output
TwoCandlePatternVal: Pattern value with BULLISHENGULFING or BEARISHENGULFING
OnlineTechnicalIndicators.Patterns.Harami — Type
Harami{Tohlcv}(; max_body_ratio = HARAMI_MAX_BODY_RATIO, input_modifier_return_type = Tohlcv)The Harami type implements Bullish and Bearish Harami candlestick pattern detector.
A Harami pattern occurs when a small candle's body is contained within the previous candle's body.
- Bullish Harami: Down candle followed by small up candle contained within it
- Bearish Harami: Up candle followed by small down candle contained within it
Parameters
max_body_ratio: Maximum ratio of current body to previous body (default: 0.5)
Output
TwoCandlePatternVal: Pattern value with BULLISHHARAMI or BEARISHHARAMI
OnlineTechnicalIndicators.Patterns.PiercingDarkCloud — Type
PiercingDarkCloud{Tohlcv}(; min_penetration = PIERCING_MIN_PENETRATION, input_modifier_return_type = Tohlcv)The PiercingDarkCloud type implements Piercing Line and Dark Cloud Cover candlestick pattern detectors.
- Piercing Line: Bullish reversal where a down candle is followed by an up candle that closes above the midpoint of the first candle's body
- Dark Cloud Cover: Bearish reversal where an up candle is followed by a down candle that closes below the midpoint of the first candle's body
Parameters
min_penetration: Minimum penetration ratio into previous candle's body (default: 0.5 = 50%)
Output
TwoCandlePatternVal: Pattern value with PIERCINGLINE or DARKCLOUD_COVER
OnlineTechnicalIndicators.Patterns.Tweezer — Type
Tweezer{Tohlcv}(; tolerance = TWEEZER_TOLERANCE, input_modifier_return_type = Tohlcv)The Tweezer type implements Tweezer Top and Tweezer Bottom candlestick pattern detectors.
- Tweezer Top: Two consecutive candles with matching highs, indicating resistance
- Tweezer Bottom: Two consecutive candles with matching lows, indicating support
Parameters
tolerance: Maximum relative difference between prices to be considered matching (default: 0.001 = 0.1%)
Output
TwoCandlePatternVal: Pattern value with TWEEZERTOP or TWEEZERBOTTOM
OnlineTechnicalIndicators.Patterns.Star — Type
Star{Tohlcv}(; doji_tolerance = STAR_DOJI_TOLERANCE, min_gap_ratio = STAR_MIN_GAP_RATIO, input_modifier_return_type = Tohlcv)The Star type implements Morning Star and Evening Star candlestick pattern detectors.
- Morning Star: Bullish reversal with down candle, small-bodied star, then up candle
- Evening Star: Bearish reversal with up candle, small-bodied star, then down candle
Parameters
doji_tolerance: Maximum body ratio for middle candle to be considered a star (default: 0.1)min_gap_ratio: Minimum gap between star and adjacent candles (default: 0.1)
Output
ThreeCandlePatternVal: Pattern value with MORNINGSTAR or EVENINGSTAR
OnlineTechnicalIndicators.Patterns.ThreeSoldiersCrows — Type
ThreeSoldiersCrows{Tohlcv}(; min_progress = THREE_SOLDIERS_MIN_PROGRESS, input_modifier_return_type = Tohlcv)The ThreeSoldiersCrows type implements Three White Soldiers and Three Black Crows candlestick pattern detectors.
- Three White Soldiers: Three consecutive bullish candles with progressive closes
- Three Black Crows: Three consecutive bearish candles with progressive closes
Parameters
min_progress: Minimum ratio of progression between consecutive candles (default: 0.2)
Output
ThreeCandlePatternVal: Pattern value with THREEWHITESOLDIERS or THREEBLACKCROWS
OnlineTechnicalIndicators.Patterns.ThreeInside — Type
ThreeInside{Tohlcv}(; max_harami_ratio = THREE_INSIDE_MAX_HARAMI_RATIO, input_modifier_return_type = Tohlcv)The ThreeInside type implements Three Inside Up and Three Inside Down candlestick pattern detectors.
- Three Inside Up: Bullish pattern - Harami followed by bullish confirmation
- Three Inside Down: Bearish pattern - Harami followed by bearish confirmation
Parameters
max_harami_ratio: Maximum ratio of second candle body to first candle body for Harami (default: 0.5)
Output
ThreeCandlePatternVal: Pattern value with THREEINSIDEUP or THREEINSIDEDOWN
OnlineTechnicalIndicators.Patterns.CandlestickPatternDetector — Type
CandlestickPatternDetector{Tohlcv}(; enable_single = true, enable_two = true, enable_three = true, input_modifier_return_type = Tohlcv)The CandlestickPatternDetector type implements a comprehensive candlestick pattern detector that aggregates all available pattern detection algorithms.
Parameters
enable_single: Enable single-candle pattern detection (default: true)enable_two: Enable two-candle pattern detection (default: true)enable_three: Enable three-candle pattern detection (default: true)
Output
AllPatternsVal: A value containing all detected patterns
Pattern Value Types
OnlineTechnicalIndicators.Patterns.SingleCandlePatternVal — Type
SingleCandlePatternVal{T}Return value type for single candlestick pattern indicators.
Fields
pattern::SingleCandlePatternType.SingleCandlePattern: The detected patternconfidence::T: Confidence level (0.0 to 1.0)direction::PatternDirection.Direction: Pattern direction (BULLISH, BEARISH, NEUTRAL)
OnlineTechnicalIndicators.Patterns.TwoCandlePatternVal — Type
TwoCandlePatternVal{T}Return value type for two-candle pattern indicators.
Fields
pattern::TwoCandlePatternType.TwoCandlePattern: The detected patternconfidence::T: Confidence level (0.0 to 1.0)direction::PatternDirection.Direction: Pattern direction (BULLISH, BEARISH, NEUTRAL)
OnlineTechnicalIndicators.Patterns.ThreeCandlePatternVal — Type
ThreeCandlePatternVal{T}Return value type for three-candle pattern indicators.
Fields
pattern::ThreeCandlePatternType.ThreeCandlePattern: The detected patternconfidence::T: Confidence level (0.0 to 1.0)direction::PatternDirection.Direction: Pattern direction (BULLISH, BEARISH, NEUTRAL)
OnlineTechnicalIndicators.Patterns.AllPatternsVal — Type
AllPatternsVal{S}Return value type containing all detected candlestick patterns.
Fields
single_patterns::Vector{SingleCandlePatternVal{S}}: All detected single-candle patternstwo_patterns::Vector{TwoCandlePatternVal{S}}: All detected two-candle patternsthree_patterns::Vector{ThreeCandlePatternVal{S}}: All detected three-candle patterns
Core Types
OnlineTechnicalIndicators.SampleData.TabOHLCV — Type
TabOHLCVSample OHLCV data table implementing the Tables.jl interface.
Contains template financial data with Date indices and Float64 price/volume values.
Fields
Index::Vector{Date}: Vector of datesOpen::Vector{Float64}: Opening pricesHigh::Vector{Float64}: High pricesLow::Vector{Float64}: Low pricesClose::Vector{Float64}: Closing pricesVolume::Vector{Float64}: Trading volumes
OnlineTechnicalIndicators.Indicators.TechnicalIndicatorWrapper — Type
TechnicalIndicatorWrapper{T}Wraps a technical indicator type with its constructor arguments for deferred instantiation.
Fields
indicator_type::T: The type of technical indicator to constructargs::Tuple: Positional arguments for the indicator constructorkwargs::Base.Pairs: Keyword arguments for the indicator constructor
OnlineTechnicalIndicators.Indicators.TechnicalIndicatorResults — Type
TechnicalIndicatorResults{Ttime,Tout}Container for technical indicator results implementing the Tables.jl interface.
Fields
name::Symbol: Name of the indicatorfieldnames::Tuple: Names of the output fieldsfieldtypes::Tuple: Types of the output fieldsindex::Vector{Ttime}: Vector of timestamps/indicesoutput::Vector{Tout}: Vector of indicator output values
OnlineTechnicalIndicators.Resample.SamplingPeriod — Type
SamplingPeriodDefines a time period for resampling data.
Fields
type::TimeUnitType.TimeUnitTypeEnum: Type of time unit (SEC, MIN, HOUR, DAY)length::Integer: Length of the period in the specified time units
OnlineTechnicalIndicators.Resample.Resampler — Type
ResamplerResamples time-series data according to a specified sampling period.
Fields
sampling_period::SamplingPeriod: The sampling period to use for resampling
OnlineTechnicalIndicators.Resample.TimedEvent — Type
TimedEventRepresents a data point with an associated timestamp.
Fields
time: Timestamp of the eventdata: The data value at this time
OnlineTechnicalIndicators.Resample.AgregatedStat — Type
AgregatedStatHolds aggregated statistical data for a time period.
Fields
time: Timestamp of the aggregated perioddata: The aggregated statistical value
OnlineTechnicalIndicators.Resample.StatBuilder — Type
StatBuilderBuilder for creating new statistical aggregation instances.
Fields
agg: A callable that creates new aggregation instances when invoked
OnlineTechnicalIndicators.Resample.OHLC — Type
OHLC{Tprice}Mutable OHLC (Open, High, Low, Close) data structure for resampling price data.
Fields
status::OHLCStatus.OHLCStatusEnum: Status of the OHLC data (INIT, NEW, USED)open::Tprice: Opening pricehigh::Tprice: Highest pricelow::Tprice: Lowest priceclose::Tprice: Closing price
OnlineTechnicalIndicators.Resample.OHLCStat — Type
OHLCStat{T} <: OnlineStat{T}Online statistic for computing OHLC values from streaming price data.
Fields
ohlc::OHLC: The current OHLC valuesn::Int: Number of observations processed
OnlineTechnicalIndicators.Resample.ResamplerBy — Type
ResamplerBy <: OnlineStat{TimedEvent}Online statistic that resamples timed events into aggregated periods.
Fields
agg::AgregatedStat: Current aggregated statisticn::Int: Number of observations processedsampling_period::SamplingPeriod: The sampling period to usestat_builder::StatBuilder: Builder for creating new aggregation instancesinput_modifier::Function: Function to modify input data before processinginput_filter::Function: Function to filter input data
Other
add_input_indicator! has been removed. Use OnlineStatsChains.StatDAG to chain indicators instead. See the Migration Guide for detailed examples and migration instructions.
OnlineTechnicalIndicators.StatLag — Type
StatLag(ind, b)Track a moving window (previous b copies) of ind.
Example
ind = SMA{Float64}(period = 3)
prices = [10.81, 10.58, 10.07, 10.58, 10.56, 10.4, 10.74, 10.16, 10.29, 9.4, 9.62]
ind = StatLag(ind, 4)
fit!(ind, prices)
ind.lag[end-1]OnlineTechnicalIndicators.TechnicalIndicatorIterator — Type
TechnicalIndicatorIterator(indicator_type, iterable_input, args...; kwargs...)Returns an iterator.
Example
using OnlineTechnicalIndicators
using OnlineTechnicalIndicators.SampleData: CLOSE_TMPLSISO indicator
itr = TechnicalIndicatorIterator(SMA, CLOSE_TMPL; period = 3)
println("First iteration")
for val in itr
println(val)
end
println("")
println("Second iteration")
Iterators.reset!(itr)
for val in itr
println(val)
end
println("")
println("Third iteration with collect")
# itr = TechnicalIndicatorIterator(SMA, CLOSE_TMPL; period = 3)
# or
Iterators.reset!(itr)
println(eltype(itr))
println(collect(itr))
println("")SIMO indicator
itr = TechnicalIndicatorIterator(BB, CLOSE_TMPL)
println(collect(itr))OnlineTechnicalIndicators.Indicators.update_levels! — Function
update_levels!(sr::SupportResistanceLevel, peak_valley_val)Update support and resistance levels from external peak/valley detection. This method allows integration with PeakValleyDetector results.