Example #1
0
        public virtual void Display()
        {
            int count = 0;

            foreach (object o in array)
            {
                count++;
                Console.WriteLine("item: " + count);

                Console.WriteLine("Is Tradable?");
                Tradable test = o as Tradable;
                if (test != null)
                {
                    Console.WriteLine("YES symbol = " + test.symbol);
                }

                Console.WriteLine("Is Security?");
                Security test1 = o as Security;
                if (test1 != null)
                {
                    Console.WriteLine("YES symbol = " + test1.symbol);
                }

                Console.WriteLine("Is Futures?");
                Futures test2 = o as Futures;
                if (test2 != null)
                {
                    Console.WriteLine("YES Futures underlying=" + test2.underlying);
                    Console.WriteLine("Theroratical Price=" + test2.TheoraticalPrice());
                }

                Console.WriteLine("Is Option?");
                Option test3 = o as Option;
                if (test3 != null)
                {
                    Console.WriteLine("YES Option underlying=" + test3.underlying);
                    Console.WriteLine("Theroratical Price=" + test3.TheoraticalPrice());
                }

                Console.WriteLine("Is CFD?");
                CFD test4 = o as CFD;
                if (test4 != null)
                {
                    Console.WriteLine("YES symbol = " + test4.symbol);
                }


                Console.WriteLine("Is Exchange?");
                Exchange t5 = o as Exchange;
                if (t5 != null)
                {
                    Console.WriteLine("YES name = " + t5.name);
                }


                Console.WriteLine();
            }
        }
        public override Tradable CreateTradable(string symbol)
        {
            Tradable t = null;

            t = _t.Clone();
            ////Copy other attributes
            t.symbol = symbol;
            return(t);
        }
Example #3
0
        public override double Price()
        {
            double p = 0;

            foreach (object o in array)
            {
                Tradable t = o as Tradable;
                p += t.Price();
            }
            return(p);
        }
 public void AddTradable(Tradable t)
 {
     adaptee.AddTradable(t);
 }
 public override void AddTradable(Tradable t)
 {
     base.AddTradable(t);
 }
 public virtual void AddTradable(Tradable t)
 {
     _imp.AddTradable(_mkt, t);
 }
Example #7
0
 public override void AddTradable(IMarket m, Tradable t)
 {
     m.AddTradable(t);
 }
Example #8
0
 public virtual void AddTradable(IMarket m, Tradable t)
 {
 }
Example #9
0
 protected void Add(Tradable t)
 {
     mkt.AddTradable(t);
 }
 public MarketPrototypeFactory(Exchange ex, Tradable t)
 {
     _ex = ex;
     _t  = t;
 }
 public virtual void AddTradable(IMarket mkt, Tradable t)
 {
     mkt.AddTradable(t);
 }
Example #12
0
        public virtual Tradable Clone()
        {
            Tradable t = new Tradable(this.symbol);

            return(t);
        }
Example #13
0
 public virtual void AddTradable(Tradable t)
 {
     array.Add(t);
 }