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()); } } }
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); }
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); }