Skip to content

Commit

Permalink
Merge pull request #430 from 0xEljh/master
Browse files Browse the repository at this point in the history
add relative tolerance to allocate outlay check
  • Loading branch information
timkpaine authored Dec 1, 2023
2 parents 2b4c87b + e949e06 commit 2c6a203
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,7 @@ def allocate(self, amount, update=True):
i = 0
last_q = q
last_amount_short = full_outlay - amount
while not np.isclose(full_outlay, amount, rtol=0.0) and q != 0:
while not np.isclose(full_outlay, amount, rtol=TOL) and q != 0:
dq_wout_considering_tx_costs = (full_outlay - amount) / (self._price * self.multiplier)
q = q - dq_wout_considering_tx_costs

Expand Down

0 comments on commit 2c6a203

Please sign in to comment.