backtrader.indicators.accdecoscillator module

Acceleration/Deceleration Oscillator Module - AC indicator.

This module provides the Acceleration/Deceleration Oscillator (AC) developed by Bill Williams to measure the acceleration of driving force.

Classes:

AccelerationDecelerationOscillator: AC indicator (alias: AccDeOsc).

Example

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

self.ac = bt.indicators.AccDeOsc(self.data)

def next(self):
if self.ac.accde[0] > 0 and self.ac.accde[-1] < 0:

self.buy()

class backtrader.indicators.accdecoscillator.AccelerationDecelerationOscillator[source]

Bases: Indicator

Acceleration/Deceleration Technical Indicator (AC) measures acceleration and deceleration of the current driving force. This indicator will change the direction before any changes in the driving force, which, it its turn, will change its direction before the price.

Formula:
  • AcdDecOsc = AwesomeOscillator - SMA(AwesomeOscillator, period)

See:
alias = ('AccDeOsc',)
plotlines = <backtrader.metabase.plotlines_obj object>
__init__(*args, **kwargs)
next()[source]

Calculate AC for the current bar.

Formula: AC = AO - SMA(AO, period)

once(start, end)[source]

Calculate AC in runonce mode.

Calculates AC = AO - SMA(AO, period) for all bars.

frompackages = ()
packages = ()
backtrader.indicators.accdecoscillator.AccDeOsc

alias of AccelerationDecelerationOscillator