backtrader.indicators.awesomeoscillator module¶
Awesome Oscillator Module - AO momentum indicator.
This module provides the Awesome Oscillator (AO) developed by Bill Williams to measure market momentum.
- Classes:
AwesomeOscillator: Awesome Oscillator indicator (aliases: AwesomeOsc, AO).
示例
- class MyStrategy(bt.Strategy):
- def __init__(self):
self.ao = bt.indicators.AO(self.data)
- def next(self):
- if self.ao.ao[0] > 0 and self.ao.ao[-1] < 0:
self.buy()
- class backtrader.indicators.awesomeoscillator.AwesomeOscillator[源代码]¶
基类:
IndicatorAwesome Oscillator (AO) is a momentum indicator reflecting the precise changes in the market driving force, which helps to identify the trend's strength up to the points of formation and reversal.
- Formula:
median price = (high + low) / 2
AO = SMA (median price, 5)- SMA (median price, 34)
- See:
- alias = ('AwesomeOsc', 'AO')¶
- plotlines = <backtrader.metabase.plotlines_obj object>¶
- __init__(*args, **kwargs)¶
- next()[源代码]¶
Calculate AO for the current bar.
Formula: AO = SMA(median_price, fast) - SMA(median_price, slow)
- frompackages = ()¶
- packages = ()¶
- backtrader.indicators.awesomeoscillator.AwesomeOsc¶
- backtrader.indicators.awesomeoscillator.AO¶