Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into ib-fixes-n+1
Browse files Browse the repository at this point in the history
  • Loading branch information
Al4ise committed Dec 17, 2024
2 parents 9ca9484 + 25d22b3 commit a94fabd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions lumibot/brokers/ccxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion lumibot/entities/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lumibot/strategies/_strategy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit a94fabd

Please sign in to comment.