Skip to content

Commit 39bf716

Browse files
committed
test: Update test case description wording
1 parent 372cfee commit 39bf716

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

tests/optimize/test_backtest_detail.py

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
)
1919

2020

21-
# Test 0: Sell with signal sell in candle 3
21+
# Test 0: exit with exit signal in candle 3
2222
# Test with Stop-loss at 1%
2323
tc0 = BTContainer(
2424
data=[
@@ -279,7 +279,7 @@
279279
trades=[BTrade(exit_reason=ExitType.TRAILING_STOP_LOSS, open_tick=1, close_tick=2)],
280280
)
281281

282-
# Test 13: Buy and sell ROI on same candle
282+
# Test 13: Enter and exit ROI on same candle
283283
# stop-loss: 10% (should not apply), ROI: 1%
284284
tc13 = BTContainer(
285285
data=[
@@ -296,7 +296,7 @@
296296
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=1)],
297297
)
298298

299-
# Test 14 - Buy and Stoploss on same candle
299+
# Test 14 - Enter and Stoploss on same candle
300300
# stop-loss: 5%, ROI: 10% (should not apply)
301301
tc14 = BTContainer(
302302
data=[
@@ -314,7 +314,7 @@
314314
)
315315

316316

317-
# Test 15 - Buy and ROI on same candle, followed by buy and Stoploss on next candle
317+
# Test 15 - Enter and ROI on same candle, followed by entry and Stoploss on next candle
318318
# stop-loss: 5%, ROI: 10% (should not apply)
319319
tc15 = BTContainer(
320320
data=[
@@ -334,8 +334,8 @@
334334
],
335335
)
336336

337-
# Test 16: Buy, hold for 65 min, then forceexit using roi=-1
338-
# Causes negative profit even though sell-reason is ROI.
337+
# Test 16: Enter, hold for 65 min, then forceexit using roi=-1
338+
# Causes negative profit even though exit-reason is ROI.
339339
# stop-loss: 10%, ROI: 10% (should not apply), -100% after 65 minutes (limits trade duration)
340340
tc16 = BTContainer(
341341
data=[
@@ -353,10 +353,10 @@
353353
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)],
354354
)
355355

356-
# Test 17: Buy, hold for 120 mins, then forceexit using roi=-1
357-
# Causes negative profit even though sell-reason is ROI.
356+
# Test 17: Enter, hold for 120 mins, then forceexit using roi=-1
357+
# Causes negative profit even though exit-reason is ROI.
358358
# stop-loss: 10%, ROI: 10% (should not apply), -100% after 100 minutes (limits trade duration)
359-
# Uses open as sell-rate (special case) - since the roi-time is a multiple of the timeframe.
359+
# Uses open as exit-rate (special case) - since the roi-time is a multiple of the timeframe.
360360
tc17 = BTContainer(
361361
data=[
362362
# D O H L C V EL XL ES Xs BT
@@ -374,16 +374,16 @@
374374
)
375375

376376

377-
# Test 18: Buy, hold for 120 mins, then drop ROI to 1%, causing a sell in candle 3.
377+
# Test 18: Enter, hold for 120 mins, then drop ROI to 1%, causing an exit in candle 3.
378378
# stop-loss: 10%, ROI: 10% (should not apply), -100% after 100 minutes (limits trade duration)
379-
# uses open_rate as sell-price
379+
# uses open_rate as exit price
380380
tc18 = BTContainer(
381381
data=[
382382
# D O H L C V EL XL ES Xs BT
383383
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
384384
[1, 5000, 5025, 4975, 4987, 6172, 0, 0],
385385
[2, 4987, 5300, 4950, 5200, 6172, 0, 0],
386-
[3, 5200, 5220, 4940, 4962, 6172, 0, 0], # Sell on ROI (sells on open)
386+
[3, 5200, 5220, 4940, 4962, 6172, 0, 0], # Exit on ROI (exits on open)
387387
[4, 4962, 4987, 4950, 4950, 6172, 0, 0],
388388
[5, 4950, 4975, 4925, 4950, 6172, 0, 0],
389389
],
@@ -393,16 +393,16 @@
393393
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)],
394394
)
395395

396-
# Test 19: Buy, hold for 119 mins, then drop ROI to 1%, causing a sell in candle 3.
396+
# Test 19: Enter, hold for 119 mins, then drop ROI to 1%, causing an exit in candle 3.
397397
# stop-loss: 10%, ROI: 10% (should not apply), -100% after 100 minutes (limits trade duration)
398-
# uses calculated ROI (1%) as sell rate, otherwise identical to tc18
398+
# uses calculated ROI (1%) as exit rate, otherwise identical to tc18
399399
tc19 = BTContainer(
400400
data=[
401401
# D O H L C V EL XL ES Xs BT
402402
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
403403
[1, 5000, 5025, 4975, 4987, 6172, 0, 0],
404404
[2, 4987, 5300, 4950, 5200, 6172, 0, 0],
405-
[3, 5000, 5300, 4940, 4962, 6172, 0, 0], # Sell on ROI
405+
[3, 5000, 5300, 4940, 4962, 6172, 0, 0], # Exit on ROI
406406
[4, 4962, 4987, 4950, 4950, 6172, 0, 0],
407407
[5, 4550, 4975, 4550, 4950, 6172, 0, 0],
408408
],
@@ -412,16 +412,16 @@
412412
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)],
413413
)
414414

415-
# Test 20: Buy, hold for 119 mins, then drop ROI to 1%, causing a sell in candle 3.
415+
# Test 20: Enter, hold for 119 mins, then drop ROI to 1%, causing an exit in candle 3.
416416
# stop-loss: 10%, ROI: 10% (should not apply), -100% after 100 minutes (limits trade duration)
417-
# uses calculated ROI (1%) as sell rate, otherwise identical to tc18
417+
# uses calculated ROI (1%) as exit rate, otherwise identical to tc18
418418
tc20 = BTContainer(
419419
data=[
420420
# D O H L C V EL XL ES Xs BT
421421
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
422422
[1, 5000, 5025, 4975, 4987, 6172, 0, 0],
423423
[2, 4987, 5300, 4950, 5200, 6172, 0, 0],
424-
[3, 5200, 5300, 4940, 4962, 6172, 0, 0], # Sell on ROI
424+
[3, 5200, 5300, 4940, 4962, 6172, 0, 0], # Exit on ROI
425425
[4, 4962, 4987, 4950, 4950, 6172, 0, 0],
426426
[5, 4925, 4975, 4925, 4950, 6172, 0, 0],
427427
],
@@ -434,7 +434,7 @@
434434
# Test 21: trailing_stop ROI collision.
435435
# Roi should trigger before Trailing stop - otherwise Trailing stop profits can be > ROI
436436
# which cannot happen in reality
437-
# stop-loss: 10%, ROI: 4%, Trailing stop adjusted at the sell candle
437+
# stop-loss: 10%, ROI: 4%, Trailing stop adjusted at the exit candle
438438
tc21 = BTContainer(
439439
data=[
440440
# D O H L C V EL XL ES Xs BT
@@ -501,10 +501,10 @@
501501

502502
# Test 24: trailing_stop Raises in candle 2 (does not trigger)
503503
# applying a positive trailing stop of 3% since stop_positive_offset is reached.
504-
# ROI is changed after this to 4%, dropping ROI below trailing_stop_positive, causing a sell
504+
# ROI is changed after this to 4%, dropping ROI below trailing_stop_positive, causing an exit
505505
# in the candle after the raised stoploss candle with ROI reason.
506506
# Stoploss would trigger in this candle too, but it's no longer relevant.
507-
# stop-loss: 10%, ROI: 4%, stoploss adjusted candle 2, ROI adjusted in candle 3 (causing the sell)
507+
# stop-loss: 10%, ROI: 4%, stoploss adjusted candle 2, ROI adjusted in candle 3 (causing the exit)
508508
tc24 = BTContainer(
509509
data=[
510510
# D O H L C V EL XL ES Xs BT
@@ -524,16 +524,16 @@
524524
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)],
525525
)
526526

527-
# Test 25: Sell with signal sell in candle 3 (stoploss also triggers on this candle)
527+
# Test 25: Exit with exit signal in candle 3 (stoploss also triggers on this candle)
528528
# Stoploss at 1%.
529-
# Stoploss wins over Sell-signal (because sell-signal is acted on in the next candle)
529+
# Stoploss wins over exit-signal (because exit-signal is acted on in the next candle)
530530
tc25 = BTContainer(
531531
data=[
532532
# D O H L C V EL XL ES Xs BT
533533
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
534534
[1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle)
535535
[2, 4987, 5012, 4986, 4986, 6172, 0, 0],
536-
[3, 5010, 5010, 4855, 5010, 6172, 0, 1], # Triggers stoploss + sellsignal
536+
[3, 5010, 5010, 4855, 5010, 6172, 0, 1], # Triggers stoploss + exit-signal
537537
[4, 5010, 5010, 4977, 4995, 6172, 0, 0],
538538
[5, 4995, 4995, 4950, 4950, 6172, 0, 0],
539539
],
@@ -544,17 +544,17 @@
544544
trades=[BTrade(exit_reason=ExitType.STOP_LOSS, open_tick=1, close_tick=3)],
545545
)
546546

547-
# Test 26: Sell with signal sell in candle 3 (stoploss also triggers on this candle)
547+
# Test 26: Exit with exit signal in candle 3 (stoploss also triggers on this candle)
548548
# Stoploss at 1%.
549-
# Sell-signal wins over stoploss
549+
# Exit-signal wins over stoploss
550550
tc26 = BTContainer(
551551
data=[
552552
# D O H L C V EL XL ES Xs BT
553553
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
554554
[1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle)
555555
[2, 4987, 5012, 4986, 4986, 6172, 0, 0],
556556
[3, 5010, 5010, 4986, 5010, 6172, 0, 1],
557-
[4, 5010, 5010, 4855, 4995, 6172, 0, 0], # Triggers stoploss + sellsignal acted on
557+
[4, 5010, 5010, 4855, 4995, 6172, 0, 0], # Triggers stoploss + exit-signal acted on
558558
[5, 4995, 4995, 4950, 4950, 6172, 0, 0],
559559
],
560560
stop_loss=-0.01,
@@ -565,17 +565,17 @@
565565
)
566566

567567
# Test 27: (copy of test26 with leverage)
568-
# Sell with signal sell in candle 3 (stoploss also triggers on this candle)
568+
# Exit with exit signal in candle 3 (stoploss also triggers on this candle)
569569
# Stoploss at 1%.
570-
# Sell-signal wins over stoploss
570+
# exit-signal wins over stoploss
571571
tc27 = BTContainer(
572572
data=[
573573
# D O H L C V EL XL ES Xs BT
574574
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
575575
[1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle)
576576
[2, 4987, 5012, 4986, 4986, 6172, 0, 0],
577577
[3, 5010, 5010, 4986, 5010, 6172, 0, 1],
578-
[4, 5010, 5010, 4855, 4995, 6172, 0, 0], # Triggers stoploss + sellsignal acted on
578+
[4, 5010, 5010, 4855, 4995, 6172, 0, 0], # Triggers stoploss + exit-signal acted on
579579
[5, 4995, 4995, 4950, 4950, 6172, 0, 0],
580580
],
581581
stop_loss=-0.05,
@@ -587,17 +587,17 @@
587587
)
588588

589589
# Test 28: (copy of test26 with leverage and as short)
590-
# Sell with signal sell in candle 3 (stoploss also triggers on this candle)
590+
# Exit with exit signal in candle 3 (stoploss also triggers on this candle)
591591
# Stoploss at 1%.
592-
# Sell-signal wins over stoploss
592+
# Exit-signal wins over stoploss
593593
tc28 = BTContainer(
594594
data=[
595595
# D O H L C V EL XL ES Xs BT
596596
[0, 5000, 5025, 4975, 4987, 6172, 0, 0, 1, 0],
597597
[1, 5000, 5025, 4975, 4987, 6172, 0, 0, 0, 0], # enter trade (signal on last candle)
598598
[2, 4987, 5012, 4986, 4986, 6172, 0, 0, 0, 0],
599599
[3, 5010, 5010, 4986, 5010, 6172, 0, 0, 0, 1],
600-
[4, 4990, 5010, 4855, 4995, 6172, 0, 0, 0, 0], # Triggers stoploss + sellsignal acted on
600+
[4, 4990, 5010, 4855, 4995, 6172, 0, 0, 0, 0], # Triggers stoploss + exit-signal acted on
601601
[5, 4995, 4995, 4950, 4950, 6172, 0, 0, 0, 0],
602602
],
603603
stop_loss=-0.05,
@@ -607,16 +607,16 @@
607607
leverage=5.0,
608608
trades=[BTrade(exit_reason=ExitType.EXIT_SIGNAL, open_tick=1, close_tick=4, is_short=True)],
609609
)
610-
# Test 29: Sell with signal sell in candle 3 (ROI at signal candle)
610+
# Test 29: Exit with exit signal in candle 3 (ROI at signal candle)
611611
# Stoploss at 10% (irrelevant), ROI at 5% (will trigger)
612-
# Sell-signal wins over stoploss
612+
# Exit-signal wins over stoploss
613613
tc29 = BTContainer(
614614
data=[
615615
# D O H L C V EL XL ES Xs BT
616616
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
617617
[1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle)
618618
[2, 4987, 5012, 4986, 4986, 6172, 0, 0],
619-
[3, 5010, 5251, 4986, 5010, 6172, 0, 1], # Triggers ROI, sell-signal
619+
[3, 5010, 5251, 4986, 5010, 6172, 0, 1], # Triggers ROI, exit-signal
620620
[4, 5010, 5010, 4855, 4995, 6172, 0, 0],
621621
[5, 4995, 4995, 4950, 4950, 6172, 0, 0],
622622
],
@@ -627,16 +627,16 @@
627627
trades=[BTrade(exit_reason=ExitType.ROI, open_tick=1, close_tick=3)],
628628
)
629629

630-
# Test 30: Sell with signal sell in candle 3 (ROI at signal candle)
631-
# Stoploss at 10% (irrelevant), ROI at 5% (will trigger) - Wins over Sell-signal
630+
# Test 30: Exit with exit signal in candle 3 (ROI at signal candle)
631+
# Stoploss at 10% (irrelevant), ROI at 5% (will trigger) - Wins over exit-signal
632632
tc30 = BTContainer(
633633
data=[
634634
# D O H L C V EL XL ES Xs BT
635635
[0, 5000, 5025, 4975, 4987, 6172, 1, 0],
636636
[1, 5000, 5025, 4975, 4987, 6172, 0, 0], # enter trade (signal on last candle)
637637
[2, 4987, 5012, 4986, 4986, 6172, 0, 0],
638-
[3, 5010, 5012, 4986, 5010, 6172, 0, 1], # sell-signal
639-
[4, 5010, 5251, 4855, 4995, 6172, 0, 0], # Triggers ROI, sell-signal acted on
638+
[3, 5010, 5012, 4986, 5010, 6172, 0, 1], # exit-signal
639+
[4, 5010, 5251, 4855, 4995, 6172, 0, 0], # Triggers ROI, exit-signal acted on
640640
[5, 4995, 4995, 4950, 4950, 6172, 0, 0],
641641
],
642642
stop_loss=-0.10,
@@ -888,7 +888,7 @@
888888

889889
# Test 42: Custom-entry-price around candle low
890890
# Would cause immediate ROI exit, but since the trade was entered
891-
# below open, we treat this as cheating, and delay the sell by 1 candle.
891+
# below open, we treat this as cheating, and delay the exit by 1 candle.
892892
# details: https://github.com/freqtrade/freqtrade/issues/6261
893893
tc42 = BTContainer(
894894
data=[
@@ -945,7 +945,7 @@
945945
)
946946

947947
# Test 45: Custom exit price above all candles
948-
# causes sell signal timeout
948+
# causes exit signal timeout
949949
tc45 = BTContainer(
950950
data=[
951951
# D O H L C V EL XL ES Xs BT
@@ -964,7 +964,7 @@
964964
)
965965

966966
# Test 46: (Short of tc45) Custom short exit price above below candles
967-
# causes sell signal timeout
967+
# causes exit signal timeout
968968
tc46 = BTContainer(
969969
data=[
970970
# D O H L C V EL XL ES Xs BT

0 commit comments

Comments
 (0)