From 7ba58aa3ab19cd67571c374704d540d31666031a Mon Sep 17 00:00:00 2001 From: Robert Grzesik Date: Thu, 12 Dec 2024 12:16:13 -0500 Subject: [PATCH 1/5] added psycopg2-binary as dependency --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index abfb5bf5..3053738d 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="lumibot", - version="3.8.19", + version="3.8.20", author="Robert Grzesik", author_email="rob@lumiwealth.com", description="Backtesting and Trading Library, Made by Lumiwealth", @@ -42,7 +42,8 @@ "tabulate", "thetadata", "psutil", - "pyarrow" + "pyarrow", + "psycopg2-binary", ], classifiers=[ "Programming Language :: Python :: 3", From 162f3731cb94418335e30340a84df654c82def63 Mon Sep 17 00:00:00 2001 From: William Whispell Date: Sat, 14 Dec 2024 14:09:22 -0500 Subject: [PATCH 2/5] Fix: Check timeInForce exists on Kraken API response. --- lumibot/brokers/ccxt.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lumibot/brokers/ccxt.py b/lumibot/brokers/ccxt.py index 0e45f839..60f462e7 100644 --- a/lumibot/brokers/ccxt.py +++ b/lumibot/brokers/ccxt.py @@ -299,7 +299,7 @@ def _parse_broker_order(self, response, strategy_name, strategy_object=None): response["side"], limit_price=response["price"], stop_price=response["stopPrice"], - time_in_force=response["timeInForce"].lower(), + time_in_force=response["timeInForce"].lower() if response["timeInForce"] else None, quote=Asset( symbol=pair[1], asset_type="crypto", @@ -324,7 +324,10 @@ def _pull_broker_order(self, identifier): def _pull_broker_closed_orders(self): params = {} - if self.is_margin_enabled(): + if self.api.id == "kraken": # Check if the exchange is Kraken + logging.info("Detected Kraken exchange. Not sending params for closed orders.") + params = None # Ensure no parameters are sent + elif self.is_margin_enabled(): params["tradeType"] = "MARGIN_TRADE" closed_orders = self.api.fetch_closed_orders(params) From 1b653c4d8cd805da4af89f855c80690ed98a0ef9 Mon Sep 17 00:00:00 2001 From: Martin Pelteshki <39273158+Al4ise@users.noreply.github.com> Date: Mon, 16 Dec 2024 11:18:35 +0200 Subject: [PATCH 3/5] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 3f3e7e12..09574eca 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="lumibot", - version="3.8.16", + version="3.8.21", author="Robert Grzesik", author_email="rob@lumiwealth.com", description="Backtesting and Trading Library, Made by Lumiwealth", From 8d30de2f41c9fb7aa10ae068fd1c18ec910be450 Mon Sep 17 00:00:00 2001 From: davidlatte Date: Mon, 16 Dec 2024 09:24:08 -0800 Subject: [PATCH 4/5] order: adding "cash_settled" as a valid fill type. --- lumibot/entities/order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lumibot/entities/order.py b/lumibot/entities/order.py index 0cea98ba..9be093a8 100644 --- a/lumibot/entities/order.py +++ b/lumibot/entities/order.py @@ -799,7 +799,7 @@ def is_filled(self): """ if self.position_filled: return True - elif self.status.lower() in ["filled", "fill"]: + elif self.status.lower() in ["filled", "fill", "cash_settled"]: return True else: return False From 7224331422e18afe9da546b487fbabc3098493d7 Mon Sep 17 00:00:00 2001 From: Robert Grzesik Date: Mon, 16 Dec 2024 23:04:03 -0500 Subject: [PATCH 5/5] json.dumps fix --- lumibot/strategies/_strategy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lumibot/strategies/_strategy.py b/lumibot/strategies/_strategy.py index 7d804b18..b6f0cab4 100644 --- a/lumibot/strategies/_strategy.py +++ b/lumibot/strategies/_strategy.py @@ -1434,7 +1434,7 @@ def replace_nan(value): try: # Send the data to the cloud - json_data = json.dumps(data) + json_data = json.dumps(data, default=str) response = requests.post(LUMIWEALTH_URL, headers=headers, data=json_data) except Exception as e: self.logger.error(f"Failed to send update to the cloud because of lumibot error. Error: {e}")