-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Expected Behavior
I think the exit_price in trades should be the adjusted_price.
backtesting.py/backtesting/backtesting.py
Line 873 in b456400
self._close_trade(trade, price, time_index) |
# Order size greater than this opposite-directed existing trade,
# so it will be closed completely
if abs(need_size) >= abs(trade.size):
# I think we shoud use adjusted_price
self._close_trade(trade, adjusted_price, time_index)
need_size += trade.size
else:
# The existing trade is larger than the new order,
# so it will only be closed partially
self._reduce_trade(trade, adjusted_price, need_size, time_index)
need_size = 0
break
Actual Behavior
We are using the price right now. :)
Steps to Reproduce
- Just run a simple strategy
- check the exit_price in stats._trades
- compare with close price at the same
kernc
Metadata
Metadata
Assignees
Labels
No labels