Skip to main content

Get Historical Order

orderHistory

Request Parameter

ParameterTypeMeaning
accountAccountAccount
startDatestringQuery Start Date
endDatestringQuery End Date
marketTypeFutOptMarketType (Optional : If not specified, it includes all)Trading session type : Future, Option, FutureNight After-Hour Future, OptionNight After-Hour Option
info

Support historical data for the past two days

Result Response

ParameterTypeMeaning
isSuccessboolInterface result
dataObjectFutOptOrderResult list is returned
messagestring ? (optional)isSuccess = False error description is returned

FutOptOrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypeint (optional)Function Type : 0 New, 10 Execute New, 15 Amend Price, 20 Amend Lot, 30 Cancel, 90Failed
datestringTransaction date
seqNostringOrder serial number
branchNostringBranch number
accountstringAccount
orderNostringOrder number
assetTypenumberAsset type : 1 Future, 2 Option
marketstringMarket type : TAIMEX Future, Option
marketTypejs:string / ts:FutOptMarketTypeTrading session type : Future, Option, FutureNight After-Hour Future, OptionNight After-Hour Option
unitnumberTrading Unit
currencystringTrading Currency
symbolstringSymbol
expiryDatestringExpiry Date
strikePricenumberStrike Price
callPutjs:string / ts:CallPutCall / Put Type : Call Call, Put Put
buySelljs:string / ts:BSActionBuy/Sell Type : Buy, Sell
symbolLeg2stringSymbol - Spread Order
expiryDateLeg2stringExpiry Date - Spread Order
strikePriceLeg2numberStrike Price - Spread Order
callPutLeg2js:string / ts:CallPutCall / Put Type : Call Call, Put Put
buySellLeg2js:string / ts:BSActionBuy/Sell Type : Buy, Sell
priceTypejs:string / ts:FutOptPriceTypeOriginal order price type : Limit, Market, RangeMarket Market with Protection Orders, Reference
pricenumberOrder Price
lotnumberOriginal order lot
timeInForcejs:string / ts:TimeInForceTime In Force ROD, FOK, IOC
orderTypejs:string / ts:FutOptOrderTypeOrder Type : New, Close, Auto, FdayTrade
isPreOrderboolReservation Flag
statusnumberOrder Status : 0 Reservation, 4 In queue, 8 Processing by system backend, 9 TimeOut, 10 Active Order, 30 Cancel Order, 50 Fully Filled, 90 Order Failed
afterPriceTypejs:string / ts:FutOptPriceTypeValid order price type : Limit, Market, RangeMarket Market with Protection Orders, Reference
afterPricenumberValid order price
afterLotnumberValid Order Lot
filledLotnumberFilled Lot
filledMoneynumberFilled Value
beforeLotnumberBefore the Lot Modification
beforePricenumberBefore the Price Modification
userDefstringCustom Fields
lastTimestringLast Modification Time
detailslistOrder Process
>> functionTypenumberFunction Type : 10 Execute New, 15 Amend Price, 20 Amend Quantity, 30 Cancel, 50 Fully Filled, 90Failed
>> modifiedTimestringOrder Modified Time
>> beforeQtynumberOriginal Order Quantity
>> afterQtynumberValid Order Quantity (filled quantity included)
>> beforePricenumberOriginal Order Price
>> afterPricenumberValid Order Price
>> filledMoneynumberFilled Value
>> errorMessagestringError Message
errorMessagestringError Message

Request Example

const orderHistory = sdk.stock.orderHistory(account,"20230921","20231020");
console.log(orderHistory);

Response Example

{
isSuccess: true,
data:[
{
date: "2024/04/11", // Transaction Date (string)
seqNo: "00230177314", // Order Serial Number (string)
branchNo: "15000", // Branch Number (string)
account: "9974825", // Account (string)
orderNo: "C0020", // Order Number (string)
assetType: 2, // Asset Type (number): `1` Future, `2` Option
market: "TAIMEX", // Market Type (string)
marketType: "Option", // Trading Session Type (FutOptMarketType): `Future`, `Option`, `FutureNight` After-Hour Future, `OptionNight` After-Hour Option
symbol: "TXO", // Symbol (string)
expiryDate: "202404", // Expiry Date (string)
strikePrice: 18600, // Strike Price (number)
callPut: "Call", // Call / Put (CallPut): `Call`, `Put`
buySell: "Buy", // Buy/Sell Type (BSAction): `Buy`, `Sell`
priceType: "Limit", // Original Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
price: 2100, // Order Price (number)
lot: 1, // Original order lot (number)
timeInForce: "ROD", // Time In Force (TimeInForce): `ROD`, `FOK`, `IOC`
orderType: "New", // Order Type (FutOptOrderType): `New`, `Close`, `Auto`, `FdayTrade` DayTrade
isPreOrder: false, // Reservation Order Flag (bool)
status: 50, // Order Status (number): `0` Reservation, `4` InQueue, `9` TimeOut, `10` New Order, `30` Cancel Order, `50` Fully Filled, `90` Order Failed
afterPrice: 2100, // Valid Order Price (number)
afterLot: 1, // Valid Order Lot (number)
filledLot: 1, // Filled Lot (number)
filledMoney: 2100, // Filled Value (number)
lastTime: "10:41:46.760", // Last Modification Time (string)
details:[
functionType: 10, // functionType (number)
modifiedTime: "10:20:27", // Order Modified Time (string)
beforeLot: 0, // Original Order Lot (number)
afterLot: 1, // Valid Order Lot (number)
beforePrice: 2100, // Original Order Price (number)
afterPrice: 2100, // Valid Order Price (number)
]
....
},

{
date: "2024/04/11", // Transaction Date (string)
seqNo: "00230177315", // Order Serial Number (string)
branchNo: "15000", // Branch Number (string)
account: "9974825", // Account (string)
orderNo: "C0021", // Order Number (string)
assetType: 2, // Asset Type (number): `1` Future, `2` Option
market: "TAIMEX", // Market Type (string)
marketType: "Option", // Trading Session Type (FutOptMarketType): `Future`, `Option`, `FutureNight` After-Hour Future, `OptionNight` After-Hour Option
symbol: "TXO", // Symbol (string)
expiryDate: "202404", // Expiry Date (string)
strikePrice: 18500, // Strike Price (number)
callPut: "Call", // Call / Put (CallPut): `Call`, `Put`
buySell: "Sell", // Buy/Sell Type (BSAction): `Buy`, `Sell`
priceType: "Limit", // Original Order Price Type (FutOptPriceType): `Limit`, `Market`, `RangeMarket` Market with Protection Orders, `Reference`
price: 2230, // Order Price (number)
lot: 1, // Original order lot (number)
timeInForce: "ROD", // Time In Force (TimeInForce): `ROD`, `FOK`, `IOC`
orderType: "New", // Order Type (FutOptOrderType): `New`, `Close`, `Auto`, `FdayTrade` DayTrade
isPreOrder: false, // Reservation Order Flag (bool)
status: 50, // Order Status (number): `0` Reservation, `4` InQueue, `9` TimeOut, `10` New Order, `30` Cancel Order, `50` Fully Filled, `90` Order Failed
afterPrice: 2230, // Valid Order Price (number)
afterLot: 1, // Valid Order Lot (number)
filledLot: 1, // Filled Lot (number)
filledMoney: 2230, // Filled Value (number)
lastTime: "10:41:46.760", // Last Modification Time (string)
}
]
}