decomposing algo daily returns, excluding return earned from treasury interest

8 views
Skip to first unread message

Justin Lent

unread,
Sep 8, 2016, 3:54:53 PM9/8/16
to Zipline Python Opensource Backtester
A couple of questions on how to decompose an algo's daily returns:

1)  Looking through the backtest result dataframe it isn't clear how to generate a returns timeseries that excludes the interest earned from treasury interest.  Also, shouldn't this daily percent return earned from interest show up in the ending_cash value on a daily basis? Does it only get added to ending_cash at certain points in time, such as the first of every month?

2)  How is the daily interest rate being calculated that get's applied to the daily return?  Is it as simple as the treasury_period_return column divided by 365, or is it computed more accurately as:   pow(1.+my_backtest.treasury_period_return, 1./365) - 1.

I'm assuming the values in the treasury_return column is the *annual* treasury interest rate on that particular day so it needs be de-annualized to a daily return before being multiplied by the starting_cash balance to determine the interest earned that particular day.  Does this sound right?


3)  As well, how do I see when dividends hit the cash account?  I see a 'cash_flow' field described in the doc string in period.py but don't see it available anywhere:
cash_flow "the cash flow in the period (negative means spent) from buying and selling assets in the period. Includes dividend payments in the period as well. " Thanks! Justin
Reply all
Reply to author
Forward
0 new messages