From fe3bd16aaeb0da6c95ec7a517c309a26817137a5 Mon Sep 17 00:00:00 2001 From: marcvanduyn Date: Wed, 19 Feb 2025 20:58:12 +0100 Subject: [PATCH 1/3] Fix context reference --- tests/app/algorithm/test_trade_price_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/app/algorithm/test_trade_price_update.py b/tests/app/algorithm/test_trade_price_update.py index 56e6b105..b7e0dfe8 100644 --- a/tests/app/algorithm/test_trade_price_update.py +++ b/tests/app/algorithm/test_trade_price_update.py @@ -13,7 +13,7 @@ class StrategyOne(TradingStrategy): interval = 2 market_data_sources = ["BTC/EUR-ohlcv", "BTC/EUR-ticker"] - def apply_strategy(self, algorithm, market_data): + def apply_strategy(self, context, market_data): pass @@ -22,7 +22,7 @@ class StrategyTwo(TradingStrategy): interval = 2 market_data_sources = ["BTC/EUR-ohlcv", "BTC/EUR-ticker"] - def apply_strategy(self, algorithm, market_data): + def apply_strategy(self, context, market_data): pass From d9f5b905aa5e6d91b5bd55976ffab641913fb934 Mon Sep 17 00:00:00 2001 From: marcvanduyn Date: Wed, 19 Feb 2025 21:26:11 +0100 Subject: [PATCH 2/3] Fix last reported price reference --- examples/backtests_example/backtests.ipynb | 525 +++++++++--------- investing_algorithm_framework/app/context.py | 14 +- investing_algorithm_framework/app/strategy.py | 58 +- .../app/algorithm/test_trade_price_update.py | 13 +- 4 files changed, 290 insertions(+), 320 deletions(-) diff --git a/examples/backtests_example/backtests.ipynb b/examples/backtests_example/backtests.ipynb index 75450504..2fe97afc 100644 --- a/examples/backtests_example/backtests.ipynb +++ b/examples/backtests_example/backtests.ipynb @@ -24,7 +24,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -147,7 +147,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -267,7 +267,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": { "collapsed": false }, @@ -14734,7 +14734,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "metadata": { "collapsed": false }, @@ -14750,103 +14750,44 @@ "name": "stderr", "output_type": "stream", "text": [ - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 153.90it/s]\n", - "Running backtest for algorithm with name primary: 0%|\u001b[32m \u001b[0m| 0/2173 [00:00\n", - "\n" + "\u001b[93mRunning backtests for date range:\u001b[0m \u001b[92mup_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 for a total of 2 algorithms.\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "Running backtest for algorithm with name primary: 13%|\u001b[32m█▎ \u001b[0m| 273/2173 [00:02<00:12, 157.47it/s]" + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 148.80it/s]\n", + "Running backtest for algorithm with name primary: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:23<00:00, 82.91it/s] \n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 205.48it/s]\n", + "Running backtest for algorithm with name secondary: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:16<00:00, 117.30it/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ - "\n", - "\n" + "\u001b[93mRunning backtests for date range:\u001b[0m \u001b[92msideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 for a total of 2 algorithms.\u001b[0m\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ - "Running backtest for algorithm with name primary: 14%|\u001b[32m█▍ \u001b[0m| 305/2173 [00:02<00:20, 93.14it/s] " - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Running backtest for algorithm with name primary: 17%|\u001b[32m█▋ \u001b[0m| 380/2173 [00:03<00:18, 96.33it/s] " - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Running backtest for algorithm with name primary: 20%|\u001b[32m██ \u001b[0m| 437/2173 [00:03<00:13, 131.25it/s]" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\n", - "\n" - ] - }, - { - "name": "stderr", - "output_type": "stream", - "text": [ - "Running backtest for algorithm with name primary: 25%|\u001b[32m██▍ \u001b[0m| 538/2173 [00:04<00:13, 123.38it/s]\n" - ] - }, - { - "ename": "KeyboardInterrupt", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[11], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m reports \u001b[38;5;241m=\u001b[39m \u001b[43mapp\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_backtests\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2\u001b[0m \u001b[43m \u001b[49m\u001b[43malgorithms\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\u001b[43mchampion\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mchallenger\u001b[49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[43m \u001b[49m\u001b[43mdate_ranges\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m[\u001b[49m\n\u001b[1;32m 4\u001b[0m \u001b[43m \u001b[49m\u001b[43mdown_turn_date_range\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mup_turn_date_range\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43msideways_date_range\u001b[49m\n\u001b[1;32m 5\u001b[0m \u001b[43m \u001b[49m\u001b[43m]\u001b[49m\n\u001b[1;32m 6\u001b[0m \u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/app/app.py:803\u001b[0m, in \u001b[0;36mApp.run_backtests\u001b[0;34m(self, algorithms, initial_amount, date_ranges, pending_order_check_interval, output_directory, checkpoint)\u001b[0m\n\u001b[1;32m 797\u001b[0m backtest_service\u001b[38;5;241m.\u001b[39mresource_directory \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mconfig[\n\u001b[1;32m 798\u001b[0m RESOURCE_DIRECTORY\n\u001b[1;32m 799\u001b[0m ]\n\u001b[1;32m 801\u001b[0m \u001b[38;5;66;03m# Run the backtest with the backtest_service\u001b[39;00m\n\u001b[1;32m 802\u001b[0m \u001b[38;5;66;03m# and collect the report\u001b[39;00m\n\u001b[0;32m--> 803\u001b[0m report \u001b[38;5;241m=\u001b[39m \u001b[43mbacktest_service\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_backtest\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 804\u001b[0m \u001b[43m \u001b[49m\u001b[43malgorithm\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43malgorithm\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 805\u001b[0m \u001b[43m \u001b[49m\u001b[43minitial_amount\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43minitial_amount\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 806\u001b[0m \u001b[43m \u001b[49m\u001b[43mbacktest_date_range\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdate_range\u001b[49m\n\u001b[1;32m 807\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 809\u001b[0m \u001b[38;5;66;03m# Add date range name to report if present\u001b[39;00m\n\u001b[1;32m 810\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m date_range\u001b[38;5;241m.\u001b[39mname \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/services/backtesting/backtest_service.py:174\u001b[0m, in \u001b[0;36mBacktestService.run_backtest\u001b[0;34m(self, algorithm, backtest_date_range, initial_amount)\u001b[0m\n\u001b[1;32m 166\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_configuration_service\u001b[38;5;241m.\u001b[39madd_value(\n\u001b[1;32m 167\u001b[0m BACKTESTING_INDEX_DATETIME, index_date\n\u001b[1;32m 168\u001b[0m )\n\u001b[1;32m 169\u001b[0m \u001b[38;5;66;03m# self.run_backtest_for_profile(\u001b[39;00m\n\u001b[1;32m 170\u001b[0m \u001b[38;5;66;03m# algorithm=algorithm,\u001b[39;00m\n\u001b[1;32m 171\u001b[0m \u001b[38;5;66;03m# strategy=algorithm.get_strategy(strategy_profile.strategy_id),\u001b[39;00m\n\u001b[1;32m 172\u001b[0m \u001b[38;5;66;03m# index_date=index_date,\u001b[39;00m\n\u001b[1;32m 173\u001b[0m \u001b[38;5;66;03m# )\u001b[39;00m\n\u001b[0;32m--> 174\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_backtest_v2\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 175\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43malgorithm\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 176\u001b[0m \u001b[43m \u001b[49m\u001b[43mstrategy\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43malgorithm\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_strategy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstrategy_profile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstrategy_id\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 177\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 179\u001b[0m report \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcreate_backtest_report(\n\u001b[1;32m 180\u001b[0m algorithm, \u001b[38;5;28mlen\u001b[39m(schedule), backtest_date_range, initial_unallocated\n\u001b[1;32m 181\u001b[0m )\n\u001b[1;32m 183\u001b[0m \u001b[38;5;66;03m# Cleanup backtest portfolio\u001b[39;00m\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/services/backtesting/backtest_service.py:251\u001b[0m, in \u001b[0;36mBacktestService.run_backtest_v2\u001b[0;34m(self, strategy, context)\u001b[0m\n\u001b[1;32m 249\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mrun_backtest_v2\u001b[39m(\u001b[38;5;28mself\u001b[39m, strategy, context):\n\u001b[1;32m 250\u001b[0m config \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_configuration_service\u001b[38;5;241m.\u001b[39mget_config()\n\u001b[0;32m--> 251\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_strategy_orchestrator_service\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mrun_backtest_strategy\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 252\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mstrategy\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstrategy\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig\u001b[49m\n\u001b[1;32m 253\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/services/strategy_orchestrator_service.py:98\u001b[0m, in \u001b[0;36mStrategyOrchestratorService.run_backtest_strategy\u001b[0;34m(self, strategy, context, config)\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mrun_backtest_strategy\u001b[39m(\u001b[38;5;28mself\u001b[39m, strategy, context, config):\n\u001b[1;32m 97\u001b[0m data \u001b[38;5;241m=\u001b[39m \\\n\u001b[0;32m---> 98\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmarket_data_source_service\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_data_for_strategy\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstrategy\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 100\u001b[0m strategy\u001b[38;5;241m.\u001b[39mrun_strategy(\n\u001b[1;32m 101\u001b[0m market_data\u001b[38;5;241m=\u001b[39mdata,\n\u001b[1;32m 102\u001b[0m context\u001b[38;5;241m=\u001b[39mcontext,\n\u001b[1;32m 103\u001b[0m )\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py:144\u001b[0m, in \u001b[0;36mMarketDataSourceService.get_data_for_strategy\u001b[0;34m(self, strategy)\u001b[0m\n\u001b[1;32m 136\u001b[0m market_data \u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmetadata\u001b[39m\u001b[38;5;124m\"\u001b[39m: {\n\u001b[1;32m 137\u001b[0m MarketDataType\u001b[38;5;241m.\u001b[39mOHLCV: {},\n\u001b[1;32m 138\u001b[0m MarketDataType\u001b[38;5;241m.\u001b[39mTICKER: {},\n\u001b[1;32m 139\u001b[0m MarketDataType\u001b[38;5;241m.\u001b[39mORDER_BOOK: {},\n\u001b[1;32m 140\u001b[0m MarketDataType\u001b[38;5;241m.\u001b[39mCUSTOM: {}\n\u001b[1;32m 141\u001b[0m }}\n\u001b[1;32m 143\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m identifier \u001b[38;5;129;01min\u001b[39;00m identifiers:\n\u001b[0;32m--> 144\u001b[0m result_data \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43midentifier\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 146\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msymbol\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m result_data \u001b[38;5;129;01mand\u001b[39;00m result_data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msymbol\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \\\n\u001b[1;32m 147\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m result_data \\\n\u001b[1;32m 148\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m result_data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 149\u001b[0m \u001b[38;5;28mtype\u001b[39m \u001b[38;5;241m=\u001b[39m result_data[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py:102\u001b[0m, in \u001b[0;36mBacktestMarketDataSourceService.get_data\u001b[0;34m(self, identifier)\u001b[0m\n\u001b[1;32m 100\u001b[0m config \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_configuration_service\u001b[38;5;241m.\u001b[39mget_config()\n\u001b[1;32m 101\u001b[0m backtest_index_date \u001b[38;5;241m=\u001b[39m config[BACKTESTING_INDEX_DATETIME]\n\u001b[0;32m--> 102\u001b[0m data \u001b[38;5;241m=\u001b[39m \u001b[43mmarket_data_source\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget_data\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 103\u001b[0m \u001b[43m \u001b[49m\u001b[43mdate\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbacktest_index_date\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig\u001b[49m\n\u001b[1;32m 104\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 106\u001b[0m result \u001b[38;5;241m=\u001b[39m {\n\u001b[1;32m 107\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdata\u001b[39m\u001b[38;5;124m\"\u001b[39m: data,\n\u001b[1;32m 108\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtype\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 109\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msymbol\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 110\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtime_frame\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 111\u001b[0m }\n\u001b[1;32m 113\u001b[0m \u001b[38;5;66;03m# Add metadata to the data\u001b[39;00m\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/investing_algorithm_framework/infrastructure/models/market_data_sources/ccxt.py:395\u001b[0m, in \u001b[0;36mCCXTTickerBacktestMarketDataSource.get_data\u001b[0;34m(self, date, config)\u001b[0m\n\u001b[1;32m 393\u001b[0m \u001b[38;5;66;03m# Filter the data based on the backtest index date and the end date\u001b[39;00m\n\u001b[1;32m 394\u001b[0m df \u001b[38;5;241m=\u001b[39m polars\u001b[38;5;241m.\u001b[39mread_csv(file_path)\n\u001b[0;32m--> 395\u001b[0m filtered_df \u001b[38;5;241m=\u001b[39m \u001b[43mdf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfilter\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 396\u001b[0m \u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mDatetime\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m>\u001b[39;49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m \u001b[49m\u001b[43mdate\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstrftime\u001b[49m\u001b[43m(\u001b[49m\u001b[43mDATETIME_FORMAT\u001b[49m\u001b[43m)\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 397\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 399\u001b[0m \u001b[38;5;66;03m# If nothing is found, get all dates before the index date\u001b[39;00m\n\u001b[1;32m 400\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(filtered_df) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/.venv/lib/python3.10/site-packages/polars/dataframe/frame.py:4268\u001b[0m, in \u001b[0;36mDataFrame.filter\u001b[0;34m(self, *predicates, **constraints)\u001b[0m\n\u001b[1;32m 4168\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[38;5;21mfilter\u001b[39m(\n\u001b[1;32m 4169\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 4170\u001b[0m \u001b[38;5;241m*\u001b[39mpredicates: (\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 4177\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mconstraints: Any,\n\u001b[1;32m 4178\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m DataFrame:\n\u001b[1;32m 4179\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[1;32m 4180\u001b[0m \u001b[38;5;124;03m Filter the rows in the DataFrame based on one or more predicate expressions.\u001b[39;00m\n\u001b[1;32m 4181\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 4266\u001b[0m \u001b[38;5;124;03m └─────┴─────┴─────┘\u001b[39;00m\n\u001b[1;32m 4267\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 4268\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mlazy\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfilter\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mpredicates\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mconstraints\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcollect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_eager\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n", - "File \u001b[0;32m~/Projects/LogicFunds/investing-algorithm-framework/.venv/lib/python3.10/site-packages/polars/lazyframe/frame.py:1967\u001b[0m, in \u001b[0;36mLazyFrame.collect\u001b[0;34m(self, type_coercion, predicate_pushdown, projection_pushdown, simplify_expression, slice_pushdown, comm_subplan_elim, comm_subexpr_elim, cluster_with_columns, no_optimization, streaming, background, _eager, **_kwargs)\u001b[0m\n\u001b[1;32m 1964\u001b[0m \u001b[38;5;66;03m# Only for testing purposes atm.\u001b[39;00m\n\u001b[1;32m 1965\u001b[0m callback \u001b[38;5;241m=\u001b[39m _kwargs\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost_opt_callback\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m-> 1967\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m wrap_df(\u001b[43mldf\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcollect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcallback\u001b[49m\u001b[43m)\u001b[49m)\n", - "\u001b[0;31mKeyboardInterrupt\u001b[0m: " + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 127.36it/s]\n", + "Running backtest for algorithm with name primary: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:27<00:00, 93.23it/s] \n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 122.60it/s]\n", + "Running backtest for algorithm with name secondary: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:20<00:00, 123.90it/s]\n" ] } ], @@ -14870,7 +14811,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 9, "metadata": { "collapsed": false }, @@ -14883,8 +14824,8 @@ " :%%%#+- .=*#%%% \u001b[92mBacktest reports evaluation\u001b[0m\n", " *%%%%%%%+------=*%%%%%%%- \u001b[92m---------------------------\u001b[0m\n", " *%%%%%%%%%%%%%%%%%%%%%%%- \u001b[93mNumber of reports:\u001b[0m \u001b[92m6 backtest reports\u001b[0m\n", - " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary) 119.9648 EUR 11.9965% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", - " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary) 125.2748 EUR 12.5275% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", + " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary) 79.9529 EUR 7.9953% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", + " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary) 142.6132 EUR 14.2613% (sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00)\u001b[0m\n", " .:-+*%%%%- \u001b[95m-+..#\u001b[0m%%%+.\u001b[95m+- +\u001b[0m%%%#*=-:\n", " .:-=*%%%%. \u001b[95m+=\u001b[0m .%%# \u001b[95m-+.-\u001b[0m%%%%=-:..\n", " .:=+#%%%%%*###%%%%#*+#%%%%%%*+-:\n", @@ -14909,36 +14850,36 @@ "\u001b[93mPrice noise\u001b[0m\n", "\n", "\u001b[93mAll profits ordered\u001b[0m\n", - "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", - "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ 119.9648 EUR │ 11.9965% │ 26% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1125.27 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ 70.5835 EUR │ 7.0584% │ 100% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1074.64 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ -2.6223 EUR │ -0.2622% │ 33% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 941.806 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ -8.2249 EUR │ -0.8225% │ 32% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 997.944 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ -81.3662 EUR │ -8.1366% │ 50% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 918.634 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ -95.0346 EUR │ -9.5035% │ 19% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 904.965 │\n", - "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n", + "╭──────────────────┬───────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", + "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary │ 79.9529 EUR │ 7.9953% │ 21% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1085.26 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ secondary │ 63.2410 EUR │ 6.3241% │ 33% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1067.3 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary │ 4.0900 EUR │ 0.4090% │ 40% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1142.61 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ secondary │ -30.4643 EUR │ -3.0464% │ 25% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 969.536 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ secondary │ -46.4648 EUR │ -4.6465% │ 12% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 956.4 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary │ -117.1194 EUR │ -11.7119% │ 14% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1013.64 │\n", + "╰──────────────────┴───────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n", "\u001b[93mAll growths ordered\u001b[0m\n", "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", "│ Algorithm name │ Growth │ Growth percentage │ Percentage positive trades │ Date range │ Total value │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ 125.2748 EUR │ 12.5275% │ 26% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1125.27 │\n", + "│ primary │ 142.6132 EUR │ 14.2613% │ 40% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1142.61 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ 74.6376 EUR │ 7.4638% │ 100% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1074.64 │\n", + "│ primary │ 85.2629 EUR │ 8.5263% │ 21% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1085.26 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ -2.0557 EUR │ -0.2056% │ 32% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 997.944 │\n", + "│ secondary │ 67.2951 EUR │ 6.7295% │ 33% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1067.3 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ -58.1943 EUR │ -5.8194% │ 33% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 941.806 │\n", + "│ primary │ 13.6371 EUR │ 1.3637% │ 14% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1013.64 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ secondary │ -81.3663 EUR │ -8.1366% │ 50% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 918.634 │\n", + "│ secondary │ -30.4642 EUR │ -3.0464% │ 25% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 969.536 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary │ -95.0346 EUR │ -9.5035% │ 19% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 904.965 │\n", + "│ secondary │ -43.5996 EUR │ -4.3600% │ 12% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 956.4 │\n", "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n" ] } @@ -14961,7 +14902,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -15021,7 +14962,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 11, "metadata": { "collapsed": false }, @@ -15040,15 +14981,15 @@ " .:-+*%%%%- \u001b[95m-+..#\u001b[0m%%%+.\u001b[95m+- +\u001b[0m%%%#*=-: \u001b[93mNumber of runs:\u001b[0m\u001b[92m 1957\u001b[0m\n", " .:-=*%%%%. \u001b[95m+=\u001b[0m .%%# \u001b[95m-+.-\u001b[0m%%%%=-:.. \u001b[93mNumber of orders:\u001b[0m\u001b[92m 39\u001b[0m\n", " .:=+#%%%%%*###%%%%#*+#%%%%%%*+-: \u001b[93mInitial balance:\u001b[0m\u001b[92m 1000.0\u001b[0m\n", - " +%%%%%%%%%%%%%%%%%%%= \u001b[93mFinal balance:\u001b[0m\u001b[92m 1125.2748\u001b[0m\n", - " :++ .=#%%%%%%%%%%%%%*- \u001b[93mTotal net gain:\u001b[0m\u001b[92m 119.9648 12.0%\u001b[0m\n", - " :++: :+%%%%%%#-. \u001b[93mGrowth:\u001b[0m\u001b[92m 125.2748 12.53%\u001b[0m\n", + " +%%%%%%%%%%%%%%%%%%%= \u001b[93mFinal balance:\u001b[0m\u001b[92m 1085.2629\u001b[0m\n", + " :++ .=#%%%%%%%%%%%%%*- \u001b[93mTotal net gain:\u001b[0m\u001b[92m 79.9529 7.995%\u001b[0m\n", + " :++: :+%%%%%%#-. \u001b[93mGrowth:\u001b[0m\u001b[92m 85.2629 8.526%\u001b[0m\n", " :++: .%%%%%#= \u001b[93mNumber of trades closed:\u001b[0m\u001b[92m 1\u001b[0m\n", " :++: .#%%%%%#*= \u001b[93mNumber of trades open(end of backtest):\u001b[0m\u001b[92m 1\u001b[0m\n", - " :++- :%%%%%%%%%+= \u001b[93mPercentage positive trades:\u001b[0m\u001b[92m 26.31578947368421%\u001b[0m\n", - " .++- -%%%%%%%%%%%+= \u001b[93mPercentage negative trades:\u001b[0m\u001b[92m 73.68421052631578%\u001b[0m\n", + " :++- :%%%%%%%%%+= \u001b[93mPercentage positive trades:\u001b[0m\u001b[92m 21.052631578947366%\u001b[0m\n", + " .++- -%%%%%%%%%%%+= \u001b[93mPercentage negative trades:\u001b[0m\u001b[92m 78.94736842105263%\u001b[0m\n", " .++- .%%%%%%%%%%%%%+= \u001b[93mAverage trade size:\u001b[0m\u001b[92m 248.6320 EUR\u001b[0m\n", - " .++- *%%%%%%%%%%%%%*+: \u001b[93mAverage trade duration:\u001b[0m\u001b[92m 16810.421329006214 hours\u001b[0m\n", + " .++- *%%%%%%%%%%%%%*+: \u001b[93mAverage trade duration:\u001b[0m\u001b[92m 16810.9575127481 hours\u001b[0m\n", " .++- %%%%%%%%%%%%%%#+=\n", " =++........:::%%%%%%%%%%%%%%*+-\n", " .=++++++++++**#%%%%%%%%%%%%%++.\n", @@ -15057,64 +14998,142 @@ "╭────────────┬──────────┬──────────────────────┬───────────────────────┬──────────────┬───────────────┬───────────────────────────┬────────────────┬───────────────╮\n", "│ Position │ Amount │ Pending buy amount │ Pending sell amount │ Cost (EUR) │ Value (EUR) │ Percentage of portfolio │ Growth (EUR) │ Growth_rate │\n", "├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤\n", - "│ EUR │ 870.75 │ 0 │ 0 │ 870.75 │ 870.75 │ 77.3811% │ 0 │ 0.0000% │\n", + "│ EUR │ 830.738 │ 0 │ 0 │ 830.738 │ 830.738 │ 76.5472% │ 0 │ 0.0000% │\n", "├────────────┼──────────┼──────────────────────┼───────────────────────┼──────────────┼───────────────┼───────────────────────────┼────────────────┼───────────────┤\n", - "│ BTC │ 0.01 │ 0 │ 0 │ 249.215 │ 254.525 │ 22.6189% │ 5.31 │ 2.1307% │\n", + "│ BTC │ 0.01 │ 0 │ 0 │ 249.215 │ 254.525 │ 23.4528% │ 5.31 │ 2.1307% │\n", "╰────────────┴──────────┴──────────────────────┴───────────────────────┴──────────────┴───────────────┴───────────────────────────┴────────────────┴───────────────╯\n", "\u001b[93mTrades overview\u001b[0m\n", - "╭───────────────────┬──────────┬───────────────────────────────┬─────────────────────┬────────────────────────────┬──────────────────────────┬────────────────────┬───────────────────────╮\n", - "│ Pair (Trade id) │ Status │ Net gain (EUR) │ Open date │ Close date │ Duration │ Open price (EUR) │ Close price's (EUR) │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (1) │ CLOSED │ -1.1461 (-0.4594%) │ 2022-12-26 02:00:00 │ 2025-02-19 14:37:41.267841 │ 18876.628129955832 hours │ 15891 │ 15818.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (2) │ CLOSED │ -0.3690 (-0.1483%) │ 2022-12-26 22:00:00 │ 2025-02-19 14:37:41.615564 │ 18856.628226545556 hours │ 15848 │ 15824.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (3) │ CLOSED │ 85.8918 (34.5341%) │ 2023-01-02 12:00:00 │ 2025-02-19 14:37:47.238045 │ 18698.629788345836 hours │ 15642.5 │ 21044.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (4) │ CLOSED │ -4.5597 (-1.8370%) │ 2023-02-01 22:00:00 │ 2025-02-19 14:37:48.132302 │ 17968.630036750557 hours │ 21584.5 │ 21188.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (5) │ CLOSED │ -2.3518 (-0.9454%) │ 2023-02-07 22:00:00 │ 2025-02-19 14:37:48.654490 │ 17824.63018180278 hours │ 21630 │ 21425.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (6) │ CLOSED │ 21.8647 (8.7572%) │ 2023-02-15 08:00:00 │ 2025-02-19 14:37:50.552297 │ 17646.63070897139 hours │ 20634.5 │ 22441.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (7) │ CLOSED │ 53.3655 (21.5166%) │ 2023-03-13 02:00:00 │ 2025-02-19 14:37:53.757568 │ 17028.631599324446 hours │ 20842 │ 25326.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (8) │ CLOSED │ -2.3376 (-0.9429%) │ 2023-03-23 14:00:00 │ 2025-02-19 14:37:54.246152 │ 16776.63173504222 hours │ 25825 │ 25581.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (9) │ CLOSED │ -8.2176 (-3.2886%) │ 2023-03-26 12:00:00 │ 2025-02-19 14:37:54.664445 │ 16706.63185123472 hours │ 26029.5 │ 25173.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (10) │ CLOSED │ -4.1040 (-1.6509%) │ 2023-03-29 14:00:00 │ 2025-02-19 14:37:55.700535 │ 16632.6321390375 hours │ 26167 │ 25735.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (11) │ CLOSED │ -2.5460 (-1.0282%) │ 2023-04-05 10:00:00 │ 2025-02-19 14:37:56.117703 │ 16468.6322549175 hours │ 26065.5 │ 25797.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (12) │ CLOSED │ 9.6283 (3.8904%) │ 2023-04-09 22:00:00 │ 2025-02-19 14:37:57.729326 │ 16360.632702590556 hours │ 26051 │ 27064.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (13) │ CLOSED │ -7.7445 (-3.1145%) │ 2023-04-18 20:00:00 │ 2025-02-19 14:37:58.096395 │ 16146.632804554167 hours │ 27628.5 │ 26768.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (14) │ CLOSED │ 1.2336 (0.4973%) │ 2023-04-26 06:00:00 │ 2025-02-19 14:37:59.720684 │ 15968.633255745555 hours │ 25838.5 │ 25967.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (15) │ CLOSED │ -2.5033 (-1.0019%) │ 2023-05-04 08:00:00 │ 2025-02-19 14:38:00.822668 │ 15774.633561852223 hours │ 26299.5 │ 26036.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (16) │ CLOSED │ -3.6897 (-1.4900%) │ 2023-05-15 06:00:00 │ 2025-02-19 14:38:01.946701 │ 15512.63387408361 hours │ 25268 │ 24891.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (17) │ CLOSED │ -3.6036 (-1.4425%) │ 2023-05-17 20:00:00 │ 2025-02-19 14:38:02.405810 │ 15450.63400161389 hours │ 25234.5 │ 24870.5 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (18) │ CLOSED │ -1.6335 (-0.6589%) │ 2023-05-20 22:00:00 │ 2025-02-19 14:38:02.844927 │ 15376.634123590833 hours │ 25043 │ 24878.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (19) │ CLOSED │ -7.2128 (-2.9046%) │ 2023-05-23 04:00:00 │ 2025-02-19 14:38:03.390572 │ 15322.634275158887 hours │ 25339 │ 24603.0 │\n", - "├───────────────────┼──────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", - "│ BTC/EUR (20) │ OPEN │ 4.3650 (1.7515%) (unrealized) │ 2023-05-27 02:00:00 │ │ 118.0 hours │ 24921.5 │ │\n", - "╰───────────────────┴──────────┴───────────────────────────────┴─────────────────────┴────────────────────────────┴──────────────────────────┴────────────────────┴───────────────────────╯\n", + "╭───────────────────┬────────────┬───────────────────────────────┬─────────────────────┬────────────────────────────┬──────────────────────────┬────────────────────┬───────────────────────╮\n", + "│ Pair (Trade id) │ Status │ Net gain (EUR) │ Open date │ Close date │ Duration │ Open price (EUR) │ Close price's (EUR) │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (1) │ CLOSED │ -1.1461 (-0.4594%) │ 2022-12-26 02:00:00 │ 2025-02-19 15:09:53.132212 │ 18877.164758947776 hours │ 15891 │ 15818.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (2) │ CLOSED │ -0.3690 (-0.1483%) │ 2022-12-26 22:00:00 │ 2025-02-19 15:09:53.964763 │ 18857.164990211946 hours │ 15848 │ 15824.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (3) │ CLOSED │ 85.8918 (34.5341%) │ 2023-01-02 12:00:00 │ 2025-02-19 15:09:59.226377 │ 18699.166451771387 hours │ 15642.5 │ 21044.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (4) │ CLOSED │ -4.5597 (-1.8370%) │ 2023-02-01 22:00:00 │ 2025-02-19 15:10:00.061724 │ 17969.166683812222 hours │ 21584.5 │ 21188.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (5) │ CLOSED │ -2.3518 (-0.9454%) │ 2023-02-07 22:00:00 │ 2025-02-19 15:10:00.618149 │ 17825.16683837472 hours │ 21630 │ 21425.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (6) │ CLOSED, SL │ 17.0429 (6.8259%) │ 2023-02-15 08:00:00 │ 2025-02-19 15:10:01.435570 │ 17647.16706543611 hours │ 20634.5 │ 22043.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (7) │ CLOSED, SL │ 23.9547 (9.6584%) │ 2023-03-13 02:00:00 │ 2025-02-19 15:10:03.726576 │ 17029.167701826667 hours │ 20842 │ 22855.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (8) │ CLOSED │ -2.3376 (-0.9429%) │ 2023-03-23 14:00:00 │ 2025-02-19 15:10:04.698278 │ 16777.16797174389 hours │ 25825 │ 25581.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (9) │ CLOSED │ -8.2176 (-3.2886%) │ 2023-03-26 12:00:00 │ 2025-02-19 15:10:05.081274 │ 16707.168078131668 hours │ 26029.5 │ 25173.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (10) │ CLOSED │ -4.1040 (-1.6509%) │ 2023-03-29 14:00:00 │ 2025-02-19 15:10:06.028505 │ 16633.16834125139 hours │ 26167 │ 25735.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (11) │ CLOSED │ -2.5460 (-1.0282%) │ 2023-04-05 10:00:00 │ 2025-02-19 15:10:06.326890 │ 16469.16842413611 hours │ 26065.5 │ 25797.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (12) │ CLOSED │ 9.6283 (3.8904%) │ 2023-04-09 22:00:00 │ 2025-02-19 15:10:07.699173 │ 16361.168805325835 hours │ 26051 │ 27064.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (13) │ CLOSED │ -7.7445 (-3.1145%) │ 2023-04-18 20:00:00 │ 2025-02-19 15:10:08.019595 │ 16147.168894331944 hours │ 27628.5 │ 26768.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (14) │ CLOSED, SL │ -4.5456 (-1.8325%) │ 2023-04-26 06:00:00 │ 2025-02-19 15:10:08.659078 │ 15969.169071966111 hours │ 25838.5 │ 25365.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (15) │ CLOSED │ -2.5033 (-1.0019%) │ 2023-05-04 08:00:00 │ 2025-02-19 15:10:09.824548 │ 15775.169395707777 hours │ 26299.5 │ 26036.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (16) │ CLOSED │ -3.6897 (-1.4900%) │ 2023-05-15 06:00:00 │ 2025-02-19 15:10:10.735040 │ 15513.169648622223 hours │ 25268 │ 24891.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (17) │ CLOSED │ -3.6036 (-1.4425%) │ 2023-05-17 20:00:00 │ 2025-02-19 15:10:11.150839 │ 15451.169764121945 hours │ 25234.5 │ 24870.5 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (18) │ CLOSED │ -1.6335 (-0.6589%) │ 2023-05-20 22:00:00 │ 2025-02-19 15:10:11.502002 │ 15377.169861667222 hours │ 25043 │ 24878.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (19) │ CLOSED │ -7.2128 (-2.9046%) │ 2023-05-23 04:00:00 │ 2025-02-19 15:10:11.981377 │ 15323.169994826943 hours │ 25339 │ 24603.0 │\n", + "├───────────────────┼────────────┼───────────────────────────────┼─────────────────────┼────────────────────────────┼──────────────────────────┼────────────────────┼───────────────────────┤\n", + "│ BTC/EUR (20) │ OPEN │ 4.3650 (1.7515%) (unrealized) │ 2023-05-27 02:00:00 │ │ 118.0 hours │ 24921.5 │ │\n", + "╰───────────────────┴────────────┴───────────────────────────────┴─────────────────────┴────────────────────────────┴──────────────────────────┴────────────────────┴───────────────────────╯\n", "\u001b[93mStop losses overview\u001b[0m\n", - "╭────────────────────┬──────────┬──────────┬────────┬─────────────┬──────────────┬────────────────┬───────────────────┬──────────────┬────────┬───────────────╮\n", - "│ Trade (Trade id) │ Status │ Active │ Type │ stop loss │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │\n", - "├────────────────────┼──────────┼──────────┼────────┼─────────────┼──────────────┼────────────────┼───────────────────┼──────────────┼────────┼───────────────┤\n", - "╰────────────────────┴──────────┴──────────┴────────┴─────────────┴──────────────┴────────────────┴───────────────────┴──────────────┴────────┴───────────────╯\n", + "╭────────────────────┬───────────────┬──────────┬──────────┬──────────────────────┬────────────────┬────────────────┬───────────────────┬──────────────┬────────────┬───────────────╮\n", + "│ Trade (Trade id) │ Status │ Active │ Type │ stop loss │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (1) │ NOT TRIGGERED │ True │ TRAILING │ 15096.4500(5.0%) EUR │ 15891.0000 EUR │ None │ 15891 │ 100.0% │ 0.0157 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (2) │ NOT TRIGGERED │ True │ TRAILING │ 15055.6000(5.0%) EUR │ 15848.0000 EUR │ None │ 15848 │ 100.0% │ 0.0157 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (3) │ NOT TRIGGERED │ True │ TRAILING │ 20888.6000(5.0%) EUR │ 15642.5000 EUR │ None │ 21988 │ 100.0% │ 0.0159 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (4) │ NOT TRIGGERED │ True │ TRAILING │ 20813.5500(5.0%) EUR │ 21584.5000 EUR │ None │ 21909 │ 100.0% │ 0.0115 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (5) │ NOT TRIGGERED │ True │ TRAILING │ 20589.3500(5.0%) EUR │ 21630.0000 EUR │ None │ 21673 │ 100.0% │ 0.0115 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (6) │ TRIGGERED │ False │ TRAILING │ 22325.0000(5.0%) EUR │ 20634.5000 EUR │ 22043.0 │ 23500 │ 100.0% │ 0.0121 BTC │ 0.0121 │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (7) │ TRIGGERED │ False │ TRAILING │ 22952.0000(5.0%) EUR │ 20842.0000 EUR │ 22855.0 │ 24160 │ 100.0% │ 0.0119 BTC │ 0.0119 │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (8) │ NOT TRIGGERED │ True │ TRAILING │ 24905.2000(5.0%) EUR │ 25825.0000 EUR │ None │ 26216 │ 100.0% │ 0.0096 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (9) │ NOT TRIGGERED │ True │ TRAILING │ 24728.0250(5.0%) EUR │ 26029.5000 EUR │ None │ 26029.5 │ 100.0% │ 0.0096 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (10) │ NOT TRIGGERED │ True │ TRAILING │ 25168.3500(5.0%) EUR │ 26167.0000 EUR │ None │ 26493 │ 100.0% │ 0.0095 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (11) │ NOT TRIGGERED │ True │ TRAILING │ 24762.2250(5.0%) EUR │ 26065.5000 EUR │ None │ 26065.5 │ 100.0% │ 0.0095 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (12) │ NOT TRIGGERED │ True │ TRAILING │ 26509.7500(5.0%) EUR │ 26051.0000 EUR │ None │ 27905 │ 100.0% │ 0.0095 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (13) │ NOT TRIGGERED │ True │ TRAILING │ 26306.4500(5.0%) EUR │ 27628.5000 EUR │ None │ 27691 │ 100.0% │ 0.0090 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (14) │ TRIGGERED │ False │ TRAILING │ 25636.7000(5.0%) EUR │ 25838.5000 EUR │ 25365.0 │ 26986 │ 100.0% │ 0.0096 BTC │ 0.0096 │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (15) │ NOT TRIGGERED │ True │ TRAILING │ 25495.1500(5.0%) EUR │ 26299.5000 EUR │ None │ 26837 │ 100.0% │ 0.0095 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (16) │ NOT TRIGGERED │ True │ TRAILING │ 24019.8000(5.0%) EUR │ 25268.0000 EUR │ None │ 25284 │ 100.0% │ 0.0098 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (17) │ NOT TRIGGERED │ True │ TRAILING │ 24065.4000(5.0%) EUR │ 25234.5000 EUR │ None │ 25332 │ 100.0% │ 0.0099 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (18) │ NOT TRIGGERED │ True │ TRAILING │ 23893.4500(5.0%) EUR │ 25043.0000 EUR │ None │ 25151 │ 100.0% │ 0.0099 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (19) │ NOT TRIGGERED │ True │ TRAILING │ 24091.0500(5.0%) EUR │ 25339.0000 EUR │ None │ 25359 │ 100.0% │ 0.0098 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼──────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (20) │ NOT TRIGGERED │ True │ TRAILING │ 24932.7500(5.0%) EUR │ 24921.5000 EUR │ None │ 26245 │ 100.0% │ 0.0100 BTC │ │\n", + "╰────────────────────┴───────────────┴──────────┴──────────┴──────────────────────┴────────────────┴────────────────┴───────────────────┴──────────────┴────────────┴───────────────╯\n", "\u001b[93mTake profits overview\u001b[0m\n", - "╭────────────────────┬──────────┬──────────┬────────┬───────────────┬──────────────┬────────────────┬───────────────────┬──────────────┬────────┬───────────────╮\n", - "│ Trade (Trade id) │ Status │ Active │ Type │ Take profit │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │\n", - "├────────────────────┼──────────┼──────────┼────────┼───────────────┼──────────────┼────────────────┼───────────────────┼──────────────┼────────┼───────────────┤\n", - "╰────────────────────┴──────────┴──────────┴────────┴───────────────┴──────────────┴────────────────┴───────────────────┴──────────────┴────────┴───────────────╯\n" + "╭────────────────────┬───────────────┬──────────┬──────────┬───────────────────────┬────────────────┬────────────────┬───────────────────┬──────────────┬────────────┬───────────────╮\n", + "│ Trade (Trade id) │ Status │ Active │ Type │ Take profit │ Open price │ Sell price's │ High water mark │ Percentage │ Size │ Sold amount │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (1) │ NOT TRIGGERED │ True │ TRAILING │ 17480.1000(10.0)% EUR │ 15891.0000 EUR │ None │ │ 50.0% │ 0.0078 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (2) │ NOT TRIGGERED │ True │ TRAILING │ 17432.8000(10.0)% EUR │ 15848.0000 EUR │ None │ │ 50.0% │ 0.0078 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (3) │ NOT TRIGGERED │ True │ TRAILING │ 19789.2000(10.0)% EUR │ 15642.5000 EUR │ None │ 21988.0 │ 50.0% │ 0.0080 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (4) │ NOT TRIGGERED │ True │ TRAILING │ 23742.9500(10.0)% EUR │ 21584.5000 EUR │ None │ │ 50.0% │ 0.0057 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (5) │ NOT TRIGGERED │ True │ TRAILING │ 23793.0000(10.0)% EUR │ 21630.0000 EUR │ None │ │ 50.0% │ 0.0057 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (6) │ NOT TRIGGERED │ True │ TRAILING │ 22697.9500(10.0)% EUR │ 20634.5000 EUR │ None │ 23500.0 │ 50.0% │ 0.0060 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (7) │ NOT TRIGGERED │ True │ TRAILING │ 22926.2000(10.0)% EUR │ 20842.0000 EUR │ None │ 24160.0 │ 50.0% │ 0.0060 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (8) │ NOT TRIGGERED │ True │ TRAILING │ 28407.5000(10.0)% EUR │ 25825.0000 EUR │ None │ │ 50.0% │ 0.0048 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (9) │ NOT TRIGGERED │ True │ TRAILING │ 28632.4500(10.0)% EUR │ 26029.5000 EUR │ None │ │ 50.0% │ 0.0048 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (10) │ NOT TRIGGERED │ True │ TRAILING │ 28783.7000(10.0)% EUR │ 26167.0000 EUR │ None │ │ 50.0% │ 0.0047 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (11) │ NOT TRIGGERED │ True │ TRAILING │ 28672.0500(10.0)% EUR │ 26065.5000 EUR │ None │ │ 50.0% │ 0.0047 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (12) │ NOT TRIGGERED │ True │ TRAILING │ 28656.1000(10.0)% EUR │ 26051.0000 EUR │ None │ │ 50.0% │ 0.0047 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (13) │ NOT TRIGGERED │ True │ TRAILING │ 30391.3500(10.0)% EUR │ 27628.5000 EUR │ None │ │ 50.0% │ 0.0045 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (14) │ NOT TRIGGERED │ True │ TRAILING │ 28422.3500(10.0)% EUR │ 25838.5000 EUR │ None │ │ 50.0% │ 0.0048 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (15) │ NOT TRIGGERED │ True │ TRAILING │ 28929.4500(10.0)% EUR │ 26299.5000 EUR │ None │ │ 50.0% │ 0.0047 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (16) │ NOT TRIGGERED │ True │ TRAILING │ 27794.8000(10.0)% EUR │ 25268.0000 EUR │ None │ │ 50.0% │ 0.0049 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (17) │ NOT TRIGGERED │ True │ TRAILING │ 27757.9500(10.0)% EUR │ 25234.5000 EUR │ None │ │ 50.0% │ 0.0050 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (18) │ NOT TRIGGERED │ True │ TRAILING │ 27547.3000(10.0)% EUR │ 25043.0000 EUR │ None │ │ 50.0% │ 0.0050 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (19) │ NOT TRIGGERED │ True │ TRAILING │ 27872.9000(10.0)% EUR │ 25339.0000 EUR │ None │ │ 50.0% │ 0.0049 BTC │ │\n", + "├────────────────────┼───────────────┼──────────┼──────────┼───────────────────────┼────────────────┼────────────────┼───────────────────┼──────────────┼────────────┼───────────────┤\n", + "│ BTC/EUR (20) │ NOT TRIGGERED │ True │ TRAILING │ 27413.6500(10.0)% EUR │ 24921.5000 EUR │ None │ │ 50.0% │ 0.0050 BTC │ │\n", + "╰────────────────────┴───────────────┴──────────┴──────────┴───────────────────────┴────────────────┴────────────────┴───────────────────┴──────────────┴────────────┴───────────────╯\n" ] }, { @@ -19117,25 +19136,25 @@ "name": "Sell Signal", "type": "scatter", "x": [ - "2025-02-19T14:37:41.267841", - "2025-02-19T14:37:41.615564", - "2025-02-19T14:37:47.238045", - "2025-02-19T14:37:48.132302", - "2025-02-19T14:37:48.654490", - "2025-02-19T14:37:50.552297", - "2025-02-19T14:37:53.757568", - "2025-02-19T14:37:54.246152", - "2025-02-19T14:37:54.664445", - "2025-02-19T14:37:55.700535", - "2025-02-19T14:37:56.117703", - "2025-02-19T14:37:57.729326", - "2025-02-19T14:37:58.096395", - "2025-02-19T14:37:59.720684", - "2025-02-19T14:38:00.822668", - "2025-02-19T14:38:01.946701", - "2025-02-19T14:38:02.405810", - "2025-02-19T14:38:02.844927", - "2025-02-19T14:38:03.390572", + "2025-02-19T15:09:53.132212", + "2025-02-19T15:09:53.964763", + "2025-02-19T15:09:59.226377", + "2025-02-19T15:10:00.061724", + "2025-02-19T15:10:00.618149", + "2025-02-19T15:10:01.435570", + "2025-02-19T15:10:03.726576", + "2025-02-19T15:10:04.698278", + "2025-02-19T15:10:05.081274", + "2025-02-19T15:10:06.028505", + "2025-02-19T15:10:06.326890", + "2025-02-19T15:10:07.699173", + "2025-02-19T15:10:08.019595", + "2025-02-19T15:10:08.659078", + "2025-02-19T15:10:09.824548", + "2025-02-19T15:10:10.735040", + "2025-02-19T15:10:11.150839", + "2025-02-19T15:10:11.502002", + "2025-02-19T15:10:11.981377", null ], "xaxis": "x", @@ -20058,7 +20077,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 12, "metadata": { "collapsed": false }, @@ -20074,14 +20093,14 @@ "name": "stderr", "output_type": "stream", "text": [ - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 84.31it/s]\n", - "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:24<00:00, 88.07it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 184.93it/s]\n", - "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:23<00:00, 93.05it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 113.39it/s]\n", - "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:20<00:00, 107.07it/s]\n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 194.65it/s]\n", - "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:17<00:00, 125.81it/s]\n" + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 95.16it/s]\n", + "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:20<00:00, 107.02it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 168.31it/s]\n", + "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:19<00:00, 110.04it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 152.71it/s]\n", + "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:16<00:00, 133.47it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 219.04it/s]\n", + "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 2173/2173 [00:15<00:00, 142.75it/s]\n" ] }, { @@ -20095,14 +20114,14 @@ "name": "stderr", "output_type": "stream", "text": [ - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 197.40it/s]\n", - "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:23<00:00, 83.23it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 132.58it/s]\n", - "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:21<00:00, 89.83it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 194.67it/s]\n", - "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:19<00:00, 101.23it/s]\n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 98.48it/s]\n", - "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:20<00:00, 96.49it/s] \n" + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 162.80it/s]\n", + "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:18<00:00, 104.34it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 129.09it/s]\n", + "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:18<00:00, 104.70it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 204.05it/s]\n", + "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:15<00:00, 128.71it/s]\n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 141.45it/s]\n", + "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 1957/1957 [00:14<00:00, 130.65it/s]\n" ] }, { @@ -20116,14 +20135,14 @@ "name": "stderr", "output_type": "stream", "text": [ - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 180.60it/s]\n", - "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:37<00:00, 69.35it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 100.55it/s]\n", - "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:31<00:00, 81.22it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 123.20it/s]\n", - "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:26<00:00, 98.40it/s] \n", - "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 146.06it/s]\n", - "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:27<00:00, 94.38it/s] " + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 143.38it/s]\n", + "Running backtest for algorithm with name primary_21_50: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:39<00:00, 65.22it/s] \n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 127.53it/s]\n", + "Running backtest for algorithm with name primary_21_75: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:30<00:00, 84.77it/s] \n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 60.33it/s]\n", + "Running backtest for algorithm with name primary_50_100: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:25<00:00, 99.60it/s] \n", + "Preparing backtest market data: 100%|\u001b[32m██████████\u001b[0m| 2/2 [00:00<00:00, 134.34it/s]\n", + "Running backtest for algorithm with name primary_50_200: 100%|\u001b[32m██████████\u001b[0m| 2569/2569 [00:22<00:00, 112.78it/s]" ] }, { @@ -20134,8 +20153,8 @@ " :%%%#+- .=*#%%% \u001b[92mBacktest reports evaluation\u001b[0m\n", " *%%%%%%%+------=*%%%%%%%- \u001b[92m---------------------------\u001b[0m\n", " *%%%%%%%%%%%%%%%%%%%%%%%- \u001b[93mNumber of reports:\u001b[0m \u001b[92m4 backtest reports\u001b[0m\n", - " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_21_75) 122.7062 EUR 12.2706% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", - " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_21_75) 128.2862 EUR 12.8286% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", + " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_21_75) 121.7536 EUR 12.1754% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", + " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_21_75) 397.6382 EUR 39.7638% (up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00)\u001b[0m\n", " .:-+*%%%%- \u001b[95m-+..#\u001b[0m%%%+.\u001b[95m+- +\u001b[0m%%%#*=-:\n", " .:-=*%%%%. \u001b[95m+=\u001b[0m .%%# \u001b[95m-+.-\u001b[0m%%%%=-:..\n", " .:=+#%%%%%*###%%%%#*+#%%%%%%*+-:\n", @@ -20158,33 +20177,33 @@ "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬───────────────────────────────────────────────────┬───────────────╮\n", "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ 122.7062 EUR │ 12.2706% │ 29% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1128.29 │\n", + "│ primary_21_75 │ 121.7536 EUR │ 12.1754% │ 29% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1397.64 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ 119.9648 EUR │ 11.9965% │ 26% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1125.27 │\n", + "│ primary_21_50 │ 79.9529 EUR │ 7.9953% │ 21% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1085.26 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ 85.8809 EUR │ 8.5881% │ 33% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1087.5 │\n", + "│ primary_50_100 │ 23.7309 EUR │ 2.3731% │ 43% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1025.35 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ 70.8413 EUR │ 7.0841% │ 57% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1072.08 │\n", + "│ primary_50_200 │ 20.8710 EUR │ 2.0871% │ 43% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1022.11 │\n", "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴───────────────────────────────────────────────────┴───────────────╯\n", "\u001b[93mAll growths ordered\u001b[0m\n", "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬───────────────────────────────────────────────────┬───────────────╮\n", "│ Algorithm name │ Growth │ Growth percentage │ Percentage positive trades │ Date range │ Total value │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ 128.2862 EUR │ 12.8286% │ 29% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1128.29 │\n", + "│ primary_21_75 │ 397.6382 EUR │ 39.7638% │ 29% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1397.64 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ 125.2748 EUR │ 12.5275% │ 26% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1125.27 │\n", + "│ primary_21_50 │ 85.2629 EUR │ 8.5263% │ 21% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1085.26 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ 87.4980 EUR │ 8.7498% │ 33% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1087.5 │\n", + "│ primary_50_100 │ 25.3479 EUR │ 2.5348% │ 43% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1025.35 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼───────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ 72.0810 EUR │ 7.2081% │ 57% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1072.08 │\n", + "│ primary_50_200 │ 22.1107 EUR │ 2.2111% │ 43% │ up_turn 2022-12-20 00:00:00 - 2023-06-01 00:00:00 │ 1022.11 │\n", "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴───────────────────────────────────────────────────┴───────────────╯\n", "The winning configuration for the up turn backtest date range is primary_21_75\n", "\n", " :%%%#+- .=*#%%% \u001b[92mBacktest reports evaluation\u001b[0m\n", " *%%%%%%%+------=*%%%%%%%- \u001b[92m---------------------------\u001b[0m\n", " *%%%%%%%%%%%%%%%%%%%%%%%- \u001b[93mNumber of reports:\u001b[0m \u001b[92m4 backtest reports\u001b[0m\n", - " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_21_75) -6.1955 EUR -0.6195% (sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00)\u001b[0m\n", - " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_21_75) -0.3761 EUR -0.0376% (sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00)\u001b[0m\n", + " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_21_75) 18.6540 EUR 1.8654% (sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00)\u001b[0m\n", + " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_21_75) 155.8014 EUR 15.5801% (sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00)\u001b[0m\n", " .:-+*%%%%- \u001b[95m-+..#\u001b[0m%%%+.\u001b[95m+- +\u001b[0m%%%#*=-:\n", " .:-=*%%%%. \u001b[95m+=\u001b[0m .%%# \u001b[95m-+.-\u001b[0m%%%%=-:..\n", " .:=+#%%%%%*###%%%%#*+#%%%%%%*+-:\n", @@ -20204,36 +20223,36 @@ "\u001b[93mPrice noise\u001b[0m\n", "\n", "\u001b[93mAll profits ordered\u001b[0m\n", - "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬────────────────────────────────────────────────────┬───────────────╮\n", - "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ -6.1955 EUR │ -0.6195% │ 33% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 999.624 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ -8.2249 EUR │ -0.8225% │ 32% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 997.944 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ -32.1389 EUR │ -3.2139% │ 43% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 970.813 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ -47.3143 EUR │ -4.7314% │ 12% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 956.667 │\n", - "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴────────────────────────────────────────────────────┴───────────────╯\n", + "╭──────────────────┬─────────────┬─────────────────────┬──────────────────────────────┬────────────────────────────────────────────────────┬───────────────╮\n", + "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", + "├──────────────────┼─────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_21_75 │ 18.6540 EUR │ 1.8654% │ 44% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1155.8 │\n", + "├──────────────────┼─────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_50_200 │ 6.3884 EUR │ 0.6388% │ 43% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1009.34 │\n", + "├──────────────────┼─────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_21_50 │ 4.0900 EUR │ 0.4090% │ 40% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1142.61 │\n", + "├──────────────────┼─────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_50_100 │ 3.3587 EUR │ 0.3359% │ 38% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1138.67 │\n", + "╰──────────────────┴─────────────┴─────────────────────┴──────────────────────────────┴────────────────────────────────────────────────────┴───────────────╯\n", "\u001b[93mAll growths ordered\u001b[0m\n", "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬────────────────────────────────────────────────────┬───────────────╮\n", "│ Algorithm name │ Growth │ Growth percentage │ Percentage positive trades │ Date range │ Total value │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ -0.3761 EUR │ -0.0376% │ 33% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 999.624 │\n", + "│ primary_21_75 │ 155.8014 EUR │ 15.5801% │ 44% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1155.8 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ -2.0557 EUR │ -0.2056% │ 32% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 997.944 │\n", + "│ primary_21_50 │ 142.6132 EUR │ 14.2613% │ 40% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1142.61 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ -29.1873 EUR │ -2.9187% │ 43% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 970.813 │\n", + "│ primary_50_100 │ 138.6682 EUR │ 13.8668% │ 38% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1138.67 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ -43.3327 EUR │ -4.3333% │ 12% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 956.667 │\n", + "│ primary_50_200 │ 9.3400 EUR │ 0.9340% │ 43% │ sideways 2022-06-10 00:00:00 - 2023-01-10 00:00:00 │ 1009.34 │\n", "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴────────────────────────────────────────────────────┴───────────────╯\n", - "The winning configuration for the side ways backtest date range is None\n", + "The winning configuration for the side ways backtest date range is primary_21_75\n", "\n", " :%%%#+- .=*#%%% \u001b[92mBacktest reports evaluation\u001b[0m\n", " *%%%%%%%+------=*%%%%%%%- \u001b[92m---------------------------\u001b[0m\n", " *%%%%%%%%%%%%%%%%%%%%%%%- \u001b[93mNumber of reports:\u001b[0m \u001b[92m4 backtest reports\u001b[0m\n", - " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_50_200) -48.1296 EUR -4.8130% (down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00)\u001b[0m\n", - " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_50_200) -48.1296 EUR -4.8130% (down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00)\u001b[0m\n", + " .%%%%%%%%%%%%%%%%%%%%%%# \u001b[93mLargest overall profit:\u001b[0m\u001b[92m\u001b[0m\u001b[92m (Algorithm primary_50_200) -8.5797 EUR -0.8580% (down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00)\u001b[0m\n", + " #%%%####%%%%%%%%**#%%%+ \u001b[93mLargest overall growth:\u001b[0m\u001b[92m (Algorithm primary_50_200) 209.9956 EUR 20.9996% (down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00)\u001b[0m\n", " .:-+*%%%%- \u001b[95m-+..#\u001b[0m%%%+.\u001b[95m+- +\u001b[0m%%%#*=-:\n", " .:-=*%%%%. \u001b[95m+=\u001b[0m .%%# \u001b[95m-+.-\u001b[0m%%%%=-:..\n", " .:=+#%%%%%*###%%%%#*+#%%%%%%*+-:\n", @@ -20253,30 +20272,30 @@ "\u001b[93mPrice noise\u001b[0m\n", "\n", "\u001b[93mAll profits ordered\u001b[0m\n", - "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", - "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ -48.1296 EUR │ -4.8130% │ 20% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 951.87 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ -60.1076 EUR │ -6.0108% │ 10% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 939.893 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ -74.0502 EUR │ -7.4050% │ 16% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 925.95 │\n", - "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ -95.0346 EUR │ -9.5035% │ 19% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 904.965 │\n", - "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n", + "╭──────────────────┬───────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", + "│ Algorithm name │ Profit │ Profit percentage │ Percentage positive trades │ Date range │ Total value │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_50_200 │ -8.5797 EUR │ -0.8580% │ 40% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 991.42 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_50_100 │ -20.4421 EUR │ -2.0442% │ 30% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1108.45 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_21_75 │ -54.2657 EUR │ -5.4266% │ 21% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1210 │\n", + "├──────────────────┼───────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", + "│ primary_21_50 │ -117.1194 EUR │ -11.7119% │ 14% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1013.64 │\n", + "╰──────────────────┴───────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n", "\u001b[93mAll growths ordered\u001b[0m\n", "╭──────────────────┬──────────────┬─────────────────────┬──────────────────────────────┬─────────────────────────────────────────────────────┬───────────────╮\n", "│ Algorithm name │ Growth │ Growth percentage │ Percentage positive trades │ Date range │ Total value │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_200 │ -48.1296 EUR │ -4.8130% │ 20% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 951.87 │\n", + "│ primary_21_75 │ 209.9956 EUR │ 20.9996% │ 21% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1210 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_50_100 │ -60.1075 EUR │ -6.0108% │ 10% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 939.893 │\n", + "│ primary_50_100 │ 108.4465 EUR │ 10.8447% │ 30% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1108.45 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_75 │ -74.0502 EUR │ -7.4050% │ 16% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 925.95 │\n", + "│ primary_21_50 │ 13.6371 EUR │ 1.3637% │ 14% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 1013.64 │\n", "├──────────────────┼──────────────┼─────────────────────┼──────────────────────────────┼─────────────────────────────────────────────────────┼───────────────┤\n", - "│ primary_21_50 │ -95.0346 EUR │ -9.5035% │ 19% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 904.965 │\n", + "│ primary_50_200 │ -8.5797 EUR │ -0.8580% │ 40% │ down_turn 2021-12-21 00:00:00 - 2022-06-20 00:00:00 │ 991.42 │\n", "╰──────────────────┴──────────────┴─────────────────────┴──────────────────────────────┴─────────────────────────────────────────────────────┴───────────────╯\n", - "The winning configuration for the down turn backtest date range is None\n" + "The winning configuration for the down turn backtest date range is primary_21_75\n" ] }, { diff --git a/investing_algorithm_framework/app/context.py b/investing_algorithm_framework/app/context.py index 6b539491..3b17f1fa 100644 --- a/investing_algorithm_framework/app/context.py +++ b/investing_algorithm_framework/app/context.py @@ -74,7 +74,7 @@ def create_order( execute=True, validate=True, sync=True - ): + ) -> Order: """ Function to create an order. This function will create an order and execute it if the execute parameter is set to True. If the @@ -157,7 +157,7 @@ def create_limit_order( execute=True, validate=True, sync=True - ): + ) -> Order: """ Function to create a limit order. This function will create a limit order and execute it if the execute parameter is set to True. If the @@ -516,7 +516,7 @@ def has_position( amount_gte=None, amount_lt=None, amount_lte=None - ): + ) -> bool: """ Function to check if a position exists. This function will return True if a position exists, False otherwise. This function will check @@ -677,7 +677,7 @@ def get_position_percentage_of_portfolio_by_net_size( def close_position( self, symbol, market=None, identifier=None, precision=None - ): + ) -> Order: """ Function to close a position. This function will close a position by creating a market order to sell the position. If the precision @@ -716,7 +716,7 @@ def close_position( ticker = self.market_data_source_service.get_ticker( symbol=symbol, market=market ) - self.create_limit_order( + return self.create_limit_order( target_symbol=position.symbol, amount=position.get_amount(), order_side=OrderSide.SELL.value, @@ -1137,7 +1137,7 @@ def add_take_profit( ) return self.trade_service.get(trade.id) - def close_trade(self, trade, precision=None) -> None: + def close_trade(self, trade, precision=None) -> Order: """ Function to close a trade. This function will close a trade by creating a market order to sell the position. If the precision @@ -1183,7 +1183,7 @@ def close_trade(self, trade, precision=None) -> None: symbol=trade.symbol, market=portfolio.market ) - self.order_service.create( + return self.order_service.create( { "portfolio_id": portfolio.id, "trading_symbol": trade.trading_symbol, diff --git a/investing_algorithm_framework/app/strategy.py b/investing_algorithm_framework/app/strategy.py index ce13e129..1e20e8b4 100644 --- a/investing_algorithm_framework/app/strategy.py +++ b/investing_algorithm_framework/app/strategy.py @@ -5,7 +5,7 @@ from investing_algorithm_framework.domain import OperationalException, Position from investing_algorithm_framework.domain import \ TimeUnit, StrategyProfile, Trade, ENVIRONMENT, Environment, \ - BACKTESTING_INDEX_DATETIME + BACKTESTING_INDEX_DATETIME, Order, Position from .context import Context @@ -310,7 +310,7 @@ def create_limit_order( execute=True, validate=True, sync=True - ): + ) -> Order: """ Function to create a limit order. This function will create a limit order and execute it if the execute parameter is set to True. @@ -342,7 +342,7 @@ def create_limit_order( Returns: Order: Instance of the order created """ - self.context.create_limit_order( + return self.context.create_limit_order( target_symbol=target_symbol, price=price, order_side=order_side, @@ -358,47 +358,9 @@ def create_limit_order( sync=sync ) - def create_market_order( - self, - target_symbol, - order_side, - amount, - market=None, - execute=False, - validate=False, - sync=True - ): - """ - Function to create a market order. This function will create a market - order and execute it if the execute parameter is set to True. If the - validate parameter is set to True, the order will be validated - - Args: - target_symbol: The symbol of the asset to trade - order_side: The side of the order - amount: The amount of the asset to trade - market: The market to trade the asset - execute: If set to True, the order will be executed - validate: If set to True, the order will be validated - sync: If set to True, the created order will be synced with the - portfolio of the context - - Returns: - Order: Instance of the order created - """ - self.context.create_market_order( - target_symbol=target_symbol, - order_side=order_side, - amount=amount, - market=market, - execute=execute, - validate=validate, - sync=sync - ) - def close_position( self, symbol, market=None, identifier=None, precision=None - ): + ) -> Order: """ Function to close a position. This function will close a position by creating a market order to sell the position. If the precision @@ -414,7 +376,7 @@ def close_position( Returns: None """ - self.context.close_position( + return self.context.close_position( symbol=symbol, market=market, identifier=identifier, @@ -509,7 +471,7 @@ def get_open_trades(self, target_symbol=None, market=None) -> List[Trade]: """ return self.context.get_open_trades(target_symbol, market) - def close_trade(self, trade, market=None, precision=None) -> None: + def close_trade(self, trade, market=None, precision=None) -> Order: """ Function to close a trade. This function will close a trade by creating a market order to sell the position. If the precision @@ -524,11 +486,11 @@ def close_trade(self, trade, market=None, precision=None) -> None: Returns: None """ - self.context.close_trade( + return self.context.close_trade( trade=trade, market=market, precision=precision ) - def get_number_of_positions(self): + def get_number_of_positions(self) -> int: """ Returns the number of positions that have a positive amount. @@ -571,7 +533,7 @@ def has_position( amount_gte=None, amount_lt=None, amount_lte=None - ): + ) -> bool: """ Function to check if a position exists. This function will return True if a position exists, False otherwise. This function will check @@ -601,7 +563,7 @@ def has_position( amount_lte=amount_lte ) - def has_balance(self, symbol, amount, market=None): + def has_balance(self, symbol, amount, market=None) -> bool: """ Function to check if the portfolio has enough balance to create an order. This function will return True if the diff --git a/tests/app/algorithm/test_trade_price_update.py b/tests/app/algorithm/test_trade_price_update.py index b7e0dfe8..c091749d 100644 --- a/tests/app/algorithm/test_trade_price_update.py +++ b/tests/app/algorithm/test_trade_price_update.py @@ -16,16 +16,6 @@ class StrategyOne(TradingStrategy): def apply_strategy(self, context, market_data): pass - -class StrategyTwo(TradingStrategy): - time_unit = TimeUnit.SECOND - interval = 2 - market_data_sources = ["BTC/EUR-ohlcv", "BTC/EUR-ticker"] - - def apply_strategy(self, context, market_data): - pass - - class Test(TestCase): def setUp(self) -> None: @@ -103,7 +93,7 @@ def test_trade_recent_price_update(self): ) algorithm = Algorithm() algorithm.add_strategy(StrategyOne) - algorithm.add_strategy(StrategyTwo) + # algorithm.add_strategy(StrategyTwo) app.add_algorithm(algorithm) app.set_config( "DATE_TIME", datetime(2023, 11, 2, 7, 59, tzinfo=timezone.utc) @@ -120,7 +110,6 @@ def test_trade_recent_price_update(self): strategy_orchestration_service = app.algorithm\ .strategy_orchestrator_service self.assertTrue(strategy_orchestration_service.has_run("StrategyOne")) - self.assertTrue(strategy_orchestration_service.has_run("StrategyTwo")) # Check that the last reported price is updated trade = app.context.get_trades()[0] From 835f04d3d4b1972804736d6ba6a7903201e6bbba Mon Sep 17 00:00:00 2001 From: marcvanduyn Date: Wed, 19 Feb 2025 21:31:14 +0100 Subject: [PATCH 3/3] Fix flake8 warnings --- investing_algorithm_framework/app/strategy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/investing_algorithm_framework/app/strategy.py b/investing_algorithm_framework/app/strategy.py index 1e20e8b4..75f05692 100644 --- a/investing_algorithm_framework/app/strategy.py +++ b/investing_algorithm_framework/app/strategy.py @@ -2,10 +2,9 @@ import pandas as pd from datetime import datetime, timezone -from investing_algorithm_framework.domain import OperationalException, Position -from investing_algorithm_framework.domain import \ - TimeUnit, StrategyProfile, Trade, ENVIRONMENT, Environment, \ - BACKTESTING_INDEX_DATETIME, Order, Position +from investing_algorithm_framework.domain import TimeUnit, StrategyProfile, \ + Trade, ENVIRONMENT, Environment, BACKTESTING_INDEX_DATETIME, Order, \ + OperationalException, Position from .context import Context