backtrader.filters.heikinashi module¶
Heikin Ashi Filter Module - Heikin Ashi candlestick filter.
This module provides the HeikinAshi filter for remodeling price data into Heikin Ashi candlesticks.
- Classes:
HeikinAshi: Creates Heikin Ashi candlesticks.
示例
>>> data = bt.feeds.GenericCSVData(dataname='data.csv')
>>> data.addfilter(bt.filters.HeikinAshi())
>>> cerebro.adddata(data)
- class backtrader.filters.heikinashi.HeikinAshi[源代码]¶
基类:
objectThe filter remodels the open, high, low, close to make HeikinAshi candlesticks
- See:
- __init__(data)[源代码]¶
Initialize the HeikinAshi filter.
- 参数:
data -- The data feed to apply the filter to. No specific parameters are required.
- __call__(data)[源代码]¶
Convert standard OHLC data to Heikin Ashi candlesticks.
This method transforms the OHLC data into Heikin Ashi format, which uses the average of open, high, low, and close for the close price, and averages the previous close and open for the current open price.
- 参数:
data -- The data feed containing OHLC values to convert.
- 返回:
False (the length of data stream is unaltered).
- 返回类型: