買い/売りの注文詳細確認は以下のように行います。
'注文詳細確認
Protected Overrides Function ConfirmDetailContruct(ByVal buysell As AbstructWebOrder.OrderType, ByVal dt As IDayTrade, Optional ByVal timing As Date = #12:00:00 AM#) As Boolean
Dim order As TradeOrder
If buysell = AbstructWebOrder.OrderType.買付 Then
order = dt.BuyOrder
Else
order = dt.SellOrder
End If
log.InfoFormat("{0}を詳細確認します。code={1} unit={2} price={3} order_no={4}", buysell.ToString(), dt.company_id, dt.unit, order.price, order.order_no)
Try
Dim goPageNo As Integer = 1
Dim goIndex As Integer = 0
If timing = _cacheTime Then
Dim key As String = OrderCache.CreateKey(buysell, dt, order)
If _orderCacheMap.ContainsKey(key) Then
Dim cache As OrderCache = _orderCacheMap.Item(key)
goPageNo = cache.PageNo
goIndex = cache.Index
End If
Else
If timing > DateTime.MinValue Then
timing = _cacheTime
_orderCacheMap.Clear()
End If
End If
_web.GoTop().GoOrderList().DetailList(buysell, dt, _orderCacheMap, goPageNo, goIndex).ConfirmDetail()
log.InfoFormat("{0}を詳細確認結果。code={1} unit={2} price={3} order_no={4}", buysell, dt.company_id, dt.unit, order.avr_price, order.order_no)
Return True
Catch ex As Exception
log.Warn("例外が発生しました。", ex)
End Try
log.WarnFormat("{0}の詳細確認に失敗しました。code={1} unit={2} price={3} order_no={4}", buysell.ToString(), dt.company_id, dt.unit, order.price, order.order_no)
Return False
End Function
スポンサーリンク