public void printContract(MamdaOptionContract contract)
            {
                if (!myGotRecap)
                {
                    return;
                }
                if (contract == null)
                {
                    return;
                }

                MamdaTradeRecap tradeRecap  = contract.getTradeInfo();
                MamdaQuoteRecap quoteRecap  = contract.getQuoteInfo();
                String          symbol      = contract.getSymbol();
                String          exchange    = contract.getExchange();
                String          expireDate  = contract.getExpireDateStr();
                double          strikePrice = contract.getStrikePrice();
                double          lastPrice   = tradeRecap.getLastPrice().getValue();
                long            accVolume   = tradeRecap.getAccVolume();
                double          bidPrice    = quoteRecap.getBidPrice().getValue();
                double          askPrice    = quoteRecap.getAskPrice().getValue();

                Console.WriteLine("    " +
                                  expireDate + " " + strikePrice + " (" +
                                  symbol + " " + exchange + ")  | " +
                                  lastPrice + " | " + bidPrice + " | " +
                                  askPrice + " | " + accVolume);
            }
예제 #2
0
 public OptionContractTicker(MamdaOptionContract contract,
                             MamdaOptionChain chain,
                             OptionChainDisplay display)
 {
     myContract = contract;
     myChain    = chain;
     myDisplay  = display;
 }
예제 #3
0
 public void printlnContract(MamdaOptionContract contract)
 {
     if (!myGotRecap)
     {
         return;
     }
     printContract(contract);
     Console.WriteLine();
 }
 public OptionContractTicker(
     MamdaOptionContract contract,
     MamdaOptionChainView view,
     OptionChainDisplay display)
 {
     myContract = contract;
     myView     = view;
     myDisplay  = display;
 }
예제 #5
0
            public void onOptionContractCreate(
                MamdaSubscription subscription,
                MamdaOptionChainListener listener,
                MamaMsg msg,
                MamdaOptionContract contract,
                MamdaOptionChain chain)
            {
                // (Optional: create a trade/quote handler for the
                // individual option contract.)
                OptionContractTicker aTicker =
                    new OptionContractTicker(contract, chain, this);

                contract.addQuoteHandler(aTicker);
                contract.addTradeHandler(aTicker);
            }
            public void printChain(MamdaOptionChain chain)
            {
                if (!myGotRecap)
                {
                    return;
                }

                int      i        = 0;
                Iterator callIter = chain.callIterator();
                Iterator putIter  = chain.putIterator();

                Console.WriteLine("Chain: " + chain.getSymbol());

                while (callIter.hasNext() || putIter.hasNext())
                {
                    Console.Write("" + i + " | ");
                    if (callIter.hasNext())
                    {
                        MamdaOptionContract callContract =
                            (MamdaOptionContract)callIter.next();
                        printContract(callContract);
                    }
                    else
                    {
                        Console.Write("          ");
                    }

                    Console.Write(" | ");

                    if (putIter.hasNext())
                    {
                        MamdaOptionContract putContract =
                            (MamdaOptionContract)putIter.next();
                        printContract(putContract);
                    }
                    else
                    {
                    }
                    Console.WriteLine();
                    ++i;
                }
                Console.Out.Flush();
            }
            public void printContractSet(
                MamdaOptionContractSet contractSet,
                String putCallStr)
            {
                if (contractSet == null)
                {
                    return;
                }
                MamdaOptionContract bbo      = contractSet.getBboContract();
                MamdaOptionContract wbbo     = contractSet.getWombatBboContract();
                Collection          exchs    = contractSet.getExchangeContracts();
                Iterator            exchIter = exchs.iterator();

                Console.WriteLine("  " + putCallStr + " options:");
                printContract(bbo);
                printContract(wbbo);
                while (exchIter.hasNext())
                {
                    MamdaOptionContract exch = (MamdaOptionContract)exchIter.next();
                    printContract(exch);
                }
            }
예제 #8
0
            public OptionContractTicker(MamdaOptionContract contract,
										MamdaOptionChain    chain,
										OptionChainDisplay  display)
            {
                myContract            = contract;
                myChain               = chain;
                myDisplay             = display;
            }
예제 #9
0
 public void printlnContract(MamdaOptionContract  contract)
 {
     if (!myGotRecap)
         return;
     printContract(contract);
     Console.WriteLine();
 }
예제 #10
0
            public void printContract(MamdaOptionContract  contract)
            {
                if (!myGotRecap)
                    return;

                MamdaTradeRecap tradeRecap = contract.getTradeInfo();
                MamdaQuoteRecap quoteRecap = contract.getQuoteInfo();
                string symbol       = contract.getSymbol();
                string exchange     = contract.getExchange();
                DateTime expireDate = contract.getExpireDate();
                double strikePrice  = contract.getStrikePrice();
                double lastPrice    = tradeRecap.getLastPrice().getValue();
                long   accVolume    = tradeRecap.getAccVolume();
                double bidPrice     = quoteRecap.getBidPrice().getValue();
                double askPrice     = quoteRecap.getAskPrice().getValue();
                Console.Write(expireDate + " " + strikePrice + " (" +
                    symbol + " " + exchange + ")  | " +
                    lastPrice + " | " + bidPrice + " | " +
                    askPrice + " | " + accVolume);
                Console.Out.Flush();
            }
예제 #11
0
            public void onOptionContractCreate(
				MamdaSubscription         subscription,
				MamdaOptionChainListener  listener,
				MamaMsg                   msg,
				MamdaOptionContract       contract,
				MamdaOptionChain          chain)
            {
                // (Optional: create a trade/quote handler for the
                // individual option contract.)
                OptionContractTicker aTicker =
                    new OptionContractTicker(contract, chain, this);
                contract.addQuoteHandler(aTicker);
                contract.addTradeHandler(aTicker);
            }
예제 #12
0
            public OptionContractTicker(
				MamdaOptionContract   contract,
				MamdaOptionChainView  view,
				OptionChainDisplay    display)
            {
                myContract            = contract;
                myView                = view;
                myDisplay             = display;
            }