コード例 #1
0
 internal void AddResetItem(DateTime tradeDay, InstrumentResetItem resetItem)
 {
     if (_resetItemHistoryDict.ContainsKey(tradeDay))
     {
         Logger.WarnFormat("AddResetItem already Exists tradeDay = {0}, instrumentId ={1}, resetItem = {2}, previousResetItem = {3}", tradeDay, this.Id, resetItem,
                           _resetItemHistoryDict[tradeDay]);
     }
     else
     {
         _resetItemHistoryDict.AddItem(resetItem, OperationType.AsNewRecord);
     }
 }
コード例 #2
0
        internal InstrumentResetItem GetResetItem(DateTime tradeDay)
        {
            InstrumentResetItem result;

            if (!_resetItemHistoryDict.TryGetValue(tradeDay, out result))
            {
                var histories = ResetManager.Default.GetAccountInstrumentResetHistory(_owner.Id, this.Id, tradeDay);
                if (histories == null || histories.Count() == 0)
                {
                    return(null);
                }
                result = new InstrumentResetItem(histories.Single());
                _resetItemHistoryDict.AddItem(result, OperationType.AsNewRecord);
            }
            return(_resetItemHistoryDict[tradeDay]);
        }