backtrader.feeds.vchart module

Visual Chart Binary Data Feed Module - VisualChart binary files.

This module provides the VChartData feed for reading VisualChart binary on-disk data files.

Classes:

VChartData: Reads VisualChart binary data files.

Example

>>> data = bt.feeds.VChartData(dataname='data.fd')
>>> cerebro.adddata(data)
class backtrader.feeds.vchart.VChartData[source]

Bases: DataBase

Support for Visual Chart binary on-disk files for both daily and intradaily formats.

Note

  • dataname: to file or open file-like an object

    If a file-like object is passed, the timeframe parameter will be used to determine which is the actual timeframe.

    Else the file extension (.fd for daily and .min for intraday) will be used.

__init__(*args, **kwargs)

Initialize a LineMultiple instance.

Sets up the internal state for managing multiple lines, including line type indicator, lines collection, clock reference, and line iterator tracking.

Initializes:

_ltype: Line type indicator (None for base LineMultiple). lines: Collection of line objects (creates if not exists). _clock: Clock reference for synchronization. _lineiterators: Dictionary tracking registered lineiterators. _minperiod: Minimum period requirement (defaults to 1).

start()[source]

Start the VChart data feed.

Opens the VisualChart binary file for reading.

stop()[source]

Stop the VChart data feed.

Closes the open file handle.

frompackages = ()
packages = ()
class backtrader.feeds.vchart.VChartFeed[source]

Bases: FeedBase

VisualChart feed class.

Wrapper class for VChartData feed functionality.

DataCls

alias of VChartData

params = (('basepath', ''), ('period', 14), ('movav', None), ('_movav', None), ('lookback', 1), ('upperband', 70.0), ('lowerband', 30.0), ('safediv', False), ('safepct', False), ('fast', 5), ('slow', 34), ('signal', 9), ('mult', 2.0), ('matype', 0), ('dataname', None), ('name', ''), ('compression', 1), ('timeframe', 5), ('fromdate', None), ('todate', None), ('sessionstart', None), ('sessionend', None), ('filters', []), ('tz', None), ('tzinput', None), ('qcheck', 0.0), ('calendar', None))