backtrader.indicators.vortex module

Vortex Indicator Module - Vortex trend indicator.

This module provides the Vortex indicator for identifying trend direction and strength.

Classes:

Vortex: Vortex indicator with VI+ and VI- lines.

示例

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

self.vortex = bt.indicators.Vortex(self.data, period=14)

def next(self):

# VI+ crossing above VI- indicates uptrend if self.vortex.vi_plus[0] > self.vortex.vi_minus[0]:

self.buy()

# VI- crossing above VI+ indicates downtrend elif self.vortex.vi_minus[0] > self.vortex.vi_plus[0]:

self.sell()

class backtrader.indicators.vortex.Vortex[源代码]

基类:Indicator

See:
plotlines = <backtrader.metabase.plotlines_obj object>
__init__(*args, **kwargs)
frompackages = ()
packages = ()