本文整理汇总了C#中SingleOrder类的典型用法代码示例。如果您正苦于以下问题:C# SingleOrder类的具体用法?C# SingleOrder怎么用?C# SingleOrder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SingleOrder类属于命名空间,在下文中一共展示了SingleOrder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: OrderRecord
// Methods
public OrderRecord(SingleOrder order)
{
this.order = order;
this.avgPx = 0.0;
this.leavesQty = (int)order.OrderQty;
this.cumQty = 0;
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:8,代码来源:OrderRecord.cs
示例2: Cancel
private void Cancel(SingleOrder order)
{
if (!_bTdConnected)
{
EmitError(-1, -1, "交易服务器没有连接,无法撤单");
tdlog.Error("交易服务器没有连接,无法撤单");
return;
}
Dictionary<string, CZQThostFtdcOrderField> _Ref2Action;
if (_Orders4Cancel.TryGetValue(order, out _Ref2Action))
{
// 标记下正在撤单
_PendingCancelFlags[order] = order.OrdStatus;
lock (_Ref2Action)
{
CZQThostFtdcOrderField __Order;
foreach (CZQThostFtdcOrderField _Order in _Ref2Action.Values)
{
__Order = _Order;
//这地方要是过滤下就好了
TraderApi.TD_CancelOrder(m_pTdApi, ref __Order);
}
}
}
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:27,代码来源:CTPZQProvider.CTPZQ.Order.cs
示例3: Cancel
private void Cancel(SingleOrder order)
{
if (order == null)
return;
if (!_bTdConnected)
{
EmitError(-1, -1, "交易服务器没有连接,无法撤单");
tdlog.Error("交易服务器没有连接,无法撤单");
return;
}
DFITCOrderRspDataRtnField pOrderRtn;
if (_Orders4Cancel.TryGetValue(order, out pOrderRtn))
{
Instrument inst = InstrumentManager.Instruments[order.Symbol];
string altSymbol = inst.GetSymbol(Name);
int localOrderID = pOrderRtn.localOrderID;
int spdOrderID = pOrderRtn.spdOrderID;
if (spdOrderID >= 0)
{
localOrderID = -1;
}
else
{
spdOrderID = -1;
}
TraderApi.TD_CancelOrder(m_pTdApi, altSymbol, localOrderID, spdOrderID);
}
}
开发者ID:kandsy,项目名称:OpenQuant-XSpeed,代码行数:32,代码来源:XSpeedProvider.XSpeed.Order.cs
示例4: Cancel
private void Cancel(SingleOrder order)
{
if (null == order)
return;
if (!_bTdConnected)
{
EmitError(-1, -1, "交易服务器没有连接,无法撤单");
tdlog.Error("交易服务器没有连接,无法撤单");
return;
}
GenericOrderItem item;
if(orderMap.TryGetValue(order,out item))
{
CThostFtdcOrderField _order;
if (orderMap.TryGetValue(item, out _order))
{
// 标记下正在撤单
orderMap.Order_OrdStatus[order] = order.OrdStatus;
EmitExecutionReport(order, OrdStatus.PendingCancel);
TraderApi.TD_CancelOrder(m_pTdApi, ref _order);
}
}
}
开发者ID:NYEthan1983,项目名称:OpenQuant-CTP,代码行数:26,代码来源:APIProvider.CTP.Order.cs
示例5: Add
public override void Add(SingleOrder order, TextCommon t)
{
if (Index >= GetLegNum())
return;
Leg[Index] = new MultiOrderLeg { Order = order, OpenClose = t.OpenClose };
++Index;
}
开发者ID:huangzhengyong,项目名称:OpenQuant,代码行数:8,代码来源:SPOrderItem.cs
示例6: Add
public override void Add(SingleOrder order, TextCommon t)
{
if (order.Side == Side.Buy)
{
Buy = new MultiOrderLeg() { Order = order, OpenClose = t.OpenClose };
}
else
{
Sell = new MultiOrderLeg() { Order = order, OpenClose = t.OpenClose };
}
}
开发者ID:ForTrade,项目名称:OpenQuant,代码行数:11,代码来源:QuoteOrderItem.cs
示例7: Add
public SPOrderItem Add(SingleOrder order, TextSP t)
{
if (item == null || item.IsDone())
{
item = new SPOrderItem(t);
}
item.Add(order, t);
if (item.IsDone())
{
return item;
}
return null;
}
开发者ID:ForTrade,项目名称:OpenQuant,代码行数:16,代码来源:SPCombiner.cs
示例8: Add
public CommonOrderItem Add(SingleOrder order, TextRequest t)
{
if(item == null || item.IsDone())
{
item = new CommonOrderItem();
}
item.Add(order, t);
if (item.IsDone())
{
return item;
}
return null;
}
开发者ID:huangzhengyong,项目名称:OpenQuant,代码行数:16,代码来源:CommonCombiner.cs
示例9: OnTrade
public bool OnTrade(ref SingleOrder order, ref CThostFtdcTradeField pTrade, ref double Price, ref int Volume)
{
#if CTP
//先保存到两个队例,排序是为了配对
if (TThostFtdcDirectionType.Buy == pTrade.Direction)
{
qBuy.Add(pTrade);
qBuy.Sort(SortCThostFtdcTradeField);
}
else
{
qSell.Add(pTrade);
qSell.Sort(SortCThostFtdcTradeField);
}
//取已经配对好的
if (qBuy.Count > 0 && qSell.Count > 0)
{
// 有网友说可能成交时不成对,这地方是否改动一下
if (qBuy[0].Volume == qSell[0].Volume)//如果不等就有问题了
{
Volume = qBuy[0].Volume;
if (order.Side == Side.Buy)
{
Price = qBuy[0].Price - qSell[0].Price;
}
else
{
Price = qSell[0].Price - qBuy[0].Price;
}
//用完就清除
qBuy.RemoveAt(0);
qSell.RemoveAt(0);
return true;
}
}
#endif
return false;
}
开发者ID:fouvy,项目名称:OpenQuant-CTP,代码行数:40,代码来源:DbInMemTrade.cs
示例10: OnTrade
public bool OnTrade(ref SingleOrder order, ref CZQThostFtdcTradeField pTrade, ref double Price, ref int Volume)
{
//先保存到两个队例,排序是为了配对
//if (TZQThostFtdcDirectionType.Buy == pTrade.Direction)
//{
// qBuy.Add(pTrade);
// qBuy.Sort(SortCZQThostFtdcTradeField);
//}
//else
//{
// qSell.Add(pTrade);
// qSell.Sort(SortCZQThostFtdcTradeField);
//}
////取已经配对好的
//if (qBuy.Count > 0 && qSell.Count > 0)
//{
// if (qBuy[0].Volume == qSell[0].Volume)//如果不等就有问题了
// {
// Volume = qBuy[0].Volume;
// if (order.Side == Side.Buy)
// {
// Price = qBuy[0].Price - qSell[0].Price;
// }
// else
// {
// Price = qSell[0].Price - qBuy[0].Price;
// }
// //用完就清除
// qBuy.RemoveAt(0);
// qSell.RemoveAt(0);
// return true;
// }
//}
return false;
}
开发者ID:gotosprey,项目名称:OpenQuant-CTPZQ,代码行数:36,代码来源:DbInMemTrade.cs
示例11: EmitCancelled
protected void EmitCancelled(SingleOrder order)
{
EmitExecutionReport(order, OrdStatus.Cancelled);
}
开发者ID:fouvy,项目名称:OpenQuant,代码行数:4,代码来源:QBProvider.ExecutionProvider.cs
示例12: EmitAccepted
protected void EmitAccepted(SingleOrder order)
{
EmitExecutionReport(order, OrdStatus.New);
}
开发者ID:fouvy,项目名称:OpenQuant,代码行数:4,代码来源:QBProvider.ExecutionProvider.cs
示例13: Cancel
private void Cancel(SingleOrder order)
{
if (!_bTdConnected)
{
EmitError(-1,-1,"交易服务器没有连接,无法撤单");
return;
}
Dictionary<string, CThostFtdcOrderField> _Ref2Action;
if (_Orders4Cancel.TryGetValue(order, out _Ref2Action))
{
lock (_Ref2Action)
{
CThostFtdcOrderField __Order;
foreach (CThostFtdcOrderField _Order in _Ref2Action.Values)
{
__Order = _Order;
//这地方要是过滤下就好了
TraderApi.TD_CancelOrder(m_pTdApi, ref __Order);
}
}
}
}
开发者ID:fouvy,项目名称:OpenQuant,代码行数:23,代码来源:QBProvider.CTP.cs
示例14: EmitFilled
protected void EmitFilled(SingleOrder order, double price, int quantity, CommType commType, double commission)
{
EmitExecutionReport(order, price, quantity, commType, commission);
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:4,代码来源:CTPZQProvider.ExecutionProvider.cs
示例15: EmitCancelReject
protected void EmitCancelReject(SingleOrder order, OrdStatus status, string message)
{
OrderCancelReject reject = new OrderCancelReject
{
TransactTime = Clock.Now,
ClOrdID = order.ClOrdID,
OrigClOrdID = order.ClOrdID,
OrderID = order.OrderID,
CxlRejReason = CxlRejReason.BrokerOption,
CxlRejResponseTo = CxlRejResponseTo.CancelRequest,
OrdStatus = status
};
EmitOrderCancelReject(reject);
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:16,代码来源:CTPZQProvider.ExecutionProvider.cs
示例16: EmitPendingCancel
protected void EmitPendingCancel(SingleOrder order)
{
EmitExecutionReport(order, OrdStatus.PendingCancel);
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:4,代码来源:CTPZQProvider.ExecutionProvider.cs
示例17: OnLastStatus
private void OnLastStatus(SingleOrder order)
{
// 一个单子成交完成,报单组可能还没有完,这个地方一定要留意
if (!order.IsDone)
return;
GenericOrderItem item;
if (orderMap.TryGetValue(order, out item))
{
CThostFtdcOrderField _order;
if (orderMap.TryGetValue(item, out _order))
{
OnLastStatus(item, _order.OrderSysID, _order.OrderRef);
}
}
}
开发者ID:NYEthan1983,项目名称:OpenQuant-CTP,代码行数:16,代码来源:APIProvider.CTP.Order.cs
示例18: EmitExecutionReport
public void EmitExecutionReport(SingleOrder order, double price, int quantity, CommType commType, double commission)
{
OrderRecord record = orderRecords[order];
EmitExecutionReport(record, OrdStatus.Undefined, price, quantity, "", commType, commission);
}
开发者ID:kandsy,项目名称:OpenQuant-CTPZQ,代码行数:5,代码来源:CTPZQProvider.ExecutionProvider.cs
示例19: OrderEventArgs
public OrderEventArgs(SingleOrder order)
{
this.Order = order;
}
开发者ID:heber,项目名称:FreeOQ,代码行数:4,代码来源:OrderEventArgs.cs
示例20: EmitExecutionReport
public void EmitExecutionReport(SingleOrder order, OrdStatus status, string text)
{
OrderRecord record = this.orderRecords[order];
EmitExecutionReport(record, status, 0.0, 0, text);
}
开发者ID:fouvy,项目名称:OpenQuant,代码行数:5,代码来源:QBProvider.ExecutionProvider.cs
注:本文中的SingleOrder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论