コード例 #1
0
        public virtual void Display()
        {
            foreach (object o in array)
            {
                Tradable test = o as Tradable;
                if (test != null)
                {
                    Console.WriteLine(test.symbol);
                }

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

                Option test3 = o as Option;
                if (test3 != null)
                {
                    Console.WriteLine("Option underlying=" + test3.underlying);
                    Console.WriteLine("Theroratical Price=" + test3.TheoraticalPrice());
                }
            }
        }
コード例 #2
0
ファイル: Market2.cs プロジェクト: cyrus903/TestFactoryMethod
        public override void Create()
        {
            Tradable t = new Security("0002");

            Add(t);

            Tradable t2 = new Futures("CLPF7", "0002", 2017, 1);

            Add(t2);

            Tradable t3 = new Option("CLPF7_100C", "0002", 2017, 1, 100, 'C');

            Add(t3);
        }
コード例 #3
0
        public virtual void Create()
        {
            Tradable t = new Security("0001");

            Add(t);

            Tradable t2 = new Futures("CHKH7", "0001", 2017, 1);

            Add(t2);

            Tradable t3 = new Option("CHKH7_100C", "0001", 2017, 1, 100, 'C');

            Add(t3);
        }