Skip to main content

Modify Order Price

modifyPrice

First, use makeModifyPriceObj to create a ModifyPriceObj object

ParameterTypeMeaning
orderResultOrderResultThe intended order result object to be modified
pricestring?The price after modification
priceTypepriceType?The price type after modification (Note.: The Co-lo version has enabled the use of PriceType.)
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

Input Parameters

ParameterTypeMeaning
accountAccountAccount
ModifiyPriceObjModifyPriceObjThe object for price modification
unblockbool ? (default = false)Whether to use non-blocking mode

Result

ParameterTypeMeaning
isSuccessboolWhether successful
dataObjectModified content is returned
messagestring ? (optional)Error message returned when isSuccess = false

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypenumberFunction Type : 0 New Order, 10 New Order Executed, 15 Change Price, 20 Change Quantity, 30 Cancel, 90 Failed
datestringTransaction date
seqNostringOrder serial number
branchNostringBranch number
accountstringAccount
orderNostringOrder number
assetTypenumberAsset type : 0 Stock
marketstringMarket type : TAIEX Listed, TAISDAQ OTC, TAIEMG EMG
marketTypejs:string / ts:MarketTypeTrading session type : Common, Fixing, IntradayOdd, Odd, Emg, EmgOdd
stockNostringSymbol
buySelljs:string / ts:BSActionBuy/Sell Type : Buy, Sell
priceTypejs:string / ts:PriceTypeOriginal order price type : Limit, LimitUp, LimitDown, Market, Reference
pricenumberOrder Price
quantitynumberOriginal order quantity
timeInForcejs:string / ts:TimeInForceTime In Force ROD, FOK, IOC
orderTypejs:string / ts:OrderTypeOrder Type : Stock, Margin, Short Short sale, DayTrade, SBL
isPreOrderboolReservation Flag
statusnumberOrder status, for details please refer to STATUS
afterPriceTypejs:string / ts:PriceTypeValid order price type : Limit, LimitUp, LimitDown, Market, Reference
afterPricenumberValid order price
unitnumberTrading Unit
afterQtynumberValid Order Quantity (filled quantity included)
filledQtynumberFilled Quantity
filledMoneynumberFilled Value
beforeQtynumberBefore the Quantity Modification
beforePricenumberBefore the Price Modification
user_defstringCustom Fields
lastTimestringLast Modification Time
detailslistOrder Process (Return value when query orderResultDetail or orderHistory )
errorMessagestringError Message

Request Example

// Single blocking price modification
const modifyPriceObj = sdk.stock.makeModifyPriceObj(target_order, "41.1");
sdk.stock.modifyPrice(accounts.data[0], modifyPriceObj, false)

Response Example

{
isSuccess: true,
data:{
functionType: 15, // Function Type (number)
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000308866', // Order sequence number (string)
branchNo: '6460', // Branch code (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 (string)
stockNo: '1101', // Symbol (string)
buySell: 'Sell', // Buy/sell side (string)
priceType: 'Limit', // Original order price type (string)
price: 41.2, // Price (number)
quantity: 5000, // Original Order Quantity (number)
timeInForce: 'ROD', // Time in force (string)
orderType: 'Stock', // Order type (string)
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number)
afterPriceType: 'Limit', // Valid order price type (string)
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)
}
}