Plot#

tradeexecutor.state.visualisation.Plot class.

class Plot[source]#

Bases: object

Plot(name: str, kind: tradeexecutor.state.visualisation.PlotKind, colour: Optional[str] = None, points: Dict[int, float] = <factory>)

__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, ...])

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

kind

points

Points of this plot.

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.

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

None