DEXFeed#

tradingstrategy.frameworks.backtrader.DEXFeed class.

class DEXFeed[source]#

Bases: PandasData

A Pandas data feed with token metadata added.

This feed serves Backtrader Cerebro engine. It contains only raw OHLVC info.

__init__(pair_info)[source]#
Parameters

pair_info (DEXPair) –

Methods

__init__(pair_info)

addfilter(p, *args, **kwargs)

addfilter_simple(f, *args, **kwargs)

addminperiod(minperiod)

The passed minperiod is fed to the lines

advance([size, datamaster, ticks])

advance_peek()

backwards([size, force])

clone(**kwargs)

compensate(other)

Call it to let the broker know that actions on this asset will compensate open positions in another

copyas(_dataname, **kwargs)

date2num(dt)

do_qcheck(onoff, qlapse)

extend([value, size])

forward([value, size])

get_notifications()

Return the pending "store" notifications

getenvironment()

getfeed()

getwriterheaders()

getwriterinfo()

getwritervalues()

haslivedata()

home()

incminperiod(minperiod)

The passed minperiod is fed to the lines

islive()

If this returns True, Cerebro will deactivate preload and runonce because a live data source must be fetched tick by tick (or bar by bar)

load()

minbuffer(size)

Receive notification of how large the buffer must at least be

next([datamaster, ticks])

Called to calculate values when the minperiod is over

nextstart()

It will be called when the minperiod phase is over for the 1st post-minperiod value.

num2date([dt, tz, naive])

once(start, end)

Called to calculate values at "once" when the minperiod is over

oncestart(start, end)

It will be called when the minperiod phase is over for the 1st post-minperiod value

plotlabel()

preload()

prenext()

It will be called during the "minperiod" phase of an iteration.

preonce(start, end)

It will be called during the "minperiod" phase of a "once" iteration

put_notification(status, *args, **kwargs)

Add arguments to notification queue

qbuffer([savemem, replaying])

Change the lines to implement a minimum size qbuffer scheme

replay(**kwargs)

resample(**kwargs)

reset()

rewind([size])

setenvironment(env)

Keep a reference to the environment

setminperiod(minperiod)

Direct minperiod manipulation.

start()

stop()

updateminperiod(minperiod)

Update the minperiod if needed.

Attributes

CONNBROKEN

CONNECTED

Close

DELAYED

DISCONNECTED

DateTime

High

IndType

LIVE

LineOrder

Low

NOTSUBSCRIBED

NOTSUPPORTED_TF

ObsType

Open

OpenInterest

StratType

UNKNOWN

Volume

alias

aliased

array

csv

datafields

frompackages

packages

replaying

resampling

__init__(pair_info)[source]#
Parameters

pair_info (DEXPair) –

lines#

alias of Lines_LineSeries_DataSeries_OHLC_OHLCDateTime_AbstractDataBase_DataBase_PandasData_DEXFeed