From a33af6604ccd2c3d52ef2b8f307239ecf0278e5e Mon Sep 17 00:00:00 2001 From: Azulinho Date: Sun, 8 Oct 2023 19:28:08 +0100 Subject: [PATCH 1/2] in prove-backtesting keep the config from BUY The bot overwrites the config it used to buy the coin with a more recent one This causes the bot to for example: if we're using a backtrack of 300 days, and forwarding every 30 days, the bot would buy a coin at -40, to sell at +40 but a new monthly config will come in and overwrite it so that it would now buy at -25 and sell at +5. Essentially this meant that the bot bought at -40 and now would sell at +5. This would kill the profit as the previous config would still be valid and would provide a higher profit --- utils/prove-backtesting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/prove-backtesting.py b/utils/prove-backtesting.py index 8478aa3..47c1dfa 100644 --- a/utils/prove-backtesting.py +++ b/utils/prove-backtesting.py @@ -331,7 +331,7 @@ def write_optimized_strategy_config( log_msg(f" wallet: {old_wallet}") - z: Dict[str, Any] = x | _tickers + z: Dict[str, Any] = _tickers | x _tickers = z log_msg(f" tickers: {_tickers}") From 841c90e4767cda6bbeeb07206d4074c3eff3c66c Mon Sep 17 00:00:00 2001 From: Azulinho Date: Sun, 29 Oct 2023 21:07:59 +0000 Subject: [PATCH 2/2] don't retry get price.log on 404 --- lib/bot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bot.py b/lib/bot.py index d76eaca..59db50b 100644 --- a/lib/bot.py +++ b/lib/bot.py @@ -2312,6 +2312,8 @@ def get_price_log( try: response: requests.Response = session.get(query, timeout=30) status: int = response.status_code + if status == 404: + return (False, []) if status != 200: response.raise_for_status() else: