Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Strategies] update tests for non instant fill orders #1082

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ 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.338)), decimal.Decimal(str(-31.279)))

async def test_sharp_downtrend(self):
# market: -30.271723049610415
Expand All @@ -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.900)), decimal.Decimal(str(-6.876)))

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.658)))


async def test_default_run(strategy_tester):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.977)), decimal.Decimal(str(-8.372)))

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.084)))

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(-3.485)), decimal.Decimal(str(2.970)))

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.999)))


async def test_default_run(strategy_tester):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down