-
Notifications
You must be signed in to change notification settings - Fork 134
Home
Welcome to the backtrader_plotting wiki!
Every plottable glyph will have a lable which consits of these parts:
{label} ({parameters}) @{datas}
label- Either the classname or the plotname if provided
parameters - a stringified list of the object parameters
datas - a list of all datas this object works on
When using backrader_plotting then plotting configuration can be done totally separately from strategy configuration. The plotting can be configured in the code after the backtest finished running like this:
plotconfig = {
'id:ind#0': dict(
subplot=True,
),
}
b = Bokeh(style='bar', plot_mode='single', scheme=Tradimo(), plotconfig=plotconfig)
cerebro.plot(b)
plotconfig is a dictionary. Every key is an expression that selects one or more entities which plot configuration has to be configured. Each value is another dictionary with attributes that will be assigned to the selected objects.
The key has to be in one of these formats:
-
id:<plotid>- Selects the entitiy with the specifiedplotid -
#:<type>-<n>- Selects the n-th object of type. Type can beiifor indicators,ofor observers ordfor datas -
r:<regex>- A regular expression matching the label of one or more objects
plotaspectratio
Global aspect ratio can be set on the scheme applying to all figures. Individual aspect ratios for specific figures can be overriden though by setting plotaspectratio on a object. It needs to be applied to a plot master object. It will not hae an effect when applied to a slave object.