Ejemplo n.º 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();
            }
        }
Ejemplo n.º 2
0
        public override Tradable CreateTradable(string symbol)
        {
            Tradable t = null;

            t = _t.Clone();
            ////Copy other attributes
            t.symbol = symbol;
            return(t);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 6
0
 public virtual void AddTradable(Tradable t)
 {
     _imp.AddTradable(_mkt, t);
 }
Ejemplo n.º 7
0
 public override void AddTradable(IMarket m, Tradable t)
 {
     m.AddTradable(t);
 }
Ejemplo n.º 8
0
 public virtual void AddTradable(IMarket m, Tradable t)
 {
 }
Ejemplo n.º 9
0
 protected void Add(Tradable t)
 {
     mkt.AddTradable(t);
 }
Ejemplo n.º 10
0
 public MarketPrototypeFactory(Exchange ex, Tradable t)
 {
     _ex = ex;
     _t  = t;
 }
Ejemplo n.º 11
0
 public virtual void AddTradable(IMarket mkt, Tradable t)
 {
     mkt.AddTradable(t);
 }
Ejemplo n.º 12
0
        public virtual Tradable Clone()
        {
            Tradable t = new Tradable(this.symbol);

            return(t);
        }
Ejemplo n.º 13
0
 public virtual void AddTradable(Tradable t)
 {
     array.Add(t);
 }