From 3b3891a0bd9ac27a3a6688821b599d8e3687bfa1 Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 15 Oct 2023 17:10:29 +0200 Subject: [PATCH] [Strategies] update tests for non instant fill orders --- .../test_dip_analyser_strategy_evaluator.py | 12 ++++++------ .../tests/test_simple_strategy_evaluator.py | 16 ++++++++-------- ...test_technical_analysis_strategy_evaluator.py | 14 +++++++------- .../test_move_signals_strategy_evaluator.py | 6 +++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Evaluator/Strategies/dip_analyser_strategy_evaluator/tests/test_dip_analyser_strategy_evaluator.py b/Evaluator/Strategies/dip_analyser_strategy_evaluator/tests/test_dip_analyser_strategy_evaluator.py index 8f20e9d48..c3d2a3890 100644 --- a/Evaluator/Strategies/dip_analyser_strategy_evaluator/tests/test_dip_analyser_strategy_evaluator.py +++ b/Evaluator/Strategies/dip_analyser_strategy_evaluator/tests/test_dip_analyser_strategy_evaluator.py @@ -48,31 +48,31 @@ class DipAnalyserStrategiesEvaluatorTest(abstract_strategy_test.AbstractStrategy async def test_default_run(self): # market: -49.25407390406244 - await self.run_test_default_run(decimal.Decimal(str(-21.875))) + await self.run_test_default_run(decimal.Decimal(str(-25.195))) async def test_slow_downtrend(self): # market: -49.25407390406244 # market: -47.50593824228029 - await self.run_test_slow_downtrend(decimal.Decimal(str(-21.875)), decimal.Decimal(str(-32.029)), None, None, skip_extended=True) + await self.run_test_slow_downtrend(decimal.Decimal(str(-25.195)), decimal.Decimal(str(-33.975)), None, None, skip_extended=True) async def test_sharp_downtrend(self): # market: -34.67997135795625 - await self.run_test_sharp_downtrend(decimal.Decimal(str(-22.105)), None, skip_extended=True) + await self.run_test_sharp_downtrend(decimal.Decimal(str(-22.231)), None, skip_extended=True) async def test_flat_markets(self): # market: -38.07647740440325 # market: -53.87077652637819 - await self.run_test_flat_markets(decimal.Decimal(str(-21.822)), decimal.Decimal(str(-27.507)), None, None, skip_extended=True) + await self.run_test_flat_markets(decimal.Decimal(str(-21.130)), decimal.Decimal(str(-32.759)), None, None, skip_extended=True) async def test_slow_uptrend(self): # market: 11.32644122514472 # market: -36.64596273291926 - await self.run_test_slow_uptrend(decimal.Decimal(str(11.326)), decimal.Decimal(str(-15.395))) + await self.run_test_slow_uptrend(decimal.Decimal(str(11.326)), decimal.Decimal(str(-14.477))) async def test_sharp_uptrend(self): # market: -17.047906776003458 # market: -18.25837965302341 - await self.run_test_sharp_uptrend(decimal.Decimal(str(1.651)), decimal.Decimal(str(12.264))) + await self.run_test_sharp_uptrend(decimal.Decimal(str(2.640)), decimal.Decimal(str(10.578))) async def test_up_then_down(self): await self.run_test_up_then_down(None, skip_extended=True) diff --git a/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_simple_strategy_evaluator.py b/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_simple_strategy_evaluator.py index fe8a195ff..76c503573 100644 --- a/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_simple_strategy_evaluator.py +++ b/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_simple_strategy_evaluator.py @@ -40,20 +40,20 @@ class SimpleStrategyEvaluatorTest(abstract_strategy_test.AbstractStrategyTest): async def test_default_run(self): # market: -13.599062133645944 - await self.run_test_default_run(decimal.Decimal(str(-1.145))) + await self.run_test_default_run(decimal.Decimal(str(-1.148))) async def test_slow_downtrend(self): # market: -13.599062133645944 # market: -44.248234106962656 # market: -34.87003936300901 # market: -45.18518518518518 - await self.run_test_slow_downtrend(decimal.Decimal(str(-1.145)), decimal.Decimal(str(-34.381)), - decimal.Decimal(str(-27.176)), decimal.Decimal(str(-31.344))) + await self.run_test_slow_downtrend(decimal.Decimal(str(-1.148)), decimal.Decimal(str(-36.528)), + decimal.Decimal(str(-27.341)), decimal.Decimal(str(-31.155))) async def test_sharp_downtrend(self): # market: -30.271723049610415 # market: -32.091097308488614 - await self.run_test_sharp_downtrend(decimal.Decimal(str(-24.386)), decimal.Decimal(str(-32.790))) + await self.run_test_sharp_downtrend(decimal.Decimal(str(-24.386)), decimal.Decimal(str(-32.799))) async def test_flat_markets(self): # market: 5.052093571849795 @@ -61,21 +61,21 @@ async def test_flat_markets(self): # market: -12.732688011913623 # market: -34.64150943396227 await self.run_test_flat_markets(decimal.Decimal(str(0.027)), decimal.Decimal(str(10.885)), - decimal.Decimal(str(-14.485)), decimal.Decimal(str(-4.290))) + decimal.Decimal(str(-13.888)), decimal.Decimal(str(-6.874))) async def test_slow_uptrend(self): # market: 32.524679029957184 # market: 6.25 - await self.run_test_slow_uptrend(decimal.Decimal(str(15.370)), decimal.Decimal(str(0.817))) + await self.run_test_slow_uptrend(decimal.Decimal(str(15.031)), decimal.Decimal(str(0.817))) async def test_sharp_uptrend(self): # market: 24.56254050550875 # market: 8.665472458575891 - await self.run_test_sharp_uptrend(decimal.Decimal(str(14.887)), decimal.Decimal(str(17.296))) + await self.run_test_sharp_uptrend(decimal.Decimal(str(14.131)), decimal.Decimal(str(12.486))) async def test_up_then_down(self): # market: 1.1543668450702853 - await self.run_test_up_then_down(decimal.Decimal(str(3.319))) + await self.run_test_up_then_down(decimal.Decimal(str(2.622))) async def test_default_run(strategy_tester): diff --git a/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_technical_analysis_strategy_evaluator.py b/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_technical_analysis_strategy_evaluator.py index 4665d47af..acaec26ef 100644 --- a/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_technical_analysis_strategy_evaluator.py +++ b/Evaluator/Strategies/mixed_strategies_evaluator/tests/test_technical_analysis_strategy_evaluator.py @@ -48,34 +48,34 @@ async def test_slow_downtrend(self): # market: -29.12366137549725 # market: -32.110091743119256 await self.run_test_slow_downtrend(decimal.Decimal(str(-8.699)), decimal.Decimal(str(-9.675)), - decimal.Decimal(str(-16.634)), decimal.Decimal(str(-8.210))) + decimal.Decimal(str(-16.968)), decimal.Decimal(str(-8.286))) async def test_sharp_downtrend(self): # market: -26.07183938094741 # market: -32.1654501216545 - await self.run_test_sharp_downtrend(decimal.Decimal(str(-19.997)), decimal.Decimal(str(-23.093))) + await self.run_test_sharp_downtrend(decimal.Decimal(str(-20.005)), decimal.Decimal(str(-23.083))) async def test_flat_markets(self): # market: -10.560669456066947 # market: -3.401191658391241 # market: -5.7854560064282765 # market: -8.067940552016978 - await self.run_test_flat_markets(decimal.Decimal(str(0.681)), decimal.Decimal(str(1.917)), - decimal.Decimal(str(-0.298)), decimal.Decimal(str(3.022))) + await self.run_test_flat_markets(decimal.Decimal(str(0.289)), decimal.Decimal(str(1.813)), + decimal.Decimal(str(-4.676)), decimal.Decimal(str(2.986))) async def test_slow_uptrend(self): # market: 17.203948364436457 # market: 16.19613670133728 - await self.run_test_slow_uptrend(decimal.Decimal(str(9.729)), decimal.Decimal(str(2.882))) + await self.run_test_slow_uptrend(decimal.Decimal(str(8.245)), decimal.Decimal(str(2.882))) async def test_sharp_uptrend(self): # market: 30.881852230166828 # market: 12.28597871355852 - await self.run_test_sharp_uptrend(decimal.Decimal(str(1.418)), decimal.Decimal(str(3.772))) + await self.run_test_sharp_uptrend(decimal.Decimal(str(1.418)), decimal.Decimal(str(3.180))) async def test_up_then_down(self): # market: -6.040105108015155 - await self.run_test_up_then_down(decimal.Decimal(str(-0.909))) + await self.run_test_up_then_down(decimal.Decimal(str(-0.964))) async def test_default_run(strategy_tester): diff --git a/Evaluator/Strategies/move_signals_strategy_evaluator/tests/test_move_signals_strategy_evaluator.py b/Evaluator/Strategies/move_signals_strategy_evaluator/tests/test_move_signals_strategy_evaluator.py index bfba928af..aab722249 100644 --- a/Evaluator/Strategies/move_signals_strategy_evaluator/tests/test_move_signals_strategy_evaluator.py +++ b/Evaluator/Strategies/move_signals_strategy_evaluator/tests/test_move_signals_strategy_evaluator.py @@ -53,7 +53,7 @@ async def test_slow_downtrend(self): async def test_sharp_downtrend(self): # market: -26.07183938094741 # market: -32.1654501216545 - await self.run_test_sharp_downtrend(decimal.Decimal(str(-11.819)), decimal.Decimal(str(-10.3))) + await self.run_test_sharp_downtrend(decimal.Decimal(str(-12.078)), decimal.Decimal(str(-10.3))) async def test_flat_markets(self): # market: -10.560669456066947 @@ -66,12 +66,12 @@ async def test_flat_markets(self): async def test_slow_uptrend(self): # market: 17.203948364436457 # market: 16.19613670133728 - await self.run_test_slow_uptrend(decimal.Decimal(str(10.090)), decimal.Decimal(str(4.792))) + await self.run_test_slow_uptrend(decimal.Decimal(str(10.278)), decimal.Decimal(str(4.299))) async def test_sharp_uptrend(self): # market: 30.881852230166828 # market: 12.28597871355852 - await self.run_test_sharp_uptrend(decimal.Decimal(str(6.504)), decimal.Decimal(str(4.889))) + await self.run_test_sharp_uptrend(decimal.Decimal(str(6.504)), decimal.Decimal(str(5.020))) async def test_up_then_down(self): # market: -6.040105108015155