pmorissette / ffn

ffn - a financial function library for Python
pmorissette.github.io/ffn
MIT License
2.03k stars 300 forks source link

How to set risk-free rate ( rf ) when calling df_prices.calc_stats() ? #75

Open ahotrod opened 5 years ago

ahotrod commented 5 years ago

The output of

df_prices.calc_stats()

reports a rf = 0. I'd like to have

df_prices.calc_stats()

include a rf in the calculations. I don't see how to set rf. I've also tried:

ffn.GroupStats(*[df_prices[x] for x in df_prices.columns]).set_riskfree_rate(rf = 1.5)

without success.

jaNGOB commented 4 years ago

I also just had the same problem and figured it out.

perf = pd.DataFrame(df).calc_stats()
perf.set_riskfree_rate(0.011)
perf.display()
fedeheisemberg commented 1 month ago

Thanks!