Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 91e5558

Browse filesBrowse 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
Copy full SHA for 91e5558

1 file changed

+4-2Lines changed: 4 additions & 2 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎backtesting/_plotting.py‎

Copy file name to clipboardExpand all lines: backtesting/_plotting.py
+4-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.