BRK: Apply spread at trade entry and exit#1375
Conversation
Co-Authored-By: claude-flow <ruv@ruv.net>
|
@nyxst4ck Thanks for picking this up!
Modelling spread as a share of price is somewhat eccentric and variable already. But then "you need to further compute halves" will be a documentation nightmare, leaving the logic all but simple. Spread is property of the instrument and it affects us, in whole, when entering the trade. Then it affects us again when we try to sell the gold! Thus, to be precise, I'm thinking spread should also be accounted for twice. 🤔😳 But this shall break a lot of existing expected values. But breaking spread in half is a decisive no-go. 👎
This is also not how exchanges do. The commission, for what I see, is computed again based on the order value at the time of the transaction.
Fixing 3. proper makes this a no-op. |
Rework the proposed behavior to charge the configured spread at trade entry and exit while retaining per-transaction commission calculation.
fc94f71 to
4670a84
Compare
|
Makes sense, thanks for the detailed explanation. Reworked: spread is now applied in full at both entry and exit ( |
Closes #1335.
Summary
This revision follows the maintainer feedback: the spread is no longer split in half, and the commission accounting changes from the earlier draft have been removed.
Validation
python -m backtesting.test— 81 passed, 1 skippedgit diff --check