Skip to content

Commit

Permalink
Update delta_hedging_env.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiagu committed Oct 27, 2020
1 parent c487242 commit 7e5b71b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gym-rlf/gym_rlf/envs/delta_hedging_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def step(self, action):
new_pos = self._positions[self._step_counts] = max(min(old_pos + ac, 0), -OptionSize)
new_price = self._prices[self._step_counts] = self._next_price(old_price)
new_option_price = self._option_prices[self._step_counts] =\
BSM_call_price_and_delta(S0, self._L - self._step_counts, new_price, sigma_dh)[0]
BSM_call_price_and_delta(S0, self._L + 1 - self._step_counts, new_price, sigma_dh)[0]

trade = new_pos - old_pos
cost = self._costs[self._step_counts] = TickSize * (abs(trade) + .01 * trade**2)
Expand Down

0 comments on commit 7e5b71b

Please sign in to comment.