Plot#

tradeexecutor.state.visualisation.Plot class.

class Plot[source]#

Bases: object

Descibe singe plot on a strategy.

Plot is usually displayed as an overlay line over the price chart. E.g. simple moving average over price candles.

__init__(name, kind, colour=None, points=<factory>)#
Parameters
Return type

None

Methods

__init__(name, kind[, colour, points])

add_point(timestamp, value)

from_dict(kvs, *[, infer_missing])

from_json(s, *[, parse_float, parse_int, ...])

get_last_value()

Assume points is an ordered dict.

schema(*[, infer_missing, only, exclude, ...])

to_dict([encode_json])

to_json(*[, skipkeys, ensure_ascii, ...])

Attributes

colour

One of Plotly colour names https://community.plotly.com/t/plotly-colours-list/11730/2

name

Name of this plot

kind

What kind of a plot we are drawing

points

Points of this plot.

name: str#

Name of this plot

kind: PlotKind#

What kind of a plot we are drawing

colour: Optional[str] = None#

One of Plotly colour names https://community.plotly.com/t/plotly-colours-list/11730/2

points: Dict[int, float]#

Points of this plot.

TODO: Because we cannot use datetime.datetime directly as a key in JSON, we use UNIX timestamp here to keep our state easily serialisable.

get_last_value()[source]#

Assume points is an ordered dict.

Return type

float

__init__(name, kind, colour=None, points=<factory>)#
Parameters
Return type

None