Skip to content

Instantly share code, notes, and snippets.

@samchaaa
Created December 20, 2020 08:30
Show Gist options
  • Save samchaaa/b349c567245a577425ab2296adb24d35 to your computer and use it in GitHub Desktop.
Save samchaaa/b349c567245a577425ab2296adb24d35 to your computer and use it in GitHub Desktop.
# Concat all trades
trades_all = pd.DataFrame()
for x in results:
trades = pd.DataFrame(x['trades'])
trades['sym'] = x['ticker']
trades_all = pd.concat([
trades_all,
trades
], axis=0)
trades_all = trades_all[trades_all['change'] != 0].dropna()
print('sharpe:', sharpe(trades_all['change']))
trades_all['change'].sort_index().cumsum().plot();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment