You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, we use order tagging functionality in LEAN a lot in our strategies (one use-case is restoring trade state from storage/cache after restarting a strategy) and we've noticed this error message appearing consistently when we try to update order tags on Bybit:
Anytime LEAN tries to update the order tag, it sends order modification request to Bybit and we get the error message above, but Bybit does not support order tagging (ie. like IB does), so there is no reason to even try to send the update to Bybit.
We've prepared a sample script to reproduce the error on your end:
# region imports
from AlgorithmImports import *
# endregion
class OrderNotModified(QCAlgorithm):
def initialize(self):
# Brokerage and account settings
self.set_brokerage_model(BrokerageName.BYBIT, AccountType.MARGIN)
self.set_account_currency("USDT")
self.btc = self.add_crypto_future("BTCUSDT", Resolution.MINUTE, Market.BYBIT)
self.lmt_sent = False
self.lmt_ticket = None
def on_data(self, data: Slice):
if "BTCUSDT" not in data.bars:
return
trade_bar = data.bars["BTCUSDT"]
if self.lmt_ticket is not None:
# update tag with some random string
# this throws brokerage error "order not modified"
self.lmt_ticket.update_tag(self.lmt_ticket.tag + " 1")
if not self.lmt_sent:
self.limit_order(self.btc.symbol, 0.1, trade_bar.close*0.9, tag="LMT")
self.lmt_sent = True
def on_order_event(self, order_event):
if order_event.status == OrderStatus.SUBMITTED and order_event.ticket.tag == "LMT":
self.lmt_ticket = order_event.ticket
This behaviour fills up the logs with unnecessary error messages.
The text was updated successfully, but these errors were encountered:
Hi, we use order tagging functionality in LEAN a lot in our strategies (one use-case is restoring trade state from storage/cache after restarting a strategy) and we've noticed this error message appearing consistently when we try to update order tags on Bybit:
![Image](https://private-user-images.githubusercontent.com/46728641/406957429-82eaece1-9872-43d4-8e5e-924dd45fd824.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODY5MTQsIm5iZiI6MTczOTE4NjYxNCwicGF0aCI6Ii80NjcyODY0MS80MDY5NTc0MjktODJlYWVjZTEtOTg3Mi00M2Q0LThlNWUtOTI0ZGQ0NWZkODI0LmpwZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDExMjMzNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE0NmNiZWE0Zjg4YjRjMTllYThlOGIxMGNjYzliNWM1NTk3YWQxYTc2MTlhNjMxMWI0MWIwNzE0NmVjYTgwNzEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.2oZLwKZy5CLYo4maSqI2qgHup7acKjTq6DpmVaUQMns)
Anytime LEAN tries to update the order tag, it sends order modification request to Bybit and we get the error message above, but Bybit does not support order tagging (ie. like IB does), so there is no reason to even try to send the update to Bybit.
We've prepared a sample script to reproduce the error on your end:
This behaviour fills up the logs with unnecessary error messages.
The text was updated successfully, but these errors were encountered: