Skip to main content

Get Historical Order

OrderHistory

Request Parameter

ParameterTypeMeaning
accountAccountAccount
startDatestringQuery start date
endDatestring ( null or empty will equals startDate )Query end date
info

Since v2.1.1, this supports longer term historical data inquiry. The day range is limited maximum 30 days per request. For older SDK versions (until v2.1.0), it supports historical data for the past two days.

Result Reponse

ParameterTypeMeaning
isSuccessboolInterface result
dataListOrderResult list is returned
messagestringisSuccess = False error description is returned

OrderResult Parameter

Return type : Object

ParameterTypeMeaning
functionTypeint (optional)Function 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
assetTypeintAsset Type : 0 Stock
marketstringMarket Type : TAIEX Listed 、 TAISDAQ OTC 、 TAIEMG Emg
marketTypeMarketTypeTrading Session Type : CommonFixingIntradayOddOddEmgEmgOdd
stockNostringSymbol
buySellBsActionBuy/Sell Type : BuySell
priceTypePriceTypeOriginal OPrder Price Type : LimitLimitUpLimitDownMarketReference
pricedoubleOrder Price
quantityintOriginal Order Quantity
timeInForceTimeInForceTime In Force : RodFokIoc
orderTypeOrderTypeOrder Type : StockMarginShort Short sale 、 DayTradeSBL
isPreOrderboolReservation Order Flag
statusintOrder 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
afterPriceTypePriceTypeValid Order Price Type : LimitLimitUpLimitDownMarketReference
afterPricedoubleValid Order Price
unitintTrading Unit
afterQtyintValid Order Quantity (filled quantity included)
filledQtyintFilled Quantity
filledMoneyintFilled Value
beforeQtyintBefore the Quantity Modification
beforePricedoubleBefore the Price Modification
userDefstringCustom Fields
lastTimestringLast Modification Time
errorMessagestringError Message
detailslistOrder Process
>> functionTypeintFunction Type : 0 New Order 、 10 New Order Executed 、 15 Change Price 、 20 Change Quantity 、 30 Cancel 、 50 Fully Filled 、 90 Failed
>> modifiedTimestringOrder Modified Time
>> beforeQtyintOriginal Order Quantity
>> afterQtyintValid Order Quantity (filled quantity included)
>> beforePricedoubleOriginal Order Price
>> afterPricedoubleValid Order Price
>> filledMoneydoubleFilled Value
>> statusintOrder Status
>> errMsgstringError Message

Request Example

Console.WriteLine(sdk.Rrade.OrderHistory(account,"20230921","20230922"));

Response Example

{
isSuccess = True,
message = ,
data =[
OrderResult{
functionType = , // Function Type (int)
date = 2023/10/12, // Trading Date (string)
seqNo = 00000000001, // Order Serial Number (string)
branchNo = 6460, // Branch Number (string)
account = 26, // Account (string)
orderNo = bA598, // Order Number (string)
assetType = 0, // Asset Type (int)
market = TAIEX, // Market Category (string)
marketType = Common, // Trading Session Type (MarketType)
stockNo = 2888, // Symbol (string)
buySell = Buy, // Transaction Direction (BsAction)
priceType = Limit, // Order Price Type (PriceType)
price = 8.9, // Order Price (double)
quantity = 2000, // Order Quantity (int)
timeInForce = Rod, // Time in Force (TimeInForce)
orderType = Stock, // Order Type (int)
isPreOrder = False, // Reservation Flag (bool)
status = 10, // Order Status (int)
afterPriceType = , // Valid Order Price Type (PriceType)
afterPrice = 9, // Valid Order Price (double)
unit = 1000, // Share Unit (int)
afterQty = 1000, // Valid Order Quantity (int)
filledQty = 0, // Filled Quantity (int)
filledMoney = 0, // Filled Value (int)
beforeQty = , // Before the Quantity Modification (int)
beforePrice = , // Before the Price Modification (double)
userDef = , // Custom Fields (string)
lastTime = 14:19:41.879, // Last Modification Time (string)
details = [ // Order Detail (list)
OrderDetail{
functionType = 10, // Function Type (int)
modifiedTime = 14:19:41.879, // Order Modified Time (string)
beforeQty = 0, // Original Order Quantity (int)
afterQty = 1000, // Valid Order Quantity (int)
beforePrice = 9.0, // Original Order Price (double)
afterPrice = 9.0, // Valid Order Price (double)
status = 10, // Order Status (int)
errMsg= // Error Message (string)
}
]
errorMessage = // Error Message (string)
},
...
]
}