test: Long adjust-exit-price test

This commit is contained in:
Matthias
2025-02-20 20:07:44 +01:00
parent 584b84a941
commit 08587d826e

View File

@@ -1237,6 +1237,26 @@ tc58 = BTContainer(
trades=[BTrade(exit_reason=ExitType.EXIT_SIGNAL, open_tick=1, close_tick=4, is_short=True)],
)
# Test 59: Custom-exit-price above all candles - readjust order
tc59 = BTContainer(
data=[
# D O H L C V EL XL ES Xs BT
[0, 5000, 5050, 4950, 5000, 6172, 1, 0],
[1, 5000, 5500, 4951, 5000, 6172, 0, 0],
[2, 4900, 5250, 4500, 5100, 6172, 0, 1], # exit
[3, 5100, 5100, 4650, 4750, 6172, 0, 0], # order readjust
[4, 4750, 4950, 4350, 4750, 6172, 0, 0],
],
stop_loss=-0.2,
roi={"0": 0.10},
profit_perc=-0.02,
use_exit_signal=True,
timeout=1000,
custom_exit_price=5300,
adjust_exit_price=4900,
trades=[BTrade(exit_reason=ExitType.EXIT_SIGNAL, open_tick=1, close_tick=4, is_short=False)],
)
TESTS = [
tc0,
@@ -1298,6 +1318,7 @@ TESTS = [
tc56,
tc57,
tc58,
tc59,
]