Пример #1
0
        /// <summary>
        /// 持仓回调
        /// </summary>
        /// <param name="trade"></param>
        public static void PositionDelegate(PositionData position)
        {
            lock (AllPositionDetailData)
            {
                var detail = GetPositionDetail(position.symbol, position.accountID);
                detail.UpdatePosition(position);

                var detail2 = GetPositionDetail(position.symbol);
                detail2.UpdatePosition(position);
            }
        }
Пример #2
0
 /// <summary>
 /// 通过qnPositionName找到Position
 /// </summary>
 /// <param name="qnOrderID"></param>
 /// <returns></returns>
 public static PositionData GetPosition(string qnPositionName)
 {
     if (DicPosition.Keys.Contains(qnPositionName))
     {
         return(DicPosition[qnPositionName]);
     }
     else
     {
         var position = new PositionData();
         DicPosition.TryAdd(qnPositionName, position);
         MainData.AllPositionData.Insert(0, position);
         return(position);
     }
 }