Skip to main content

Batch Modify Price

batchModifyPrice

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 'batchModifyPrice' function

Input Parameters

ParameterTypeMeaning
accountAccountAccount
ModifyPriceObjModifyPriceObj(list of object)The object for price modification

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

// Batch price modification ( modifying orders using the content returned by batch detail )
modify_orders = [
sdk.stock.makeModifyPriceObj(batch_res.data[0], "41.1"),
sdk.stock.makeModifyPriceObj(batch_res.data[1], "41.1")
]

sdk.stock.batchModifyPrice(account, modify_orders);


// Batch price modification ( Using different individual orders )
modify_orders = [
sdk.stock.makeModifyPriceObj(orderResult.data[20], "41.1"),
sdk.stock.makeModifyPriceObj(orderResult.data[21], "41.1"),
sdk.stock.makeModifyPriceObj(orderResult.data[28], "41.1")
]

sdk.stock.batchModifyPrice(account, modify_orders);

Response Example

{
isSuccess: true,
data: [ // Batch price modification ( modifying orders using the content returned by batch detail )
{
functionType: 15, // Function Type (number)
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000322356', // Order sequence number (string)
branchNo: '6460', // Branch code (string)
account: '26', // Account (string)
orderNo: 'x0018', // 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 (OrderType)
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: '13:56:57.713', // Last Modification Time (string)
},
{
functionType: 15, // Function Type (number)
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000322355', // Order sequence number (string)
branchNo: '6460', // Branch code (string)
account: '26', // Account (string)
orderNo: 'x0017', // 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 (OrderType)
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number)
...
}
]
}

以下擷取data內容

[ // Batch price modification ( Using different individual orders )
{
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000322388', // Order sequence number (string)
branchNo: '6460', // Branch code (string)
account: '26', // Account (string)
orderNo: 'x0033', // 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)
},
{
date: '2023/11/22', // Transaction Date (string)
seqNo: '00000322386', // Order sequence number (string)
branchNo: '6460', // Branch code (string)
account: '26', // Account (string)
orderNo: 'x0031', // 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 (OrderType)
isPreOrder: false, // Reservation Order Flag (bool)
status: 10, // Order Status (number)
...
},
...
]