backtrader.indicators.contrib package¶
Contributed indicators migrated from functional strategy tests.
These indicators are lower-commonality or strategy-specific indicators. They are
re-exported from backtrader.indicators so users can access them as
bt.indicators.Xxx.
- class backtrader.indicators.contrib.AbsolutelyNoLagLwma[source]¶
Bases:
IndicatorCompute a low-lag LWMA proxy based on nested weighted moving averages.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AbsolutelyNoLagLwmaColor[source]¶
Bases:
IndicatorIndicator computing WMA-of-WMA (no-lag) upper/lower channels with color breakout signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AccumulationDistributionLine[source]¶
Bases:
IndicatorAccumulate the ADL indicator from price and volume progression.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ChaikinOscillator[source]¶
Bases:
IndicatorChaikin oscillator as EMA(short) minus EMA(long) of ADL.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.LineCCI[source]¶
Bases:
IndicatorCustom CCI computation on the selected input data.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CCIDualOnMA[source]¶
Bases:
IndicatorProvide fast/slow CCI values computed on a smoothing moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ADXCrossHullStyleIndicator[source]¶
Bases:
IndicatorHull-style ADX cross indicator emitting up/down directional signal levels.
Builds smoothed +DI/-DI values from a full and a half-length directional index and marks an
uplevel on a bullish DI cross or adownlevel on a bearish DI cross, each offset from price by a fraction of ATR.- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized batch computation of up/down signal levels over a range.
- Parameters:
start – First index in the array range to compute.
end – One past the last index in the array range to compute.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.UltraXMAIndicator[source]¶
Bases:
IndicatorUltraXMA breadth indicator counting rising vs falling fanned moving averages.
Computes a fan of moving averages over increasing periods, counts how many are rising (bulls) versus falling (bears) each bar, and smooths those counts with an exponential factor to produce trend-strength breadth lines.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized batch computation of smoothed breadth counts over a range.
- Parameters:
start – First index in the array range to compute.
end – One past the last index in the array range to compute.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ADXDMI[source]¶
Bases:
IndicatorDMI direction indicator exposing plus/minus directional values.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AIAccelerationDecelerationOscillator[source]¶
Bases:
IndicatorIndicator computing acceleration/deceleration oscillator from SMA spread.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AltrTrendSignalV22[source]¶
Bases:
IndicatorAdaptive trend breakout indicator used by the strategy.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AnchoredMomentumLine[source]¶
Bases:
IndicatorAnchored Momentum line: EMA-vs-SMA percentage plus a zone classifier.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AnchoredMomentumCandleIndicator[source]¶
Bases:
IndicatorSynthetic candle from Anchored Momentum on each OHLC price plus colour.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AnyRangeCldTailIndicator[source]¶
Bases:
IndicatorCompute a session-based daily channel and color-state trend signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AroonHornSignIndicator[source]¶
Bases:
IndicatorReconstructs AroonHornSign indicator.
BULLS = 100 - (bars_since_highest_high + 0.5) * 100 / AroonPeriod BEARS = 100 - (bars_since_lowest_low + 0.5) * 100 / AroonPeriod trend = +1 if BULLS > BEARS and BULLS >= 50 trend = -1 if BULLS < BEARS and BEARS >= 50 BullsAroon (buy arrow) when trend flips from -1 to +1: low - ATR*3/8 BearsAroon (sell arrow) when trend flips from +1 to -1: high + ATR*3/8 Buffers: 0=BearsAroon(sell), 1=BullsAroon(buy).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AroonOscillatorSignAlert[source]¶
Bases:
IndicatorAroon oscillator alert indicator with buy/sell level trigger lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ArrowsCurvesIndicator[source]¶
Bases:
IndicatorCustom Arrows and Curves technical indicator.
Calculates channel boundaries (smax, smin, smax2, smin2) based on highest high and lowest low windows and returns trade entry signals (buy, sell, buy_stop, sell_stop).
- __init__(*args, **kwargs)¶
- next()[source]¶
Calculates channel lines and signals for each bar.
Generates buy/sell and buy_stop/sell_stop triggers based on price crossovers and trend state switches.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ASCtrendIndicator[source]¶
Bases:
IndicatorReconstructs ASCtrend from its MQ5 source.
- Outputs:
buy_arrow : non-zero price level when a buy arrow fires
sell_arrow: non-zero price level when a sell arrow fires
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AsimmetricStochNRIndicator[source]¶
Bases:
IndicatorAsymmetric stochastic oscillator indicator with dynamic MA smoothing.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AtrNormalizeHistogram[source]¶
Bases:
IndicatorATR-normalized histogram indicator for multi-timeframe signal generation.
Computes a normalized ATR value where xdiff is smoothed range ratio, colored by threshold crossings (high/middle/low levels).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AverageChangeCandle[source]¶
Bases:
IndicatorCustom Average Change Candle indicator that computes power-scaled smoothed lines.
- Lines:
open_line (LineSeries): Smoothed open line. high_line (LineSeries): Smoothed high line. low_line (LineSeries): Smoothed low line. close_line (LineSeries): Smoothed close line. color (LineSeries): Candle color state (0 = bearish, 1 = flat, 2 = bullish).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BBSqueezeIndicator[source]¶
Bases:
IndicatorBollinger Band Squeeze: measures BB width relative to Keltner Channel. Histogram = close - midline of (BB + KC) / 2, colored by whether BB is inside KC (squeeze on) or outside (squeeze off). Simplified: histogram = momentum (close - SMA), signal direction by BB bandwidth vs KC bandwidth.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BezierStDevIndicator[source]¶
Bases:
IndicatorReconstructs Bezier_StDev indicator.
Bezier curve interpolation of price over BPeriod, then StDev filter on the first derivative to generate Bulls/Bears signals. Buffers: 0=BezierLine, 1=ColorIndex, 2=BearsBuffer(sell), 3=BullsBuffer(buy).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BinaryWaveIndicator[source]¶
Bases:
IndicatorWeighted indicator that builds a smoothed wave signal from multiple sub-indicators.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Calculate raw and smoothed wave arrays for a range of bars.
- Parameters:
start – Start index for batch evaluation.
end – End index (exclusive) for batch evaluation.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCMomentumIndicator[source]¶
Bases:
IndicatorBlau composite momentum: triple-smoothed price-difference oscillator.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCMIIndicator[source]¶
Bases:
IndicatorCompute the CMI oscillator from nested moving averages of momentum.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCSI[source]¶
Bases:
IndicatorBlau CSI indicator built from smoothed momentum vs. range.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodic[source]¶
Bases:
IndicatorBlau Ergodic oscillator: triple-smoothed normalised momentum.
Price momentum and its absolute value are each triple-smoothed with EMAs; the main line is 100 times their ratio (guarded against division by zero). The signal line is an EMA of the main line, and spread is their difference.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauTStochI[source]¶
Bases:
IndicatorIndicator generating a smoothed Blau T-Stoch histogram.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauTSStochastic[source]¶
Bases:
IndicatorBlau TS Stochastic: triple-smoothed stochastic momentum oscillator.
A stochastic numerator (price minus lowest low) and its range (highest high minus lowest low) are each triple-smoothed with EMAs; the histogram is 200 times their ratio minus 100 (guarded against division by zero), and an EMA of the histogram forms the signal line exposed on the down line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauTVI[source]¶
Bases:
IndicatorBlau Tick Volume Indicator: a triple-EMA-smoothed up/down tick oscillator.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BrainTrend2Indicator[source]¶
Bases:
IndicatorATR-derived trend-state indicator producing a four-state color signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AbsolutelyNoLagLwmaIndicator[source]¶
Bases:
IndicatorNo-lag LWMA indicator with color state transitions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BrainTrendSignalProxy[source]¶
Bases:
IndicatorSignal proxy that combines ATR and stochastic cross conditions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BrakeParbIndicator[source]¶
Bases:
IndicatorParabolic-style trailing-stop indicator with flip arrows.
Maintains a power-curve stop that rises while long (and falls while short) from a begin price; when price breaks the stop the direction flips. Exposes the active stop on
up/downlines and direction-flip cues onbuy/selllines.- __init__(*args, **kwargs)¶
- next()[source]¶
Advance the parabolic stop and emit up/down stop and flip lines.
Extends the stop along the power curve, flips direction (resetting the begin price and extremes) when price breaks the stop, and sets the
up/downstop lines plusbuy/sellflip cues for the bar.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BreakoutBarsTrendV2[source]¶
Bases:
IndicatorCustom trend-breakout indicator calculating dynamic trend boundaries and reversals.
- Lines:
value: Trend state value (1.0 or positive series count for uptrend, -1.0 or negative series count for downtrend).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BSIIndicator[source]¶
Bases:
IndicatorBalance of power-style indicator returning BSI value and trend color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BullsBearsEyes[source]¶
Bases:
IndicatorRebuild a signal oscillator from recursive smoothed directional momentum.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BullsPower[source]¶
Bases:
IndicatorIndicator for Bulls Power built from high price minus EMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BearsPower[source]¶
Bases:
IndicatorIndicator for Bears Power built from low price minus EMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BWWiseMan1Signal[source]¶
Bases:
IndicatorGenerate long/short trigger values based on Alligator-like MAs and ATR.
The indicator outputs two value lines (buy, sell) that represent candidate entry levels for short and long flips under the configured market regime.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.BykovTrendIndicator[source]¶
Bases:
IndicatorReconstructs BykovTrend from its MQ5 source.
Uses WPR(SSP) + ATR(15) to detect trend flips. Outputs buy_arrow / sell_arrow (non-zero price level when arrow fires).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CandleStopColor[source]¶
Bases:
IndicatorIndicator computing highest-high/ lowest-low trailing stop channels with color breakout signal.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CandlesXSmoothedIndicator[source]¶
Bases:
IndicatorIndicator that smooths OHLC bars with configurable MA and derives color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CandlesticksBW[source]¶
Bases:
IndicatorIndicator that encodes AO/AC state into a numeric candle color code.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CaudateXPeriodCandleColor[source]¶
Bases:
IndicatorSynthetic period-candle indicator emitting a color index and smoothed OHLC.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CCIHistogramIndicator[source]¶
Bases:
IndicatorCCI-based colour-state indicator classifying CCI into three zones.
Lines¶
- ccifloat
Commodity Channel Index value.
- color_statefloat
0.0 = overbought (CCI > high_level), 1.0 = neutral, 2.0 = oversold.
- hist_basefloat
Always 0.0 (placeholder for histogram baseline).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CCIWoodiesIndicator[source]¶
Bases:
IndicatorReconstructs CCI_Woodies indicator.
DRAW_FILLING between FastCCI and SlowCCI. Buffer 0 = FastCCI, Buffer 1 = SlowCCI. When Fast > Slow → bullish (Lime fill); when Fast < Slow → bearish (Plum fill).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CenterOfGravityCandleIndicator[source]¶
Bases:
IndicatorCenter-of-Gravity Candle indicator exposing center, signal, and state lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CenterOfGravityIndicator[source]¶
Bases:
IndicatorCenter of Gravity indicator composed of price selection and smoothed center line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CGOscillator[source]¶
Bases:
IndicatorCenter of Gravity (CG) oscillator with a one-bar-lagged signal line.
The main line is a length-weighted ratio of recent median prices, shifted to centre around zero. The signal line is the previous bar’s main value.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CloseLineCCI[source]¶
Bases:
IndicatorCustom CCI indicator designed to evaluate simple single close lines instead of HLC.
- Lines:
cci (Line): Output Commodity Channel Index line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ClosePriceFractals[source]¶
Bases:
IndicatorCustom 5-period Fractal indicator calculated solely on closing prices.
- Lines:
upper: Contains fractal peak closing price if upper fractal is formed. lower: Contains fractal valley closing price if lower fractal is formed.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.Color3rdGenXMAIndicator[source]¶
Bases:
IndicatorThird-generation (reduced-lag) moving average with a slope color.
Combines a base moving average with a re-smoothed version using a lambda-derived alpha to cut lag, exposing the resulting line on
valueand acolorline marking whether it is rising (2), falling (0) or flat (1).- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorBBCandlesIndicator[source]¶
Bases:
IndicatorColor BBCandles indicator producing zone states from volatility envelopes.
The indicator computes a moving-average center line and standard deviation bands with multiple deviation levels, then emits a discrete state 0..10.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorCoppockIndicator[source]¶
Bases:
IndicatorCompute Coppock oscillator value and its directional color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorHMA[source]¶
Bases:
IndicatorHull Moving Average line plus its slope-direction (“color”) line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorJVariationIndicator[source]¶
Bases:
IndicatorIndicator deriving a custom color variation series from MA residuals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorMetroDeMarkerIndicator[source]¶
Bases:
IndicatorColour Metro DeMarker indicator: derives fast/slow adaptive trend lines from the DeM oscillator.
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute fast_line, slow_line and demarker from DeM value using step-based channel logic.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorMetroStochasticIndicator[source]¶
Bases:
IndicatorIndicator producing adaptive fast/slow ColorMETRO stochastic levels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorMetroWprIndicator[source]¶
Bases:
IndicatorColorMETRO step lines (fast/slow NRTR) computed over Williams %R.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorSchaffDeMarkerTrendCycle[source]¶
Bases:
IndicatorSchaff Trend Cycle of DeMarker oscillators with a discrete color line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorSchaffTrendCycleIndicator[source]¶
Bases:
IndicatorCustom indicator producing Schaff Trend Cycle value and color states.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorStepXCCXIndicator[source]¶
Bases:
IndicatorCompute fast/slow XCCX channel lines for directional step signals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorX2MA[source]¶
Bases:
IndicatorIndicator that outputs smoothed MA value and directional color index.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorXDerivative[source]¶
Bases:
IndicatorSmoothed price-derivative indicator with a momentum color state.
Computes the average rate of change of a weighted price over
i_slowingbars, smoothed acrossxlengthwindows, and classifies it into a color index: rising/falling while positive (0/1) or negative (3/4), with 2 as a neutral state.- __init__(*args, **kwargs)¶
- next()[source]¶
Compute the smoothed derivative value and its color state.
Stores the smoothed derivative on the
valueline and a color index oncolor_idxreflecting whether the value is rising or falling above or below zero relative to the previous bar.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorZerolagDeMarker[source]¶
Bases:
IndicatorBlend five weighted DeMarker oscillators into fast and slow trend lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.CorrectedAverageIndicator[source]¶
Bases:
IndicatorEhlers-style adaptive Corrected Average with event and vectorized modes.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized corrected-average computation over the array index range.
- Parameters:
start – Start index (inclusive) of the range to compute.
end – End index (exclusive) of the range to compute.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.DarvasBoxesSystem[source]¶
Bases:
IndicatorIndicator that emits Darvas box color states from high/low progression.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DemaRangeChannelColor[source]¶
Bases:
IndicatorIndicator computing DEMA-based upper/lower range channels with a color index for breakout direction.
- __init__(*args, **kwargs)¶
- next()[source]¶
Set the upper, lower, and color_idx line values based on close position relative to DEMA band.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DerivativeIndicator[source]¶
Bases:
IndicatorDerivative indicator derived from a selected applied price.
The computed value line is a momentum-like slope:
100 * (price[0] - price[-i_slowing]) / i_slowing.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DigitalFT01Indicator[source]¶
Bases:
IndicatorFixed-weight digital filter with a channel trigger for crossover signals.
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute the digital-filter value and channel trigger for this bar.
Convolves the fixed DIGITAL_WEIGHTS kernel with the applied price, then sets the trigger to a reference close plus/minus the half-channel depending on whether the filtered value is above or below that close.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DigitalMacd[source]¶
Bases:
IndicatorDigital MACD indicator built from fixed FIR fast/slow filter banks.
- FAST_COEFFS = [0.214984061, 0.2065763732, 0.190372889, 0.1675422436, 0.139705315, 0.1087951881, 0.0768869405, 0.0460244906, 0.0180517395, -0.0055294579, -0.0236660212, -0.0358140055, -0.041949776, -0.042533145, -0.0384279507, -0.0307917433, -0.0209443384, -0.0102335925, 9.32767e-05, 0.0089950015, 0.0157131144, 0.0198149331, 0.0211989019, 0.0200639819, 0.0168532934, 0.0121825067, 0.0067474241, 0.0012444305, -0.0037087682, -0.0076300416, -0.0102110543, -0.0113306266, -0.0110462105, -0.0095662166, -0.0072080453, -0.0043494435, -0.001377197, 0.0013575268, 0.0035760416, 0.0050946166, 0.0058339574, 0.0058160431, 0.0051486631, 0.0039984014, 0.002561938, 0.0010531475, -0.0003481453, -0.0014937154, -0.0022905986, -0.0027000514, -0.002735908, -0.0024543322, -0.0019409837, -0.0012957482, -0.0006179734, 5.7542e-06, 0.0005111297, 0.0008605279, 0.0010441921, 0.0010775684, 0.0009966494, 0.00085373, 0.0007142855, 0.0006599146, -0.0008151017]¶
- SLOW_COEFFS = [0.0825641231, 0.082278308, 0.0814249974, 0.0800166909, 0.0780735197, 0.0756232268, 0.072700974, 0.0693478349, 0.0656105823, 0.0615409157, 0.057193954, 0.0526285643, 0.0479025123, 0.0430785482, 0.038215288, 0.0333706133, 0.028602116, 0.0239614376, 0.0194972056, 0.0152532583, 0.0112682658, 0.0075745482, 0.0041980052, 0.0011588603, -0.0015292889, -0.0038593393, -0.0058303888, -0.0074473108, -0.0087203043, -0.0096645874, -0.0102995666, -0.0106483424, -0.0107374524, -0.0105952115, -0.0102516944, -0.0097377645, -0.0090838346, -0.0083237046, -0.0074804382, -0.0065902734, -0.0056742995, -0.0047554314, -0.0038574209, -0.0029983549, -0.0021924972, -0.0014513858, -0.0007848072, -0.0001995891, 0.0003009728, 0.0007162164, 0.0010478905, 0.0012994016, 0.0014755433, 0.0015824007, 0.0016272598, 0.0016185271, 0.0015648336, 0.0014747659, 0.0013569946, 0.0012193896, 0.0010695971, 0.0009140878, 0.000759154, 0.0016019033]¶
- __init__(*args, **kwargs)¶
- next()[source]¶
Convolve the rolling close window with the FIR banks to set
macd.Emits NaN until the buffer is full, then writes the point-scaled difference of the fast and slow digital filter outputs to
macd.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DonchianChannelsSystem[source]¶
Bases:
IndicatorDonchian-channel indicator emitting breakout-oriented color states.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.DotsIndicator[source]¶
Bases:
IndicatorCompute a multi-cycle Dots value and color-change state.
- lines¶
Custom lines
dotsandcolor.
- params¶
Indicator parameters used in strategy logic.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.EFDistanceIndicator[source]¶
Bases:
IndicatorEnergy-field distance indicator producing a weighted applied-price value.
Weights each price in a window by the accumulated powered distance to the other prices in the window, yielding a smoothed
valueline whose turns signal momentum shifts.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.EmaRsiVa[source]¶
Bases:
IndicatorVolatility-adaptive EMA whose smoothing reacts to RSI distance from 50.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.EnvelopesJpAlonso[source]¶
Bases:
IndicatorCompute static upper/lower envelope bands around a simple moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.F2aAOIndicator[source]¶
Bases:
IndicatorF2a_AO arrow indicator from a fast/slow/filter EMA system.
Builds fast, slow and filter EMAs of a weighted price and emits a
buyarrow below the bar when the fast-minus-slow spread turns up with filter confirmation, or asellarrow above the bar on the bearish turn, using an internal latch so arrows alternate direction.- __init__(*args, **kwargs)¶
- next()[source]¶
Compute buy/sell arrows for the current bar (event-driven mode).
Detects a confirmed turn in the fast-minus-slow spread and plots a buy arrow below the low or a sell arrow above the high, offset by half the recent average range, toggling the internal trend latch.
- once(start, end)[source]¶
Compute buy/sell arrows over a range of bars (vectorized mode).
Vectorized equivalent of
nextused underrunonce: iterates the arrays fromstarttoend, detecting confirmed spread turns and writing buy/sell arrow values while maintaining the trend latch.- Parameters:
start – First bar index to process.
end – Stop index (exclusive) for processing.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.FatlFilter[source]¶
Bases:
IndicatorFinite impulse response filter approximation used by JFatl indicators.
- coeffs = (0.436040945, 0.3658689069, 0.2460452079, 0.1104506886, -0.0054034585, -0.0760367731, -0.0933058722, -0.0670110374, -0.0190795053, 0.0259609206, 0.0502044896, 0.0477818607, 0.0249252327, -0.0047706151, -0.0272432537, -0.0338917071, -0.0244141482, -0.0055774838, 0.0128149838, 0.0226522218, 0.0208778257, 0.0100299086, -0.0036771622, -0.013674485, -0.0160483392, -0.0108597376, -0.0016060704, 0.0069480557, 0.0110573605, 0.0095711419, 0.0040444064, -0.0023824623, -0.0067093714, -0.00720034, -0.004771771, 0.0005541115, 0.000786016, 0.0130129076, 0.0040364019)¶
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.JFatlApprox[source]¶
Bases:
IndicatorDouble-smoothed approximation indicator built from JFatl coefficients.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.JFatlCandleApprox[source]¶
Bases:
IndicatorReconstruct candle-like open/high/low/close and color state from JFatl.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FiboCandlesIndicator[source]¶
Bases:
IndicatorReconstructs the FiboCandles indicator from MQ5 source.
Uses period-bar high/low range * fibo level to detect trend flips. color line: 0 = bullish (trend +1), 1 = bearish (trend -1).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FineTuningMA[source]¶
Bases:
IndicatorWeighted moving average with rank/shift-shaped per-bar weights.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FisherOrgV1[source]¶
Bases:
IndicatorFisher Transform indicator producing a Gaussian-like signal line and its lagged trigger.
Lines¶
- fisherfloat
Current smoothed Fisher Transform value.
- triggerfloat
Previous bar’s fisher value, used for crossover detection.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FisherOrgV1Sign[source]¶
Bases:
IndicatorFisher Transform Org V1 Sign indicator.
Normalises price within a highest-high/lowest-low window over length bars, smooths the normalised position via recursive formula, then applies the Fisher Transform (atanh) to produce a near-Gaussian signal. Buy/sell trigger lines are set at ATR-scaled price levels on threshold crossovers.
Lines¶
- sellfloat
Price level for sell signals (high + 3/8 ATR), set on up-cross.
- buyfloat
Price level for buy signals (low - 3/8 ATR), set on down-cross.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ForceIndexEMA[source]¶
Bases:
IndicatorIndicator producing a smoothed force index.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ForceDiverSign[source]¶
Bases:
IndicatorDivergence signal detector built from two force-index EMAs.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ForceIndexEma[source]¶
Bases:
IndicatorForce Index (price change times volume) smoothed by an EMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ForecastOscilator[source]¶
Bases:
IndicatorForecast Oscillator with T3-smoothed signal and arrow lines.
Computes the percentage deviation of price from a linear-regression forecast (the raw
indline), smooths it with a six-stage T3 moving average into thesignalline, and emitsbuy/sellarrow values when the oscillator crosses its signal under the configured sign conditions.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FractalAMAMBK[source]¶
Bases:
IndicatorFRAMA-style indicator exposing smoothed trend and trigger lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FramaSeries[source]¶
Bases:
IndicatorFractal Adaptive Moving Average (FrAMA) of a single input series.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FramaLinesIndicator[source]¶
Bases:
IndicatorFrAMA candle indicator emitting smoothed OHLC and a color line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FRASMAv2Indicator[source]¶
Bases:
IndicatorFractal-adaptive moving average exposing the
frasmaline and slopecolor.- __init__(*args, **kwargs)¶
- next()[source]¶
Compute the fractal dimension, adapt the averaging speed, and set color.
Estimates the fractal dimension of the recent price window, derives an adaptive averaging length, writes the resulting value to
frasma, and encodes its slope intocolor(0 rising, 1 flat, 2 falling).
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.GOIndicator[source]¶
Bases:
IndicatorIndicator that derives a GO signal from smoothed OHLC components.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.HLRIndicator[source]¶
Bases:
IndicatorBase HLR indicator returning a normalized high-low range position.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ZeroLagHLRIndicator[source]¶
Bases:
IndicatorZero-lag variant of HLR computed from a blended set of HLR periods.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.HMA[source]¶
Bases:
IndicatorHull Moving Average indicator used by OsHMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.OsHMAIndicator[source]¶
Bases:
IndicatorHistogram indicator that combines fast and slow HMA lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.I4DRFV2[source]¶
Bases:
IndicatorClose-difference indicator producing value and binary color trend state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.I4DRFV3[source]¶
Bases:
IndicatorIndicator producing a direction color and synthetic value from highs/lows.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IAnchMomIndicator[source]¶
Bases:
IndicatorAnchored-momentum oscillator: percentage gap of a fast EMA over a slow SMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IDeMarkerSignIndicator[source]¶
Bases:
IndicatorDeMarker oscillator that emits buy/sell triggers on level crossings.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IGapIndicator[source]¶
Bases:
IndicatorDetect opening gaps and emit ATR-offset buy/sell arrow levels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IStochKomposterIndicator[source]¶
Bases:
IndicatorStochastic-and-ATR composite that prints offset buy/sell markers.
Emits a buy line below the bar low (and a sell line above the bar high), offset by 3/8 of ATR, whenever the slowed %K stochastic crosses up through the lower level or down through the upper level respectively.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ITrendIndicator[source]¶
Bases:
Indicatori_Trend indicator producing primary and signal crossover lines.
The
primaryline is the selected price minus a Bollinger band line and thesignalline is a moving average mirrored around the bar’s high/low range; their crossovers drive the strategy’s entries and exits.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.IAMMAIndicator[source]¶
Bases:
IndicatorIndicator implementation of i-AMMA value progression.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IndexedMovingAverage[source]¶
Bases:
IndicatorIndicator that normalizes price-to-MA imbalance for directional signals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.InstantaneousTrendFilterIndicator[source]¶
Bases:
IndicatorIndicator computing trend and trigger values from a low-lag trend filter.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.InverseReactionIndicator[source]¶
Bases:
IndicatorIndicator that tracks candle reaction amplitude and dynamic thresholds.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IRSISignIndicator[source]¶
Bases:
IndicatorCompute RSI sign-flip levels and adaptive ATR-adjusted marker lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IWPRSignIndicator[source]¶
Bases:
IndicatorIndicator computing WPR buy/sell levels with ATR context.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.JBrainTrend1SigIndicator[source]¶
Bases:
IndicatorGenerate directional trend-signal levels from ATR, stochastic, and MAs.
The indicator emits
buy_signalandsell_signalpulses used by the main strategy.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.UltraRSIIndicator[source]¶
Bases:
IndicatorSmooth RSI slope-count indicator with configurable averaging stages.
Counts bullish versus bearish RSI directional changes across multiple moving average steps and smooths both counters for a stable signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.JTpoProxy[source]¶
Bases:
IndicatorProxy oscillator measuring close deviation from its moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.JMASlopeIndicator[source]¶
Bases:
IndicatorSlope of a Jurik-style moving average with a rising/falling color.
Approximates the JMA with an EMA of the applied price, then exposes its bar-over-bar change on the
valueline and acolorline marking whether the slope is positive (4), negative (0) or flat (2).- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.KalmanFilterIndicator[source]¶
Bases:
IndicatorKalman-style adaptive price filter producing value and direction lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KalmanFilterLine[source]¶
Bases:
IndicatorSingle-series Kalman-style adaptive filter with a velocity term.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KalmanFilterCandleIndicator[source]¶
Bases:
IndicatorBuilds Kalman-filtered OHLC candles and a bull/bear color line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KAMAIndicator[source]¶
Bases:
IndicatorKaufman Adaptive Moving Average with both event and vectorized modes.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized KAMA computation over the array index range.
- Parameters:
start – Start index (inclusive) of the range to compute.
end – End index (exclusive) of the range to compute.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorMomentumAMAIndicator[source]¶
Bases:
IndicatorEMA-smoothed momentum line used by the ColorMomentum_AMA strategy.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.KaracaticaIndicator[source]¶
Bases:
IndicatorReconstructs Karacatica from MQ5 source.
Uses ATR(iPeriod), ADX(iPeriod) +DI/-DI, and close-vs-close(iPeriod-ago) to generate buy/sell arrows with direction latch to avoid repeats.
- __init__(*args, **kwargs)¶
- next()[source]¶
Emit ATR-offset buy/sell arrows on latched directional breakouts.
Computes ATR and +DI/-DI over
iperiodand, when the close exceeds its valueiperiodbars ago with +DI dominant (and the last arrow was not a buy), places a buy arrow below the low; the symmetric condition places a sell arrow above the high. The direction latch prevents consecutive arrows of the same side.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KDJIndicator[source]¶
Bases:
IndicatorIndicator class implementing the custom KDJ oscillator.
- Lines:
kdc (Line): Output difference line (%K - %D). rsv (Line): Raw Stochastic Value line. k (Line): Smoothed %K line. d (Line): Smoothed %D line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KwanCccIndicator[source]¶
Bases:
IndicatorCustom Kwan CCC technical indicator.
- Lines:
kwan (LineSeries): Smoothed combination of Chaikin, CCI, and Momentum. direction (LineSeries): Directional momentum flag (0 = bullish, 1 = flat, 2 = bearish).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KwanNrpIndicator[source]¶
Bases:
IndicatorCompute smoothed KWAN_NRP value and direction direction states.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KwanRdpIndicator[source]¶
Bases:
IndicatorCustom Kwan RDP technical indicator.
- Lines:
kwan (LineSeries): Smoothed combination of DeMarker, MFI, and Momentum. direction (LineSeries): Directional momentum flag (0 = bullish, 1 = flat, 2 = bearish).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerreAdxIndicator[source]¶
Bases:
IndicatorLaguerre-filtered ADX directional components built from +/- DI.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerreFilterIndicator[source]¶
Bases:
IndicatorLaguerre smoothing indicator with finite impulse response fallback lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerrePlusDiProxy[source]¶
Bases:
IndicatorLaguerre-style +DI proxy normalized to the 0..1 range.
Approximates the directional-movement balance used by the original EA by computing positive/negative directional movement and true range over the lookback period and emitting the normalized +DI share.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerreRocIndicator[source]¶
Bases:
IndicatorLaguerre ROC indicator emitting value, midline, and color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LeManSignalIndicator[source]¶
Bases:
IndicatorReconstructs LeManSignal from its MQ5 source.
Compares two consecutive LPeriod-window high/low ranges shifted by 1 bar and by LPeriod bars to detect breakouts. buy_arrow: H3<=H4 && H1>H2 (high range expansion upward) sell_arrow: L3>=L4 && L1<L2 (low range expansion downward)
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LinearRegSlopeV2Indicator[source]¶
Bases:
IndicatorIndicator that computes a linear-regression slope proxy and trigger line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LocoIndicator[source]¶
Bases:
IndicatorLoco follow-through line with a binary bullish/bearish color flag.
Tracks the applied price and produces a
locoline plus acolorflag (0 = bullish, 1 = bearish) that flips when price reverses its run of higher or lower readings.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LRMAIndicator[source]¶
Bases:
IndicatorLinear regression moving average projected to the latest bar.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ChangeOfVolatilityIndicator[source]¶
Bases:
IndicatorRatio of short- to long-window momentum dispersion (as a percentage).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VininITrendLRMAIndicator[source]¶
Bases:
IndicatorTrend oscillator scoring LRMA against a fan of moving averages.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LsmaAngleIndicator[source]¶
Bases:
IndicatorCompute LSMA slope angle and map it to a color-state indicator.
The indicator evaluates two least-squares MAs at different shifts and uses the angle and trend persistence to classify bullish/bearish momentum states.
- Parameters:
lsma_period – Look-back window used for each LSMA estimate.
angle_threshold – Threshold used to classify the angle magnitude.
start_shift – Shift index for the start LSMA sample.
end_shift – Shift index for the end LSMA sample.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.MARoundingChannelIndicator[source]¶
Bases:
IndicatorIndicator that derives rounded moving-average centerline and channel bounds.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.Macd2Indicator[source]¶
Bases:
IndicatorMACD-derived indicator carrying cloud and histogram state for MACD-2.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.MacdCandleIndicator[source]¶
Bases:
IndicatorMACD-based candle indicator returning open/high/low/close values.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.MalrIndicator[source]¶
Bases:
IndicatorCompute MALR trend channels used for breakout-trigger detection.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.MomentumCandleSignIndicator[source]¶
Bases:
IndicatorEmit ATR-offset buy/sell dots on open/close momentum crossovers.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.MovingAverageFNIndicator[source]¶
Bases:
IndicatorFIR moving average built from named filter coefficients plus smoothing.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.Mt5StochasticCloseClose[source]¶
Bases:
IndicatorClose-close based Smoothed Stochastic oscillator implementation.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.MUVNorDiffCloudIndicator[source]¶
Bases:
IndicatorCalculate normalized DIFF cloud signals used by the strategy.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.NonLagDotIndicator[source]¶
Bases:
IndicatorReconstructs NonLagDot from its MQ5 source.
Applies a weighted cosine kernel over SMA values to produce a non-lag MA, then assigns color: 0=gray, 1=magenta(down), 2=green(up).
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute smoothed value and trend color for current bar.
The method calculates weighted SMA contributions, applies optional filtering, and updates nlm and color lines.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.NRTRExtrIndicator[source]¶
Bases:
IndicatorReconstructs NRTR_extr indicator from its MQ5 source.
Same as NRTR but uses high/low extremes instead of close for price tracking. In uptrend: price = max(price, high[bar]); check close < value. In downtrend: price = min(price, low[bar]); check close > value. On flip up: price = low[bar], value = price*(1-dK). On flip down: price = high[bar], value = price*(1+dK).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.NRTRIndicator[source]¶
Bases:
IndicatorReconstructs NRTR indicator from its MQ5 source.
Uses iPeriod average range to compute dK scaling factor. Tracks price (close-based) and value with trend ratchet. When close drops below value in uptrend → flip to downtrend. When close rises above value in downtrend → flip to uptrend. 4 buffers: TrendUp(0), TrendDown(1), SignUp(2), SignDown(3).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PChannelSystem[source]¶
Bases:
IndicatorIndicator that classifies current bar position versus rolling channel bounds.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PercentEnvelope[source]¶
Bases:
IndicatorPercent envelope built from a moving-average midpoint.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PercentageCrossoverChannel[source]¶
Bases:
IndicatorPercent-based dynamic channel indicator.
The middle line is gradually adjusted toward current price with separate upper/lower bands derived from the configured percentage distance.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PivotZigZagProxy[source]¶
Bases:
IndicatorCompact pivot and zigzag proxy indicator used by the strategy.
It tracks the nearest recent high/low pivot pairs over a configurable depth and emits them as four separate output lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PriceChannelStopIndicator[source]¶
Bases:
IndicatorReconstructs PriceChannel_Stop from its MQ5 source.
- 6 output buffers mapped to lines:
0=DownTrendSignal, 1=DownTrendBuffer, 2=DownTrendLine 3=UpTrendSignal, 4=UpTrendBuffer, 5=UpTrendLine
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.PriceExtremeChannel[source]¶
Bases:
IndicatorCustom indicator calculating local highest highs and lowest lows.
- Lines:
upper (Line): Channel upper boundary. lower (Line): Channel lower boundary.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.QQECloudIndicator[source]¶
Bases:
IndicatorIndicator computing smoothed QQE-like trend values from RSI.
- Parameters:
rsi_period – RSI lookback period.
sf – Smoothing factor for XRSI and momentum smoothers.
darfactor – ATR-like factor used to offset trailing reference.
xma_method – Moving-average method alias used for RSI smoothing.
xphase – Unused legacy parameter preserved for compatibility.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RaviIndicator[source]¶
Bases:
IndicatorRAVI oscillator: percentage spread between a fast and slow EMA of close.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RawCloseCloseStochastic[source]¶
Bases:
IndicatorRaw close-based Stochastic (%K numerator) over a close-only window.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized raw close-based Stochastic over the array index range.
- Parameters:
start – Start index (inclusive) of the range to compute.
end – End index (exclusive) of the range to compute.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.CloseCloseEmaStochastic[source]¶
Bases:
IndicatorEMA-smoothed close-based Stochastic exposing
percKandpercD.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RDTrendTriggerIndicator[source]¶
Bases:
IndicatorCustom indicator that derives normalized range-trend trigger values.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RenkoLevel[source]¶
Bases:
IndicatorFixed-brick Renko level tracker emitting upper/lower levels and color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RenkoLineBreak[source]¶
Bases:
IndicatorIndicator that models renko-like box transitions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RFTLIndicator[source]¶
Bases:
IndicatorIndicator that computes a weighted RFTL value from weighted close history.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RKDIndicator[source]¶
Bases:
IndicatorCompute a custom RKD line set from RSV/K/D values.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ROC2VGIndicator[source]¶
Bases:
IndicatorReconstructs ROC2_VG indicator.
DRAW_FILLING between ROC1 and ROC2. Buffer 0 = ROC1 (period1, type1), Buffer 1 = ROC2 (period2, type2).
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RSIHistogramIndicator[source]¶
Bases:
IndicatorCompute RSI values and convert to a three-state color histogram.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RSISlowdown[source]¶
Bases:
IndicatorRSI Slowdown — detects RSI extreme flattening as reversal signal.
Fires buy when RSI(2) >= level_max (overbought) and the change between consecutive bars is small (slowdown). Fires sell symmetrically at level_min (oversold). Signal lines store ATR-scaled price levels.
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute RSI slowdown signal for the current bar.
Sets buy/sell lines to ATR-derived price levels when the RSI extreme + slowdown condition is met, or NaN otherwise.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RsiomaV2[source]¶
Bases:
IndicatorRSIOMA V2 indicator: an RSI of smoothed price with an EMA signal line.
The price close is smoothed with an EMA (optionally transformed by a Momentum step), an RSI is computed on that series to form the rsioma line, and the rsioma is smoothed again with an EMA to form the signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RVIHistogramIndicator[source]¶
Bases:
IndicatorRelative Vigor Index with a smoothed signal line and color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SafeADX[source]¶
Bases:
IndicatorADX indicator implementation without division by zero pitfalls.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SafeAMA[source]¶
Bases:
IndicatorAdaptive moving average indicator with safe initialization.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SkyscraperFixIndicator[source]¶
Bases:
IndicatorChannel-like adaptive indicator emitting buy/sell buffers and color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SkyscraperFixDuplexIndicator[source]¶
Bases:
IndicatorIndicator for directional buffer-based skyline reversals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SkyscraperFixColorAMLIndicator[source]¶
Bases:
IndicatorSkyscraper fix channel indicator producing buy/sell buffers and color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AppliedPriceCCI[source]¶
Bases:
IndicatorCommodity Channel Index computed on an arbitrary applied-price line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorAMLIndicator[source]¶
Bases:
IndicatorFractal-driven adaptive moving line with trend color transitions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorAMLMeanReversionIndicator[source]¶
Bases:
IndicatorAdaptive moving-lowpass indicator for color-state trend capture.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.X2MACandleApprox[source]¶
Bases:
IndicatorTwo-stage moving approximation of candle structure and color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XPeriodCandleColor[source]¶
Bases:
IndicatorSmoothing-based period-candle indicator producing color index.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XPeriodCandleSystemColor[source]¶
Bases:
IndicatorSMA-smoothed candle color indicator with Bollinger Band breakout detection.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AcceleratorOscillator[source]¶
Bases:
IndicatorCompute accelerator oscillator using short and long SMA of median price.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AIAcceleratorOscillator[source]¶
Bases:
IndicatorAccelerator Oscillator indicator computed from Awesome Oscillator.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AdaptiveMarketLevel[source]¶
Bases:
IndicatorAdaptive Market Level indicator using fractal dimension and adaptive smoothing.
The AML line adapts its smoothing alpha based on the measured fractal dimension of the price range, providing faster response in trending markets and slower response in mean-reverting regimes.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AmlIndicator[source]¶
Bases:
IndicatorAdaptive Market Level indicator for backtrader (on-chart version).
Uses the same fractal-range adaptive smoothing logic as AdaptiveMarketLevel but implemented as a Backtrader indicator with minperiod management.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FunctionalAwesomeOscillator[source]¶
Bases:
IndicatorAwesome Oscillator: fast minus slow SMA of the median price.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.AIAwesomeOscillator[source]¶
Bases:
IndicatorAwesome Oscillator indicator using two SMAs on the price midpoint.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodicMDI[source]¶
Bases:
IndicatorCalculate layered EMA histograms used as the Blau Ergodic MDI signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodicMDIClassic[source]¶
Bases:
IndicatorErgodic MDI indicator with up/down/histogram smoothing channels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BrakeExpIndicator[source]¶
Bases:
IndicatorExponential trailing-stop indicator with trend and flip lines.
Maintains an exponential-curve stop that rises while long (and falls while short) from a begin price; when price breaks the stop the direction flips. Exposes the active stop on
up_trend/down_trendlines and direction-flip cues onbuy_signal/sell_signallines.- __init__(*args, **kwargs)¶
- next()[source]¶
Advance the exponential stop and emit trend and flip lines.
Extends the stop along the exponential curve, flips direction (resetting the begin price and extremes) when price breaks the stop, and sets the
up_trend/down_trendlines plusbuy_signal/sell_signalflip cues for the bar.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FlatTrendIndicator[source]¶
Bases:
IndicatorFlat-trend regime indicator combining ADX/DI and Parabolic SAR.
Emits four binary lines (
buy,sell,end_buy,end_sell) that classify each bar’s trend state from the SAR position relative to price and the dominance of the positive over the negative directional indicator.- __init__(*args, **kwargs)¶
- next()[source]¶
Classify the current bar into a buy/sell/end-of-trend state.
Sets exactly one of the four output lines to 1.0 based on whether the SAR sits below price (uptrend context) and whether +DI exceeds -DI.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.FlatTrendDistanceIndicator[source]¶
Bases:
IndicatorVolatility-regime classifier from smoothed ATR and standard-deviation slopes.
Compares the slopes of smoothed ATR and smoothed standard deviation to emit a
stateline flagging rising, falling, or flat volatility.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.IinMASignalIndicator[source]¶
Bases:
IndicatorCross-period MA signal indicator producing buy/sell trigger levels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.KDJ[source]¶
Bases:
IndicatorKDJ (Stochastic) Technical Indicator.
The KDJ indicator is a momentum oscillator that compares a specific closing price of a security to a range of its prices over a certain period of time. It consists of three lines: K, D, and J, where K and D are similar to the Stochastic oscillator, and J is a derivative line.
The indicator is calculated using the StochasticFull indicator as the base, with J calculated as: J = 3*K - 2*D.
- Refactoring Note:
Uses the next() method instead of line binding (self.l.K = self.kd.percD) because line binding has idx synchronization issues in the current architecture.
- lines¶
Tuple containing (‘K’, ‘D’, ‘J’) - the three output lines.
- params¶
Tuple containing configuration parameters: - period (int): Lookback period for Stochastic calculation (default: 9). - period_dfast (int): Fast %D smoothing period (default: 3). - period_dslow (int): Slow %D smoothing period (default: 3).
- kd¶
Internal StochasticFull indicator instance.
- Type:
- __init__(*args, **kwargs)¶
- next()[source]¶
Calculate KDJ values for the current bar.
Updates the K, D, and J lines based on the underlying StochasticFull indicator values. The J line is derived from K and D using the formula: J = 3*K - 2*D.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerreIndicator[source]¶
Bases:
IndicatorLaguerre RSI-style oscillator over a four-stage Laguerre filter.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.LaguerreColorIndicator[source]¶
Bases:
IndicatorEhlers Laguerre RSI oscillator with high/low colour-state transitions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.RelativeVigorIndex[source]¶
Bases:
IndicatorRelative Vigor Index (RVI) with its 4-point symmetric signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SmoothedRelativeVigorIndex[source]¶
Bases:
IndicatorRelative Vigor Index indicator with smoothed signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SafeCCI[source]¶
Bases:
IndicatorSafe Commodity Channel Index indicator with guarded zero-variance handling.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SafeCCIWithFactor[source]¶
Bases:
IndicatorCCI indicator with mean deviation, returning 0.0 when denominator is zero.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SilverTrendSignalProxy[source]¶
Bases:
IndicatorSilverTrend buy/sell signal proxy based on a moving-average crossover.
Emits a non-zero
buy(orsell) value when price crosses above (or below) a risk-scaled simple moving average, mirroring the EA’s signal lines.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SilverTrendDirectionSignalProxy[source]¶
Bases:
IndicatorProxy indicator emitting +1/-1 on SMA crossover direction flips.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SidusIndicator[source]¶
Bases:
IndicatorReconstructs Sidus indicator from its MQ5 source.
Uses 4 MAs: FastEMA, SlowEMA, FastLWMA, SlowLWMA + ATR(15). Buy arrows on: FastLWMA crosses above SlowLWMA, or SlowLWMA crosses above SlowEMA. Sell arrows on reverse crosses. Arrow offset = ATR * digit scaling.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SilverTrendIndicator[source]¶
Bases:
IndicatorReconstructs SilverTrend_Signal from its MQ5 source.
Uses SSP-period average range to compute smin/smax bands. K = RISK * 100. smin = SsMin + (SsMax - SsMin) * K / 100 smax = SsMax - (SsMax - SsMin) * K / 100 Trend toggles: close < smin → downtrend, close > smax → uptrend. Buy arrow on uptrend toggle, sell arrow on downtrend toggle.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SlidingRangeColor[source]¶
Bases:
IndicatorIndicator computing sliding-window average range channels with a color index for breakout direction.
- next()[source]¶
Compute rounded average of recent highs/lows and set color based on close relative to the range.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.SlowStoch[source]¶
Bases:
IndicatorEMA-smoothed slow stochastic exposing an oscillator and a signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SmoothedADXIndicator[source]¶
Bases:
IndicatorADX/DI system with each line smoothed by a configurable moving average.
Computes raw +DI, -DI and ADX over
adx_periodand exposes moving-average smoothed versions on theplus_di,minus_diandadxlines.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SmoothedRsi[source]¶
Bases:
IndicatorSmooth RSI value using an outer simple moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SpearmanRankCorrelationHistogram[source]¶
Bases:
IndicatorCompute a Spearman-rank-style correlation histogram and regime color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.StalinIndicator[source]¶
Bases:
IndicatorReconstructs Stalin indicator from its MQ5 source.
Uses Fast/Slow MA crossover with optional RSI filter. BU() fires buy arrow at low if flat distance check passes. BD() fires sell arrow at high if flat distance check passes. Optional Confirm parameter adds a price-distance confirmation step.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.StarterLaguerreFilter[source]¶
Bases:
IndicatorLaguerre filter oscillator bounded in the [0, 1] range.
Implements Ehlers’ four-stage Laguerre filter and converts the staged values into a normalised oscillator. Readings near 0 indicate oversold conditions and readings near 1 indicate overbought conditions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.StepMANRTRIndicator[source]¶
Bases:
IndicatorReconstructs StepMA_NRTR indicator.
StepSizeCalc: Volty-based step size from ATR-like calculation. StepMACalc: Trend-following MA with NRTR ratchet. 4 buffers: UpBuffer(0), DnBuffer(1), BuySignal(2), SellSignal(3). Buy when trend flips from down to up. Sell on reverse.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.StochasticHistogramIndicator[source]¶
Bases:
IndicatorStochastic-based indicator with a smoothed main line, signal line, and color state.
The indicator outputs: -
main: smoothed %K values. -signal: smoothed trigger line derived from main. -hist_base: fixed base reference line (50.0). -color_state: 0 for overbought, 1 for neutral, 2 for oversold.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3AlarmIndicator[source]¶
Bases:
IndicatorDouble-smoothed MA slope indicator emitting direction and reversal alarms.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorised batch evaluation of direction and alarm lines.
- Parameters:
start – Inclusive start index of the range to fill.
end – Exclusive end index of the range to fill.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3Average[source]¶
Bases:
IndicatorTillson T3 moving average built from a six-stage EMA cascade.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3Trix[source]¶
Bases:
IndicatorTRIX-style oscillator built from fast and slow T3 rate-of-change lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3Indicator[source]¶
Bases:
IndicatorTillson T3 moving average — six cascaded EMAs with volume factor.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.The20sV020Signal[source]¶
Bases:
IndicatorReversal signal from prior-bar 20% zones with an ATR-offset entry.
- __init__(*args, **kwargs)¶
- next()[source]¶
Emit buy/sell signal levels from the prior-bar 20% zone logic.
Resets both lines to zero, and once enough bars exist computes the prior-bar range, its upper/lower 20% zones, and the ATR. Under MODE_1 it flags a reversal when the previous bar spans the band and the current bar breaks beyond it by the level threshold; under MODE_2 it uses a three-bar expansion-then-inside pattern. The
directflag optionally swaps the buy and sell outputs.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ThreeCandlesIndicator[source]¶
Bases:
IndicatorIndicator producing three-candle reversal signal labels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ThreeLineBreakIndicator[source]¶
Bases:
IndicatorThree Line Break indicator used as a higher-timeframe trend signal source.
The indicator tracks a directional swing state based on the last
lines_breakbars. A bearish-to-bullish and bullish-to-bearish shift is confirmed by breakouts above the recent highs or below the recent lows.Output lines: -
trend:1.0for bullish trend,0.0for bearish trend. -line_high: current bar high value. -line_low: current bar low value.- __init__(*args, **kwargs)¶
- next()[source]¶
Advance the Three Line Break trend and output the current trend lines.
- Returns:
None.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TimeLine[source]¶
Bases:
IndicatorTime average price line indicator
Calculate the cumulative average of the day’s closing prices as the time average price line
- __init__(*args, **kwargs)¶
- next()[source]¶
Calculate the time average price for the current bar.
This method is called for each bar in the data series. It: 1. Appends the current bar’s close price to the day’s price list 2. Calculates the cumulative average of all prices in the list 3. Resets the price list at the end of the trading day
The time average price line is useful for intraday strategies as it represents the average entry price of all market participants throughout the day.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TradingChannelIndexProxy[source]¶
Bases:
IndicatorIndicator computing Trading Channel Index (TCI) and quantized state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TrendArrowsIndicator[source]¶
Bases:
IndicatorReconstructs trend_arrows indicator.
Computes AverageHigh (avg of highest highs over iPeriod sub-windows) and AverageLow (avg of lowest lows over iPeriod sub-windows). TrendUp = LL when close > HH; TrendDown = HH when close < LL; else continues previous trend. SignUp when TrendUp appears fresh; SignDown when TrendDown appears fresh. Buffers: 0=TrendUp, 1=TrendDown, 2=SignUp(buy), 3=SignDown(sell).
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute trend and signal buffers for the current bar.
The method: 1. Splits the lookback window into iperiod sub-windows and averages highs/lows. 2. Generates TrendUp/TrendDown buffers based on close relative to aggregated levels. 3. Emits SignUp/SignDown only on fresh transitions from inactive to active.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TrendContinuationIndicator[source]¶
Bases:
IndicatorMomentum continuation indicator using smoothed up/down directional components.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TrendIntensityIndexProxy[source]¶
Bases:
IndicatorIndicator computing Trend Intensity Index (TII) and quantized state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TrendManagerIndicator[source]¶
Bases:
IndicatorSimple MA-based trend indicator generating color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TriXCandleIndicator[source]¶
Bases:
IndicatorIndicator that transforms TRIX values into a candle-style representation.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TriggerLine[source]¶
Bases:
IndicatorTrigger-line indicator tracking momentum-driven main and signal lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TripleEmaRate[source]¶
Bases:
IndicatorTRIX: the bar-over-bar rate of change of a triple-smoothed EMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TRVIIndicator[source]¶
Bases:
IndicatorTRVI indicator combining price-range velocity with volume-weighted smoothing.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ColorRMACDIndicator[source]¶
Bases:
IndicatorCustom RMACD composite indicator with configurable signal MA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.TwoPbIdealXOSMAIndicator[source]¶
Bases:
IndicatorCompute the smoothed 2pbIdealXOSMA histogram from cascaded ideal-MAs.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.UltraAbsolutelyNoLagLwmaColor[source]¶
Bases:
IndicatorLow-lag LWMA range-position oscillator emitting bulls/bears and color.
Positions a smoothed weighted moving average within its recent high/low range to produce bulls/bears strength lines and a color state encoding their dominance and slope across configurable up/down levels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.UltraWPRIndicator[source]¶
Bases:
IndicatorUltra Williams %R oscillator emitting bulls and bears strength lines.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized batch computation of bulls/bears over a bar range.
- Parameters:
start – Index of the first bar to compute (inclusive).
end – Index just past the last bar to compute (exclusive).
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.UpDownCandleStrength[source]¶
Bases:
IndicatorUp Down Candle Strength Indicator.
This indicator calculates the strength of price movement by measuring the ratio of up candles to down candles over a specified period.
The strength value ranges from 0.0 (all down candles) to 1.0 (all up candles), with 0.5 indicating an equal number of up and down candles.
- lines.strength¶
The calculated strength ratio (0.0 to 1.0).
- params.period¶
The number of periods to analyze for candle strength.
Note
A strength value of 0.5 is returned when there are no clear up or down candles (i.e., all candles have equal open and close prices).
- __init__(*args, **kwargs)¶
- next()[source]¶
Calculate the candle strength ratio for the current bar.
Counts the number of up candles (close > open) and down candles (close < open) over the specified period and calculates the ratio.
- The strength value is calculated as:
strength = up_count / (up_count + down_count)
If no candles have clear directional movement (all open == close), the strength is set to 0.5 (neutral).
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VininITrendIndicator[source]¶
Bases:
IndicatorIndicator that calculates a smoothed trend score from MA comparisons.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.VolumeWeightedMAIndicator[source]¶
Bases:
IndicatorVolume-weighted moving average of an applied price.
Averages the applied price (selected by
ipc) overlengthbars, weighting each bar by its tick volume (or open interest whenuse_tick_volumeis False); falls back to the plain applied price when the total weight is zero.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VolumeWeightedMAStDevIndicator[source]¶
Bases:
IndicatorVolume-weighted MA with standard-deviation graded signal lines.
Computes a volume-weighted moving average (
vwma) and measures the standard deviation of its change. When the latest change exceeds thedk1/dk2standard-deviation bands it sets the correspondingbulls1/bulls2orbears1/bears2signal lines.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VWAPCloseIndicator[source]¶
Bases:
IndicatorReconstructs VWAP_Close indicator.
VWAP = sum(close[i] * volume[i], i=0..n-1) / sum(volume[i], i=0..n-1) Uses tick volume by default. Buffer 0 = VWAP line.
- __init__(*args, **kwargs)¶
- next()[source]¶
Compute and emit the next VWAP-close value.
The calculation uses close*volume weighted average over up to
nprior bars and falls back to the previous VWAP value when volume is not available.
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VWMACandle[source]¶
Bases:
IndicatorVolume-weighted candle color indicator.
Computes volume-weighted moving averages of the open and close over
lengthbars and emits acolorline of 2.0 (bullish), 0.0 (bearish) or 1.0 (neutral) depending on their relationship.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.VWMADigitSystem[source]¶
Bases:
IndicatorDigit-rounded volume-weighted band color indicator.
Builds digit-rounded volume-weighted high and low levels over
lengthbars and emits acolorline encoding whether the close breaks above the upper level or below the lower level, combined with candle direction.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.Wami[source]¶
Bases:
IndicatorCalculate a WAMI-style oscillator and signal line from close-price MAs.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.WPRSISignalIndicator[source]¶
Bases:
IndicatorReconstructs WPRSIsignal indicator from its MQ5 source.
Uses WPR and RSI with same period. Buy: WPR crosses above -20 from below AND RSI > 50, with filterUP lookback confirmation. Sell: WPR crosses below -80 from above AND RSI < 50, with filterDN lookback confirmation.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XDeMarkerHistogramVolDirectIndicator[source]¶
Bases:
IndicatorIndicator that calculates DeMarker histogram zone and direct trend color.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XFisherIndicator[source]¶
Bases:
IndicatorFisher Transform of Williams %R position with an EMA-smoothed signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XCCIHistogramVolDirectIndicator[source]¶
Bases:
IndicatorDirect XCCI histogram indicator producing smoothed value and color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XCCIHistogramVolIndicator[source]¶
Bases:
IndicatorCompute volume-scaled XCCI histogram levels and color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XmaIchimoku[source]¶
Bases:
IndicatorCalculate a smoothed midpoint of selected high/low ranges.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.TwoXmaIchimokuOscillator[source]¶
Bases:
IndicatorCombine two XMA windows into oscillator value and color channels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XMAIshimokuChannelIndicator[source]¶
Bases:
IndicatorCompute XMA-smoothed midpoint channel lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XMAIshimokuLine[source]¶
Bases:
IndicatorSmoothed Ishimoku-style midprice line.
Computes the midpoint of the rolling highest high and lowest low over the up/down periods, then smooths it with the configured moving average over
xlengthto produce a singlexmatrend line.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XMARangeBandsIndicator[source]¶
Bases:
IndicatorMoving-average midline with range-scaled upper and lower bands.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XMACDIndicator[source]¶
Bases:
IndicatorConfigurable MACD indicator with selectable MA methods and price.
Computes the MACD line as the difference of a fast and slow moving average of a chosen applied price, then a signal line by smoothing the MACD. The moving-average type, signal-smoothing type, periods and applied price are all configurable via parameters.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XrsiDeMarkerHistogram[source]¶
Bases:
IndicatorBlend RSI and DeMarker into a smoothed histogram line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XRSIHistogramVolDirectIndicator[source]¶
Bases:
IndicatorSimple direct XRSI histogram indicator that emits color state transitions.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XRSIHistogramVolIndicator[source]¶
Bases:
IndicatorVolume-scaled RSI histogram indicator producing directional color states.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.XRVIIndicator[source]¶
Bases:
IndicatorCompute a custom XRVI oscillator and its smoothed signal line.
The indicator relies on candle body delta normalized by range and applies configurable moving-average methods to build both XRVI and signal streams.
- __init__(*args, **kwargs)¶
- once(start, end)[source]¶
Vectorized XRVI and signal computation used by Backtrader runonce mode.
- Parameters:
start – First bar index to fill into line arrays.
end – Exclusive bar index end bound for computed slices.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ZeroLagMacd[source]¶
Bases:
IndicatorZero-lag MACD indicator using double-smoothed EMA differences.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ZigZagRecentPivotSignal[source]¶
Bases:
IndicatorCustom indicator tracking local pivot age and pivot price breakout channels.
- Lines:
signal (Line): Pivot direction signal line (1 for high, -1 for low). pivot_age (Line): Age of the confirmed pivot in bars. pivot_price (Line): Confirmed pivot price level.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- once(start, end)¶
Implement once using next for batch calculation.
This is used when next is overridden but once is not. It loops through the range and calls next for each step.
- Parameters:
start – Starting index
end – Ending index
- oncestart(start, end)¶
Implement oncestart using nextstart for batch calculation.
This is used when nextstart is overridden but oncestart is not.
- Parameters:
start – Starting index
end – Ending index
- packages = ()¶
- preonce(start, end)¶
Implement preonce using prenext for batch calculation.
This is a generic implementation if prenext is overridden but preonce is not. It loops through the range and calls prenext for each step.
- Parameters:
start – Starting index
end – Ending index
- class backtrader.indicators.contrib.ZPFIndicator[source]¶
Bases:
IndicatorZero Power Flow oscillator (volume-weighted MA spread).
Multiplies a moving average of volume by the gap between a short and a long moving average of an applied price, producing a volume-weighted trend-strength value (
zpf) that oscillates around zero, with symmetricline1/line2envelopes.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶