backtrader.indicators.hadelta module

HaDelta Indicator Module - Heikin Ashi Delta indicator.

This module provides the HaDelta indicator defined by Dan Valcu for measuring Heikin Ashi candle body differences.

Classes:

HaDelta: Heikin Ashi Delta indicator (aliases: haD, haDelta).

示例

class MyStrategy(bt.Strategy):
def __init__(self):

self.hadelta = bt.indicators.HaDelta(self.data)

def next(self):
if self.hadelta.smoothed[0] > 0:

self.buy()

class backtrader.indicators.hadelta.HaDelta[源代码]

基类:Indicator

Heikin Ashi Delta. Defined by Dan Valcu in his book "Heikin-Ashi: How to Trade Without Candlestick Patterns ".

This indicator measures the difference between Heikin Ashi close and open of Heikin Ashi candles, the body of the candle.

To get signals add haDelta smoothed by 3 period moving average.

For correct use, the data for the indicator must have been previously passed by the Heikin Ahsi filter.

Formula:
  • HaDelta = Heikin Ashi close - Heikin Ashi open

  • smoothed = movav(haDelta, period)

alias = ('haD',)
plotinfo = <backtrader.metabase.plotinfo_obj object>
plotlines = <backtrader.metabase.plotlines_obj object>
__init__(*args, **kwargs)
prenext()[源代码]

Calculate HaDelta during warmup period.

Computes haDelta but not smoothed values during warmup.

nextstart()[源代码]

Calculate HaDelta and seed smoothed on first valid bar.

Computes haDelta and seeds smoothed with SMA of haDelta values.

next()[源代码]

Calculate HaDelta and smoothed values for current bar.

haDelta = ha_close - ha_open smoothed = SMA(haDelta, period)

once(start, end)[源代码]

Calculate HaDelta and smoothed in runonce mode.

Computes haDelta values and smoothed SMA across all bars.

frompackages = ()
packages = ()
backtrader.indicators.hadelta.haD

HaDelta 的别名

backtrader.indicators.hadelta.haDelta

HaDelta 的别名