Example #1
0
 virtual protected List<SimpleDate> GetExpirations(Feed feed, Contract contract, SimpleDate date)
 {
     var exps = contract.NextExpiries(date, contract.TotalListed, true, true);
     if (exps == null && feed != null && contract.ExpiryMethod.Equals("Manual"))
     {
         exps = new List<SimpleDate>();
         var cexp = FeedImportSecurityTaskExecutor.SnapExpirations(date, contract, feed, new List<Exception>());
         if (cexp != null && cexp.Count > 0)
         {
             foreach (var d in cexp)
             {
                 var contMonth = d.ContractMonth;
                 if (!contMonth.IsNull)
                 {
                     Env.Current.MarketData.SaveContractExpiration(d);
                     exps.Add(d.ContractMonth);
                 }
             }
         }
         exps = contract.NextExpiries(date, contract.TotalListed, true, true);
     }
     return exps;
 }