Skip to content

Commit

Permalink
consider the cash's interest
Browse files Browse the repository at this point in the history
  • Loading branch information
shrektan committed Jan 29, 2023
1 parent d9cfa4b commit da94465
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions delta_hedge.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ def rebalance(self) -> None:
return None
self.call_option.spot = self.asset_price
self.call_option.expire(self.step)
# add risk free interest (this is a must or the result would be biased
# to the risk free rate, as it's reflected in the option price)
self.cash *= 1.0 + self.call_option.rf / TRADING_DAYS_PER_YEAR * self.step
self.call_cash *= 1.0 + self.call_option.rf / TRADING_DAYS_PER_YEAR * self.step
# at the first EOP, it buys call then stay
if self.reb_count == 1:
self.call_qty = self.target_qty
Expand Down

0 comments on commit da94465

Please sign in to comment.