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).

Example

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[source]

Bases: 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()[source]

Calculate HaDelta during warmup period.

Computes haDelta but not smoothed values during warmup.

nextstart()[source]

Calculate HaDelta and seed smoothed on first valid bar.

Computes haDelta and seeds smoothed with SMA of haDelta values.

next()[source]

Calculate HaDelta and smoothed values for current bar.

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

once(start, end)[source]

Calculate HaDelta and smoothed in runonce mode.

Computes haDelta values and smoothed SMA across all bars.

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

alias of HaDelta

backtrader.indicators.hadelta.haDelta

alias of HaDelta