Closed AlexTheLion123 closed 6 months ago
see test_synthetic_data_backtest_stop_loss
test_synthetic_data_backtest_stop_loss
https://github.com/tradingstrategy-ai/trade-executor/blob/2988f1d8f0085186666c388dd6f0f4783db07e49/tests/backtest/test_backtest_position_trigger.py#L459-L460
The number of trades here should be 62 since all the positions are closed (add assert len([p for p in state.portfolio.get_all_positions() if p.is_closed()] == 31 to confirm)
62
assert len([p for p in state.portfolio.get_all_positions() if p.is_closed()] == 31
Same concept
https://github.com/tradingstrategy-ai/trade-executor/blob/2988f1d8f0085186666c388dd6f0f4783db07e49/tests/backtest/test_backtest_position_trigger.py#L643-L644
This also happens for the number of stop losses and take profits if it happens on the last cycle
# trades = # closed positions * 2
Background
Example 1
see
test_synthetic_data_backtest_stop_loss
https://github.com/tradingstrategy-ai/trade-executor/blob/2988f1d8f0085186666c388dd6f0f4783db07e49/tests/backtest/test_backtest_position_trigger.py#L459-L460
The number of trades here should be
62
since all the positions are closed (addassert len([p for p in state.portfolio.get_all_positions() if p.is_closed()] == 31
to confirm)Example 2
Same concept
https://github.com/tradingstrategy-ai/trade-executor/blob/2988f1d8f0085186666c388dd6f0f4783db07e49/tests/backtest/test_backtest_position_trigger.py#L643-L644
This also happens for the number of stop losses and take profits if it happens on the last cycle
Acceptance criteria
# trades = # closed positions * 2
(assuming no adjust position trades)