Skip to content

Commit 91e5558

Browse files
committed
REF: Plot: Return long/short triangles to P&L section
Revert 3b9a294 REF: Plot: Simplify PL section, circle markers
1 parent 52aa5a0 commit 91e5558

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

backtesting/_plotting.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,10 @@ def _plot_pl_section():
440440
fig.multi_line(xs='lines',
441441
ys=transform('returns', CustomJSTransform(v_func='return [...xs].map(i => [0, i]);')),
442442
source=trade_source, color='#999', line_width=1)
443-
r1 = fig.scatter('index', 'returns', source=trade_source, fill_color=cmap,
444-
marker='circle', line_color='black', size='marker_size')
443+
trade_source.add(np.take(['inverted_triangle', 'triangle'], trades['Size'] > 0), 'triangles')
444+
r1 = fig.scatter(
445+
'index', 'returns', source=trade_source, fill_color=cmap,
446+
marker='triangles', line_color='black', size='marker_size')
445447
tooltips = [("Size", "@size{0,0}")]
446448
if 'count' in trades:
447449
tooltips.append(("Count", "@count{0,0}"))

0 commit comments

Comments
 (0)