Пример #1
0
        static void BuildRef(FutureManager mgr, string exchangeid, string productid)
        {
            List <Future> lstfuture = mgr.GetFutures(exchangeid, productid);

            List <IndexFuture> lstidx = new List <IndexFuture>();

            foreach (Future future in lstfuture)
            {
                if (future.FutureType == EnumFutureType.Reference)
                {
                    string futureid = mgr.GetRealFuture(future.ID);
                    if (futureid.Length > 0 && mgr.HasFuture(futureid))
                    {
                        future.RealFuture = mgr[futureid];
                    }
                }
                else if (future.FutureType == EnumFutureType.Index)
                {
                    lstidx.Add(future as IndexFuture);
                }
            }

            foreach (IndexFuture idxfuture in lstidx)
            {
                foreach (Future future in lstfuture)
                {
                    if (future.FutureType == EnumFutureType.Normal)
                    {
                        idxfuture.Add(future);
                    }
                }

                if (mgr.HasFuture(productid + "9999"))
                {
                    idxfuture.RealFuture = mgr[productid + "9999"].RealFuture;
                }
            }
        }