Do native symbology lookup in order methods, send user oid in cancel requests

basic_buy_bot
Tyler Goodlet 2023-06-17 16:06:17 -04:00
parent 8a06e4d073
commit 09007cbf08
1 changed files with 7 additions and 4 deletions

View File

@ -637,8 +637,10 @@ class Client:
Submit a live limit order to ze binance. Submit a live limit order to ze binance.
''' '''
# lookup the binance-native symbol from search table
bs_mktid: str = self._pairs[symbol.upper()].symbol
params: dict = OrderedDict([ params: dict = OrderedDict([
('symbol', symbol.upper()), ('symbol', bs_mktid),
('side', side.upper()), ('side', side.upper()),
('type', 'LIMIT'), ('type', 'LIMIT'),
('timeInForce', tif), ('timeInForce', tif),
@ -677,10 +679,11 @@ class Client:
recv_window: int = 60000 recv_window: int = 60000
) -> None: ) -> None:
symbol = symbol.upper() bs_mktid: str = self._pairs[symbol.upper()].symbol
params = OrderedDict([ params = OrderedDict([
('symbol', symbol), ('symbol', bs_mktid),
('orderId', oid), # ('orderId', oid),
('origClientOrderId', oid),
('recvWindow', recv_window), ('recvWindow', recv_window),
('timestamp', binance_timestamp(now())) ('timestamp', binance_timestamp(now()))
]) ])