Skip to content

Commit

Permalink
Merge pull request #1 from EdwardBetts/patch-1
Browse files Browse the repository at this point in the history
use % formatter in string format
  • Loading branch information
thibautx committed May 1, 2016
2 parents 2b5c5cb + afda837 commit f7b077c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions analytics/tears.py
Expand Up @@ -479,8 +479,8 @@ def create_round_trip_tear_sheet(positions, transactions, sector_mappings=None,

print(trades.drop(['open_dt', 'close_dt', 'symbol'],
axis='columns').describe())
print('Percent of round trips profitable = {:.4}%'.format(
(trades.pnl > 0).mean() * 100))
print('Percent of round trips profitable = {:.4%}'.format(
(trades.pnl > 0).mean()))

winning_round_trips = trades[trades.pnl > 0]
losing_round_trips = trades[trades.pnl < 0]
Expand Down

0 comments on commit f7b077c

Please sign in to comment.