Skip to content

Commit

Permalink
Merge pull request #23 from git-it/patch-1
Browse files Browse the repository at this point in the history
fixes datetime converstion issue ( issue #22)
  • Loading branch information
ematvey authored Aug 19, 2019
2 parents a54975a + 49a1eeb commit de6878d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pybacktest/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def mcmdd(eqd, runs=100, quantile=0.99, array=False):


def holding_periods(eqd):
# rather crude, but will do
return pd.Series(eqd.index.to_datetime(), index=eqd.index, dtype=object).diff().dropna()

# rather crude, but will do...
return pd.Series(pd.to_datetime(eqd.index), index=eqd.index, dtype=object).diff().dropna()

def performance_summary(equity_diffs, quantile=0.99, precision=4):
def _format_out(v, precision=4):
Expand Down

0 comments on commit de6878d

Please sign in to comment.