-
Notifications
You must be signed in to change notification settings - Fork 4
VectrBT CheatSheet
David Brazda edited this page Jun 4, 2024
·
11 revisions
- MAKE_SUBPLOT Definovat layout
fig = vbt.make_subplots(rows=2, cols=1, shared_xaxes=True,
# specs=[[{"secondary_y": True}], [{"secondary_y": False}]],
# vertical_spacing=0.02, subplot_titles=("Price and Indicators", "Volume"))
- ADD_TRACE_KWARGS - definuje umisteni do subpotu
add_trace_kwargs=dict(secondary_y=False,row=1, col=1)
- TRACE_KWARGS - ostatni stylujici atributy pro dany trace
trace_kwargs=dict(name="LONGS",
line=dict(color="#ffe476"),
marker=dict(color="limegreen"),
fill=None,
connectgaps=True)
fig = vbt.make_subplots(rows=2, cols=1, shared_xaxes=True,
specs=[[{"secondary_y": True}], [{"secondary_y": False}]],
vertical_spacing=0.02, subplot_titles=("Price and Indicators", "Volume"))
# Plotting the close price
close.vbt.plot(fig=fig, add_trace_kwargs=dict(secondary_y=False,row=1, col=1), trace_kwargs=dict(line=dict(color="blue")))