Example #1
0
        public bool init()
        {
            try
            {
                positionCache             = new CacheControl();
                positionCache.CacheEvent += PosCacheEvent;

                this.PositionAccountList = new ObservableCollection <string>();
                this.PositionAccountList.Add("EQUITY-TR");

                foreach (string i in PositionAccountList)
                {
                    positionCache.AddWatch("2", "", i, acct_err);
                }

                object pos_result = positionCache.Submit("Position", "true", ref pos_err);
                Console.WriteLine("Position result is " + pos_result);

                return(true);
            }
            catch (System.Runtime.InteropServices.COMException come)
            {
                Console.WriteLine("\nException <<< IS REDIPlus RUNNING? >>>\n\n" + come);
                Console.WriteLine("Press any key to continue . . .");
                Console.ReadLine();
                return(false);
            }
        }
 List <string> myOptionsList = new List <string>(new string[] { "SPX   211217C03800000", "EC4W3020J9" });  //these are options included in myInstrumentList
 public bool Init()
 {
     try
     {
         foreach (string i in myInstrumentList)
         {
             if (!QuotesDict.ContainsKey(i))
             {
                 quoteCacheControl = new CacheControl();
                 QuoteCache qCache = new QuoteCache(quoteCacheControl, i, myOptionsList.Contains(i));
                 qCache.Subscribe();
                 QuotesDict.Add(i, qCache);
             }
         }
         return(true);
     }
     catch (System.Runtime.InteropServices.COMException come)
     {
         Console.WriteLine("\nException <<< IS REDIPlus RUNNING? >>>\n\n" + come);
         Console.WriteLine("Press any key to continue . . .");
         Console.ReadLine();
         return(false);
     }
 }