Modify Order Price
modifyPrice
First, using 'makeModifyPriceObj' create a 'ModifyPriceObj' object
Parameter | Type | Meaning |
---|---|---|
orderResult | OrderResult | The intended order result object to be modified |
price | string? | The price after modification |
priceType | PriceType? | The price type after modification |
caution
When 'price' is filled, priceType should be empty or null ; otherwise, the 'price' field should be empty or null
Put the returned object into the 'modifyPrice' function
Request Parameter
Parameter | Type | Meaning |
---|---|---|
account | Account | Account |
ModifyPriceObj | ModifyPriceObj | The object for price modification |
unblock | bool ? (default = false) | unblock |
Result Response
Parameter | Type | Meaning |
---|---|---|
isSuccess | bool | Interface result |
data | Object | Modified content is returned |
message | string ? (optional) | isSuccess = False error description is returned |
OrderResult Parameter
Return type : Object
Parameter | Type | Meaning |
---|---|---|
functionType | int | Function Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 90 Failed |
date | string | Transaction date |
seqNo | string | Order serial number |
branchNo | string | Branch number |
account | string | Account |
orderNo | string | Order number |
assetType | number | Asset type : 0 Stock |
market | string | Market type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG EMG |
marketType | js:string / ts:MarketType | Trading session type : Common 、 Fixing 、 IntradayOdd 、 Odd 、 Emg 、 EmgOdd |
stockNo | string | Symbol |
buySell | js:string / ts:BSAction | Buy/Sell Type : Buy 、 Sell |
priceType | js:string / ts:PriceType | Original order price type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference |
price | number | Order Price |
quantity | number | Original order quantity |
timeInForce | js:string / ts:TimeInForce | Time In Force ROD 、 FOK 、 IOC |
orderType | js:string / ts:OrderType | Order Type : Stock 、 Margin 、 Short Short sale 、 DayTrade 、 SBL |
isPreOrder | bool | Reservation Flag |
status | number | Order status : 0 Reservation 、 4 Sending to the system backend 、 9 Timeout 、 10 Active order 、 30 Canceled 、 40 Partially filled, others canceled 、 50 Fully filled 、 90 Failed |
afterPriceType | js:string / ts:PriceType | Valid order price type : Limit 、 LimitUp 、 LimitDown 、 Market 、 Reference |
afterPrice | number | Valid order price |
afterQty | number | Valid Order Quantity (filled quantity included) |
filledQty | number | Filled Quantity |
filledMoney | number | Filled Value |
beforeQty | number | Before the Quantity Modification |
beforePrice | number | Before the Price Modification |
userDef | string | Custom Fields |
lastTime | string | Last Modification Time |
details | list | Order Process (Return value when query orderResultDetail or orderHistory ) |
errorMessage | string | Error Message |
Request Example
const modifyPriceObj = sdk.stock.makeModifyPriceObj(target_order, "41.1");
sdk.stock.modifyPrice(accounts.data[0], modifyPriceObj)
Response Example
{
isSuccess: true,
data:{
functionType: 15, // Function Type (number)
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000308866', // Order Serial Number (string)
branchNo: '6460', // Branch Number (string)
account: '26', // Account (string)
orderNo: 'x0011', // Order Number (string)
assetType: 0, // Asset Type (number)
market: 'TAIEX', // Market Type (string)
marketType: 'Common', // Trading Session Type (MarketType)
stockNo: '1101', // Symbol (string)
buySell: 'Sell', // Buy/Sell Type (BSAction)
priceType: 'Limit', // Original Order Price Type (PriceType)
price: 41.2, // Order Price (number)
quantity: 5000, // Original Order Quantity (number)
timeInForce: 'ROD', // Time In Force (TimeInForce)
orderType: 'Stock', // Order Type (OrderType)
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number)
afterPriceType: 'Limit', // Valid Order Price Type (PriceType)
afterPrice: 41.1, // Valid Order Price (number)
unit: 1000, // Trading Unit (number)
afterQty: 2000, // Valid Order Quantity (number)
filledQty: 0, // Filled Quantity (number)
filledMoney: 0, // Filled Value (number)
beforePrice: 41.3, // Before the Price Modification (number)
userDef: '12345678', // Custom Fields (string)
lastTime: '10:56:57.713', // Last Modification Time (string)
}
}