过滤器参考#

SessionFilter *** ** ** ** ** **

class backtrader.filters.SessionFilter(*args, **kwargs)#

This class can be applied to a data source as a filter and will filter out intraday bars which fall outside of the regular session times (ie: pre/post market data)

This is a “non-simple” filter and must manage the stack of the data (passed during init and __call__)

It needs no “last” method because it has nothing to deliver

SessionFilterSimple *** ** ** ** ** ** ** ** **

class backtrader.filters.SessionFilterSimple(*args, **kwargs)#

This class can be applied to a data source as a filter and will filter out intraday bars which fall outside of the regular session times (ie: pre/post market data)

This is a “simple” filter and must NOT manage the stack of the data (passed during init and __call__)

It needs no “last” method because it has nothing to deliver

Bar Management will be done by the SimpleFilterWrapper class made which is added durint the DataBase.addfilter_simple call

SessionFilller#

class backtrader.filters.SessionFiller(*args, **kwargs)#

Bar Filler for a Data Source inside the declared session start/end times.

The fill bars are constructed using the declared Data Source timeframe and compression (used to calculate the intervening missing times)

Params:

  • fill_price (def: None):

    If None is passed, the closing price of the previous bar will be used. To end up with a bar which for example takes time but it is not displayed in a plot … use float(‘Nan’)

  • fill_vol (def: float(‘NaN’)):

    Value to use to fill the missing volume

  • fill_oi (def: float(‘NaN’)):

    Value to use to fill the missing Open Interest

  • skip_first_fill (def: True):

    Upon seeing the 1st valid bar do not fill from the sessionstart up to that bar

CalendarDays#


BarReplayer_Open

DaySplitter_Close *** ** ** ** ** ** ** **

DaySplitter_Close

HeikinAshi#

HeikinAshi

Renko *** **

Renko