Skip to content

Commit

Permalink
Adds printing of results per year when using ticker command
Browse files Browse the repository at this point in the history
  • Loading branch information
quant@alpacka committed Jan 25, 2023
1 parent 490438a commit 48dded2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ def get_history(symbol):

df = get_history(args.symbol)
print("Symbol: {}".format(args.symbol))
print("Start: {}".format(df.head(1).index[0]))
print("Start: {}".format(df.head(1).index[0]))
pct_change = df.Close.resample('A').last().pct_change().dropna() * 100
print(pct_change.to_string(float_format=lambda x: "{:.1f} %".format(x)))

0 comments on commit 48dded2

Please sign in to comment.