public class WebSocketApiTrade extends Object implements WebSocketApiModule
Constructor and Description |
---|
WebSocketApiTrade(com.binance.connector.client.utils.websocketapi.WebSocketApiRequestHandler handler) |
Modifier and Type | Method and Description |
---|---|
void |
cancelAllOpenOrders(String symbol,
org.json.JSONObject parameters)
Cancel all open orders on a symbol, including OCO orders.
|
void |
cancelOcoOrder(String symbol,
org.json.JSONObject parameters)
Cancel an active OCO.
If both orderListId and listClientOrderId parameters are specified, only orderListId is used and listClientOrderId is ignored. Canceling an individual leg with order.cancel will cancel the entire OCO as well. |
void |
cancelOrder(String symbol,
org.json.JSONObject parameters)
Cancel an active order.
If both orderId and origClientOrderId parameters are specified, only orderId is used and origClientOrderId is ignored. |
void |
cancelReplaceOrder(String symbol,
String cancelReplaceMode,
String side,
String type,
org.json.JSONObject parameters)
Cancel an existing order and immediately place a new order instead of the canceled one.
Similar to the order.place request, additional mandatory parameters (*) are determined by the new order type. If both cancelOrderId and cancelOrigClientOrderId parameters are specified, only cancelOrderId is used and cancelOrigClientOrderId is ignored. |
void |
getOcoOrder(org.json.JSONObject parameters)
Check execution status of an OCO.
|
void |
getOpenOcoOrders(org.json.JSONObject parameters)
Query execution status of all open OCOs.
If both orderListId and listClientOrderId parameters are specified, only orderListId is used and listClientOrderId is ignored. Canceling an individual leg with order.cancel will cancel the entire OCO as well. |
void |
getOpenOrders(org.json.JSONObject parameters)
Query execution status of all open orders.
|
void |
getOrder(String symbol,
org.json.JSONObject parameters)
Check execution status of an order.
If both orderId and origClientOrderId parameters are specified, only orderId is used and origClientOrderId is ignored. |
void |
newOcoOrder(String symbol,
String side,
double price,
double quantity,
org.json.JSONObject parameters)
Send in a new one-cancels-the-other (OCO) pair: LIMIT_MAKER + STOP_LOSS/STOP_LOSS_LIMIT orders (called legs), where activation of one order immediately cancels the other.
|
void |
newOrder(String symbol,
String side,
String type,
org.json.JSONObject parameters)
Send in a new order.
Additional mandatory parameters (*) are determined by the new order type. |
void |
newSorOrder(String symbol,
String side,
String type,
double quantity,
org.json.JSONObject parameters)
Places an order using smart order routing (SOR).
|
void |
testNewOrder(String symbol,
String side,
String type,
org.json.JSONObject parameters)
Test order placement.
Validates new order parameters and verifies your signature but does not send the order into the matching engine. Additional mandatory parameters (*) are determined by the new order type. |
void |
testNewSorOrder(String symbol,
String side,
String type,
double quantity,
org.json.JSONObject parameters)
Test new order creation and signature/recvWindow using smart order routing (SOR).
|
public WebSocketApiTrade(com.binance.connector.client.utils.websocketapi.WebSocketApiRequestHandler handler)
public void newOrder(String symbol, String side, String type, org.json.JSONObject parameters)
symbol
- Stringside
- String -- BUY or SELLtype
- Stringparameters
- JSONObject composed by key-value pairs:
public void testNewOrder(String symbol, String side, String type, org.json.JSONObject parameters)
symbol
- Stringside
- String -- BUY or SELLtype
- Stringparameters
- JSONObject composed by key-value pairs:
public void getOrder(String symbol, org.json.JSONObject parameters)
symbol
- Stringparameters
- JSONObject composed by key-value pairs:
public void cancelOrder(String symbol, org.json.JSONObject parameters)
symbol
- Stringparameters
- JSONObject composed by key-value pairs:
public void cancelReplaceOrder(String symbol, String cancelReplaceMode, String side, String type, org.json.JSONObject parameters)
symbol
- StringcancelReplaceMode
- String -- STOP_ON_FAILURE or ALLOW_FAILUREside
- String -- BUY or SELLtype
- Stringparameters
- JSONObject composed by key-value pairs:
public void getOpenOrders(org.json.JSONObject parameters)
parameters
- JSONObject composed by key-value pairs:
public void cancelAllOpenOrders(String symbol, org.json.JSONObject parameters)
symbol
- Stringparameters
- JSONObject composed by key-value pairs:
public void newOcoOrder(String symbol, String side, double price, double quantity, org.json.JSONObject parameters)
symbol
- Stringside
- String -- BUY or SELLprice
- double -- Price for the limit orderquantity
- doubleparameters
- JSONObject composed by key-value pairs:
public void getOcoOrder(org.json.JSONObject parameters)
parameters
- JSONObject composed by key-value pairs:
public void cancelOcoOrder(String symbol, org.json.JSONObject parameters)
symbol
- Stringparameters
- JSONObject composed by key-value pairs:
public void getOpenOcoOrders(org.json.JSONObject parameters)
parameters
- JSONObject composed by key-value pairs:
public void newSorOrder(String symbol, String side, String type, double quantity, org.json.JSONObject parameters)
symbol
- Stringside
- String -- BUY or SELLtype
- Stringquantity
- doubleparameters
- JSONObject composed by key-value pairs:
public void testNewSorOrder(String symbol, String side, String type, double quantity, org.json.JSONObject parameters)
symbol
- Stringside
- String -- BUY or SELLtype
- Stringquantity
- doubleparameters
- JSONObject composed by key-value pairs:
Copyright © 2023. All rights reserved.