private void OrderService_onResponse(object sender, ResponseEvent e) { OnTradeResponse(e); }
/// <summary> /// 觸發交易回報事件 /// </summary> /// <param name="e">ResponseEvent 類別</param> protected void OnTradeResponse(ResponseEvent e) { if (onTradeResponse != null) { onTradeResponse(this, e); } }
private void LargeOrderService_onResponse(object sender, ResponseEvent e) { switch (e.ResponseType) { case ResponseType.Cancel: lock (__oLock) { if (__cCurrent != null) { EOrderAction cAction = __cCurrent.Action; __cTemp = (__bReverse && (cAction == EOrderAction.Sell || cAction == EOrderAction.BuyToCover)) ? null : __cCurrent; } __cCurrent = null; } break; case ResponseType.Deal: lock (__oLock) { if (__cCurrent != null && __cCurrent.Contracts == 0) { __cTemp = null; __cCurrent = null; } } break; case ResponseType.Trust: lock (__oLock) { if (__cCurrent == null) { __cTemp = null; __cCurrent = e.TradeOrder as TradeOrder; } } break; } }
internal void AddResponse(ResponseEvent response) { lock (__cQueue) { __cQueue.Enqueue(response); } __cTimer.Start(); }
private void SignalObject_onTradeResponse(object sender, ResponseEvent e) { __cTradeService.AddResponse(e); }