vtTick.Sort((Comparison<CtpTick>)delegate(CtpTick a,CtpTick b)
{
if (a.UpdateTime < b.UpdateTime)
return -1;
if (a.UpdateTime > b.UpdateTime)
return 1;
if (a.doneVolume < b.doneVolume)
return -1;
if (a.doneVolume > b.doneVolume)
return 1;
//下面是无奈之举,都怪CTP没有updSerial,加个序号很难吗!?
if (a.WriteTime < b.WriteTime)
return -1;
if (a.WriteTime > b.WriteTime)
return 1;
return 0;
}); 转载于:https://www.cnblogs.com/norsd/archive/2013/02/16/6359434.html
本文介绍了一种针对CTP交易数据的排序算法实现。该算法通过比较交易数据的时间戳、成交量以及写入时间等关键字段来确保数据的正确排序。由于CTP未提供更新序列号,因此该算法采取了额外措施确保排序的准确性。
1459

被折叠的 条评论
为什么被折叠?



