Unblock Order
First, let's begin by understanding the concepts of block and unblock. Block and Unblock are two different ways used to describe events, operations, or communication methods. Here are their basic concepts and distinction:
Block(阻塞):
Block operations refer to events or operations that occur in a predetermined sequence, and one operation must be completed before another can begin. Block is typically used in queue processing, where one task must wait for another to finish before it can proceed。
Unblock(非阻塞):
Unblock operations refer to events or operations that do not have to occur in a fixed sequence and can be executed in parallel. One operation does not need to wait for the completion of another. Unblock processing is typically used in multi-tasking environments where unblock operations are needed to improve efficiency and performance.
Using Block
After placing the order, the Order Response received will contain the complete data, including fields such as the order number.
- Python
- Node.js
- C#
#Create Order Object
order = FutOptOrder(
buy_sell = BSAction.Buy,
symbol = "TXFD4",
price = "20000",
lot = 1,
market_type = FutOptMarketType.Future,
price_type = FutOptPriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = FutOptOrderType.Auto,
user_def = "From_Py" # optional field
)
sdk.stock.place_order(accounts.data[0], order) #Place Order
#Or Using
#sdk.stock.place_order(accounts.data[0], order, False)
//Create Order Object
const order = {
buySell: BSAction.Buy,
symbol: "TXFD4",
price: "20100",
lot: 1,
marketType: FutOptMarketType.Future,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutureOrderType.Auto,
userDef: "from Js"
};
sdk.futopt.placeOrder(accounts.data[0], order);
// Or Using
//sdk.stock.placeOrder(accounts.data[0], order, false);
//Create Order Object
var order = new FutOptOrder(
BsAction.Buy,
"TXFD4",
null,
null,
"20000",
1,
FutOptMarketType.Future,
FutOptPriceType.Limit,
TimeInForce.Rod,
FutureOrderType.Auto,
null
);
sdk.Stock.PlaceOrder(accounts.data[0] ,order); // Block mode
//Or Using
//sdk.Stock.PlaceOrder(accounts.data[0] ,order, false);
Using Unblock
After placing the order, the Order Response received will not contain the complete data, such as the order number.
- Python
- Node.js
- C#
#Create Order Object
order = FutOptOrder(
buy_sell = BSAction.Buy,
symbol = "TXFD4",
price = "20000",
lot = 1,
market_type = FutOptMarketType.Future,
price_type = FutOptPriceType.Limit,
time_in_force = TimeInForce.ROD,
order_type = FutOptOrderType.Auto,
user_def = "From_Py" # optional field
)
sdk.futopt.place_order(accounts.data[0], order, True) #Place Order
//Create Order Object
const order = {
buySell: BSAction.Buy,
symbol: "TXFD4",
price: "20100",
lot: 1,
marketType: FutOptMarketType.Future,
priceType: FutOptPriceType.Limit,
timeInForce: TimeInForce.ROD,
orderType: FutureOrderType.Auto,
userDef: "from Js"
};
sdk.futopt.placeOrder(accounts.data[0], order, true);
//Create Order Object
var order = new FutOptOrder(
BsAction.Buy,
"TXFD4",
null,
null,
"20000",
1,
FutOptMarketType.Future,
FutOptPriceType.Limit,
TimeInForce.Rod,
FutureOrderType.Auto,
null
);
sdk.FutOpt.PlaceOrder(accounts.data[0] ,order, true); // Place Order with unblock mode
The following are functions that support Unblock orders:
- PlaceOrder - Plcae Order
- ModifyPrice - Modify Order Price
- ModifyQuantity - Modify Order Quantity
- CancelOrder - Cancel Order