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[源代码]¶
基类:
IndicatorCompute a low-lag LWMA proxy based on nested weighted moving averages.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AbsolutelyNoLagLwmaColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AccumulationDistributionLine[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ChaikinOscillator[源代码]¶
基类:
IndicatorChaikin oscillator as EMA(short) minus EMA(long) of ADL.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.LineCCI[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CCIDualOnMA[源代码]¶
基类:
IndicatorProvide fast/slow CCI values computed on a smoothing moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ADXCrossHullStyleIndicator[源代码]¶
基类:
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)[源代码]¶
Vectorized batch computation of up/down signal levels over a range.
- 参数:
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[源代码]¶
基类:
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)[源代码]¶
Vectorized batch computation of smoothed breadth counts over a range.
- 参数:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AIAccelerationDecelerationOscillator[源代码]¶
基类:
IndicatorIndicator computing acceleration/deceleration oscillator from SMA spread.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AltrTrendSignalV22[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AnchoredMomentumLine[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AnchoredMomentumCandleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AnyRangeCldTailIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AroonHornSignIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AroonOscillatorSignAlert[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ArrowsCurvesIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ASCtrendIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AsimmetricStochNRIndicator[源代码]¶
基类:
IndicatorAsymmetric stochastic oscillator indicator with dynamic MA smoothing.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AtrNormalizeHistogram[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AverageChangeCandle[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BBSqueezeIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BezierStDevIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BinaryWaveIndicator[源代码]¶
基类:
IndicatorWeighted indicator that builds a smoothed wave signal from multiple sub-indicators.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Calculate raw and smoothed wave arrays for a range of bars.
- 参数:
start -- Start index for batch evaluation.
end -- End index (exclusive) for batch evaluation.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCMomentumIndicator[源代码]¶
基类:
IndicatorBlau composite momentum: triple-smoothed price-difference oscillator.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCMIIndicator[源代码]¶
基类:
IndicatorCompute the CMI oscillator from nested moving averages of momentum.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauCSI[源代码]¶
基类:
IndicatorBlau CSI indicator built from smoothed momentum vs. range.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodic[源代码]¶
基类:
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[源代码]¶
基类:
IndicatorIndicator generating a smoothed Blau T-Stoch histogram.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauTSStochastic[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BrainTrend2Indicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AbsolutelyNoLagLwmaIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BrainTrendSignalProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BrakeParbIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BreakoutBarsTrendV2[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BSIIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BullsBearsEyes[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BullsPower[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BearsPower[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BWWiseMan1Signal[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.BykovTrendIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CandleStopColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CandlesXSmoothedIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CandlesticksBW[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CaudateXPeriodCandleColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CCIHistogramIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CCIWoodiesIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CenterOfGravityCandleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CenterOfGravityIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CGOscillator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CloseLineCCI[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.Color3rdGenXMAIndicator[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorCoppockIndicator[源代码]¶
基类:
IndicatorCompute Coppock oscillator value and its directional color state.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorHMA[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorJVariationIndicator[源代码]¶
基类:
IndicatorIndicator deriving a custom color variation series from MA residuals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorMetroDeMarkerIndicator[源代码]¶
基类:
IndicatorColour Metro DeMarker indicator: derives fast/slow adaptive trend lines from the DeM oscillator.
- __init__(*args, **kwargs)¶
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorMetroStochasticIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorMetroWprIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorSchaffDeMarkerTrendCycle[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorSchaffTrendCycleIndicator[源代码]¶
基类:
IndicatorCustom indicator producing Schaff Trend Cycle value and color states.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorStepXCCXIndicator[源代码]¶
基类:
IndicatorCompute fast/slow XCCX channel lines for directional step signals.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ColorX2MA[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorXDerivative[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorZerolagDeMarker[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.CorrectedAverageIndicator[源代码]¶
基类:
IndicatorEhlers-style adaptive Corrected Average with event and vectorized modes.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Vectorized corrected-average computation over the array index range.
- 参数:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DemaRangeChannelColor[源代码]¶
基类:
IndicatorIndicator computing DEMA-based upper/lower range channels with a color index for breakout direction.
- __init__(*args, **kwargs)¶
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DerivativeIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DigitalFT01Indicator[源代码]¶
基类:
IndicatorFixed-weight digital filter with a channel trigger for crossover signals.
- __init__(*args, **kwargs)¶
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DigitalMacd[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DonchianChannelsSystem[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.DotsIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.EFDistanceIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.EmaRsiVa[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.EnvelopesJpAlonso[源代码]¶
基类:
IndicatorCompute static upper/lower envelope bands around a simple moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.F2aAOIndicator[源代码]¶
基类:
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()[源代码]¶
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)[源代码]¶
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.- 参数:
start -- First bar index to process.
end -- Stop index (exclusive) for processing.
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.FatlFilter[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.JFatlApprox[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.JFatlCandleApprox[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FiboCandlesIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FineTuningMA[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FisherOrgV1[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FisherOrgV1Sign[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ForceIndexEMA[源代码]¶
基类:
IndicatorIndicator producing a smoothed force index.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ForceDiverSign[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ForceIndexEma[源代码]¶
基类:
IndicatorForce Index (price change times volume) smoothed by an EMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ForecastOscilator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FractalAMAMBK[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FramaSeries[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FramaLinesIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FRASMAv2Indicator[源代码]¶
基类:
IndicatorFractal-adaptive moving average exposing the
frasmaline and slopecolor.- __init__(*args, **kwargs)¶
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.GOIndicator[源代码]¶
基类:
IndicatorIndicator that derives a GO signal from smoothed OHLC components.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.HLRIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ZeroLagHLRIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.HMA[源代码]¶
基类:
IndicatorHull Moving Average indicator used by OsHMA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.OsHMAIndicator[源代码]¶
基类:
IndicatorHistogram indicator that combines fast and slow HMA lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.I4DRFV2[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.I4DRFV3[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IAnchMomIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IDeMarkerSignIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IGapIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IStochKomposterIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ITrendIndicator[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IndexedMovingAverage[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.InstantaneousTrendFilterIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.InverseReactionIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IRSISignIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IWPRSignIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.JBrainTrend1SigIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.UltraRSIIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.JTpoProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.JMASlopeIndicator[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KalmanFilterLine[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KalmanFilterCandleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KAMAIndicator[源代码]¶
基类:
IndicatorKaufman Adaptive Moving Average with both event and vectorized modes.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Vectorized KAMA computation over the array index range.
- 参数:
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[源代码]¶
基类:
IndicatorEMA-smoothed momentum line used by the ColorMomentum_AMA strategy.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.KaracaticaIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KDJIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KwanCccIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KwanNrpIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KwanRdpIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerreAdxIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerreFilterIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerrePlusDiProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerreRocIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LeManSignalIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LinearRegSlopeV2Indicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LocoIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LRMAIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ChangeOfVolatilityIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VininITrendLRMAIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LsmaAngleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.MARoundingChannelIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.Macd2Indicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.MacdCandleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.MalrIndicator[源代码]¶
基类:
IndicatorCompute MALR trend channels used for breakout-trigger detection.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.MomentumCandleSignIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.MovingAverageFNIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.Mt5StochasticCloseClose[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.MUVNorDiffCloudIndicator[源代码]¶
基类:
IndicatorCalculate normalized DIFF cloud signals used by the strategy.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.NonLagDotIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.NRTRExtrIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.NRTRIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PChannelSystem[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PercentEnvelope[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PercentageCrossoverChannel[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PivotZigZagProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PriceChannelStopIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.PriceExtremeChannel[源代码]¶
基类:
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[源代码]¶
基类:
IndicatorIndicator computing smoothed QQE-like trend values from RSI.
- 参数:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RawCloseCloseStochastic[源代码]¶
基类:
IndicatorRaw close-based Stochastic (%K numerator) over a close-only window.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Vectorized raw close-based Stochastic over the array index range.
- 参数:
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[源代码]¶
基类:
IndicatorEMA-smoothed close-based Stochastic exposing
percKandpercD.- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RDTrendTriggerIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RenkoLevel[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RenkoLineBreak[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RFTLIndicator[源代码]¶
基类:
IndicatorIndicator that computes a weighted RFTL value from weighted close history.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.RKDIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ROC2VGIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RSIHistogramIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RSISlowdown[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RsiomaV2[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SafeADX[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SafeAMA[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SkyscraperFixIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SkyscraperFixDuplexIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SkyscraperFixColorAMLIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AppliedPriceCCI[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorAMLIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorAMLMeanReversionIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.X2MACandleApprox[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XPeriodCandleColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XPeriodCandleSystemColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AcceleratorOscillator[源代码]¶
基类:
IndicatorCompute accelerator oscillator using short and long SMA of median price.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AIAcceleratorOscillator[源代码]¶
基类:
IndicatorAccelerator Oscillator indicator computed from Awesome Oscillator.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.AdaptiveMarketLevel[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AmlIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FunctionalAwesomeOscillator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.AIAwesomeOscillator[源代码]¶
基类:
IndicatorAwesome Oscillator indicator using two SMAs on the price midpoint.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodicMDI[源代码]¶
基类:
IndicatorCalculate layered EMA histograms used as the Blau Ergodic MDI signal.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BlauErgodicMDIClassic[源代码]¶
基类:
IndicatorErgodic MDI indicator with up/down/histogram smoothing channels.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.BrakeExpIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FlatTrendIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.FlatTrendDistanceIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.IinMASignalIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.KDJ[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerreIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.LaguerreColorIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.RelativeVigorIndex[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SmoothedRelativeVigorIndex[源代码]¶
基类:
IndicatorRelative Vigor Index indicator with smoothed signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SafeCCI[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SafeCCIWithFactor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SilverTrendSignalProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SilverTrendDirectionSignalProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SidusIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SilverTrendIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SlidingRangeColor[源代码]¶
基类:
IndicatorIndicator computing sliding-window average range channels with a color index for breakout direction.
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.SlowStoch[源代码]¶
基类:
IndicatorEMA-smoothed slow stochastic exposing an oscillator and a signal line.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SmoothedADXIndicator[源代码]¶
基类:
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[源代码]¶
基类:
IndicatorSmooth RSI value using an outer simple moving average.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.SpearmanRankCorrelationHistogram[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.StalinIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.StarterLaguerreFilter[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.StepMANRTRIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.StochasticHistogramIndicator[源代码]¶
基类:
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[源代码]¶
基类:
IndicatorDouble-smoothed MA slope indicator emitting direction and reversal alarms.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Vectorised batch evaluation of direction and alarm lines.
- 参数:
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[源代码]¶
基类:
IndicatorTillson T3 moving average built from a six-stage EMA cascade.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3Trix[源代码]¶
基类:
IndicatorTRIX-style oscillator built from fast and slow T3 rate-of-change lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.T3Indicator[源代码]¶
基类:
IndicatorTillson T3 moving average — six cascaded EMAs with volume factor.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.The20sV020Signal[源代码]¶
基类:
IndicatorReversal signal from prior-bar 20% zones with an ATR-offset entry.
- __init__(*args, **kwargs)¶
- next()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ThreeCandlesIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ThreeLineBreakIndicator[源代码]¶
基类:
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)¶
- 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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TimeLine[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TradingChannelIndexProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TrendArrowsIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TrendContinuationIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TrendIntensityIndexProxy[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TrendManagerIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TriXCandleIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TriggerLine[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TripleEmaRate[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TRVIIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ColorRMACDIndicator[源代码]¶
基类:
IndicatorCustom RMACD composite indicator with configurable signal MA.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.TwoPbIdealXOSMAIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.UltraAbsolutelyNoLagLwmaColor[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.UltraWPRIndicator[源代码]¶
基类:
IndicatorUltra Williams %R oscillator emitting bulls and bears strength lines.
- __init__(*args, **kwargs)¶
- once(start, end)[源代码]¶
Vectorized batch computation of bulls/bears over a bar range.
- 参数:
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[源代码]¶
基类:
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.
备注
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VininITrendIndicator[源代码]¶
基类:
IndicatorIndicator that calculates a smoothed trend score from MA comparisons.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.VolumeWeightedMAIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VolumeWeightedMAStDevIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VWAPCloseIndicator[源代码]¶
基类:
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()[源代码]¶
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VWMACandle[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.VWMADigitSystem[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.Wami[源代码]¶
基类:
IndicatorCalculate a WAMI-style oscillator and signal line from close-price MAs.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.WPRSISignalIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XDeMarkerHistogramVolDirectIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XFisherIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XCCIHistogramVolDirectIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XCCIHistogramVolIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XmaIchimoku[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.TwoXmaIchimokuOscillator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XMAIshimokuChannelIndicator[源代码]¶
基类:
IndicatorCompute XMA-smoothed midpoint channel lines.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XMAIshimokuLine[源代码]¶
基类:
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[源代码]¶
基类:
IndicatorMoving-average midline with range-scaled upper and lower bands.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.XMACDIndicator[源代码]¶
基类:
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[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XRSIHistogramVolDirectIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XRSIHistogramVolIndicator[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.XRVIIndicator[源代码]¶
基类:
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)[源代码]¶
Vectorized XRVI and signal computation used by Backtrader runonce mode.
- 参数:
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[源代码]¶
基类:
IndicatorZero-lag MACD indicator using double-smoothed EMA differences.
- __init__(*args, **kwargs)¶
- frompackages = ()¶
- packages = ()¶
- class backtrader.indicators.contrib.ZigZagRecentPivotSignal[源代码]¶
基类:
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.
- 参数:
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.
- 参数:
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.
- 参数:
start -- Starting index
end -- Ending index
- class backtrader.indicators.contrib.ZPFIndicator[源代码]¶
基类:
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 = ()¶