Non-blocking Orders
First, let's begin by understanding blocking and non-blocking operations. They are two ways of describing events, operations, or communication. Their basic concepts and differences are as follows:
Blocking
Blocking operations occur in a predetermined sequence: one operation must complete before the next can begin. They are typically used in queue processing, where a task must wait for another to finish before proceeding.

Non-blocking
Non-blocking operations do not have to occur in a fixed sequence and can run in parallel. One operation does not need to wait for another to complete. Non-blocking processing is typically used in multitasking environments to improve efficiency and performance.

Place an order using a blocking operation
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 = "FromPy" # 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: "fromJs"
};
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 = "FromPy" # 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: "fromJs"
};
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