void onTradeRecap (
     MamdaSubscription*      subscription,
     MamdaTradeListener&     listener,
     const MamaMsg&          msg,
     const MamdaTradeRecap&  recap)
 {
     cout << "Trade Recap (" << recap.getSymbol ()
          << " ("            << recap.getPartId () << ")" << "): \n";
 }
 void onTradeClosing (
     MamdaSubscription*              subscription,
     MamdaTradeListener&             listener,
     const MamaMsg&                  msg,
     const MamdaTradeClosing&        event,
     const MamdaTradeRecap&          recap)
 {
     cout << "Closing trade (" << recap.getSymbol ()
          << " ("              << recap.getPartId () << ")): "
          << "price: "         << event.getClosePrice().getAsString()
          << "; accVol: "      << recap.getAccVolume ()
          << "\n";
 }
 void onTradeReport (
     MamdaSubscription*      subscription,
     MamdaTradeListener&     listener,
     const MamaMsg&          msg,
     const MamdaTradeReport& event,
     const MamdaTradeRecap&  recap)
 {
     cout << "Trade ("       << recap.getSymbol ()
          << " ("            << recap.getPartId () << ")"
          << ":"             << recap.getTradeCount ()
          << "):  "          << event.getTradeVolume ()
          << " @ "           << event.getTradePrice().getAsString()
          << " (seq#: "      << event.getEventSeqNum ()
          << "; partId: "    << event.getTradePartId ()
          << "; srcTime: "   << event.getSrcTime().getAsString()
          << "; lineTime: "  << event.getLineTime().getAsString()
          << "; tradeTime: " << event.getEventTime().getAsString()
          << "; acttime: "   << event.getActivityTime().getAsString()
          << "; qual: "      << event.getTradeQual ()
          << "; bid: "       << mQuoteListener.getBidPrice().getAsString()
          << "; ask; "       << mQuoteListener.getAskPrice().getAsString()
          << ")\n";
 }
 void onTradePossiblyDuplicate (
     MamdaSubscription*                  subscription,
     MamdaTradeListener&                 listener,
     const MamaMsg&                      msg,
     const MamdaTradePossiblyDuplicate&  event,
     const MamdaTradeRecap&              recap)
 {
     cout << "Possibly duplicate trade (" << subscription->getSymbol ()
          << " / "         << event.getMsgQual().getAsString()
          << "("           << event.getMsgQual().getValue()
          << ")): price: " << event.getTradePrice().getAsString()
          << "; accVol: "  << recap.getAccVolume ()
          << " (seq#: "    << event.getEventSeqNum()
          << "; time: "    << event.getEventTime().getAsString()
          << ")\n";
 }
Beispiel #5
0
 void onTradeOutOfSequence (
     MamdaSubscription*              subscription,
     MamdaTradeListener&             listener,
     const MamaMsg&                  msg,
     const MamdaTradeOutOfSequence&  event,
     const MamdaTradeRecap&          recap) 
 {
     cout << "Out of sequence trade (" << subscription->getSymbol ()
          << " / "         << event.getMsgQual().getAsString()
          << "("           << event.getMsgQual().getValue()
          << ")): price: " << event.getTradePrice().getAsString()
          << "; accVol: "  << recap.getAccVolume()
          << " (seq#: "    << event.getEventSeqNum()
          << "; time: "    << event.getEventTime().getAsString()
          << ")\n"
          << flush;
 }
Beispiel #6
0
 void onTradeReport (
     MamdaSubscription*      subscription,
     MamdaTradeListener&     listener,
     const MamaMsg&          msg,
     const MamdaTradeReport& event,
     const MamdaTradeRecap&  recap)
 {
     cout << "Trade ("     << subscription->getSymbol ()
          << ":"           << recap.getTradeCount ()
          << "):  "        << event.getTradeVolume ()
          << " @ "         << event.getTradePrice().getAsString()
          << " (seq#: "    << event.getEventSeqNum ()
          << "; time: "    << event.getEventTime().getAsString()
          << "; acttime: " << event.getActivityTime().getAsString()
          << "; partId: "  << event.getTradePartId ()
          << "; qual: "    << event.getTradeQual ()
          << "; cond: "    << event.getTradeQualNative ()
          << "; irreg: "   << event.getIsIrregular () << ")\n"
          << flush;
 }
    void onTradeReport (
        MamdaSubscription*      subscription,
        MamdaTradeListener&     listener,
        const MamaMsg&          msg,
        const MamdaTradeReport& event,
        const MamdaTradeRecap&  recap)
    {
        ofstream Fieldtest1; 
        //Fieldtest1.open ("ControlCallBackMsgs/TradeFields/TradeFieldTest.out");
        Fieldtest1.open ("newMsgs/newTradeFieldTest.out");
        if(!Fieldtest1)
        {
            cout << "Cannot open file.\n";
            exit(1);
        }

        Fieldtest1  << recap.getSymbol() 
                    << recap.getSrcTime().getAsString()  
                    << event.getTradePartId()
                    //<< recap.getF64("wTotalVolume",475,113561846)    
                    << recap.getTotalValue()
                    << recap.getVwap() 
                    << recap.getTradeCount()
                    << event.getIsIrregular()
                    << event.getTradeQual()  
                    //<< recap.getI32("wTradeSeqNum",483, 1)
                    << event.getTradeQualNative()
                    << listener.getTradePrice().getValue() 
                    << recap.getNetChange().getValue()   
                    << recap.getPctChange()
                    << recap.getTradeUnits() 
                    << recap.getTradeDirection()
                    << recap.getLastTime().getAsString()
                    << event.getTradeVolume()  
                    << recap.getActivityTime().getAsString() 
                    //<< recap.MamaMsg::getDateTime("wSendTime",?, val)    
                    << recap.getLineTime().getAsString()                         
                    << listener.getPubId()    
                    << recap.getEventSeqNum()   
                    << event.getEventTime().getAsString()      
                    << recap.getIrregPartId()     
                    << recap.getIrregVolume()    
                    << recap.getIrregTime().getAsString()      
                    << recap.getTradeDate().getAsString()   
                    << recap.getOffExAccVolume()    
                    << recap.getOnExAccVolume()   
                    << recap.getOpenPrice().getValue()         
                    << recap.getHighPrice().getValue()  
                    << recap.getLowPrice().getValue()    
                    << recap.getClosePrice().getValue()    
                    << recap.getPrevClosePrice().getValue()    
                    << recap.getAdjPrevClosePrice().getValue()    
                    << recap.getPrevCloseDate().getAsString()    
                    << recap.getBlockCount()   
                    << recap.getBlockVolume()  
                    << recap.getOffExVwap()    
                    << recap.getOnExVwap()    
                    << recap.getOffExTotalValue()    
                    << recap.getOnExTotalValue()    
                    << recap.getStdDev()    
                    << recap.getStdDevSum()    
                    << recap.getStdDevSumSquares()   
                    << recap.getLastSeqNum()   
                    << recap.getHighSeqNum()    
                    << recap.getLowSeqNum()    
                    << recap.getTotalVolumeSeqNum()    
                    << recap.getCurrencyCode()      
                    << recap.getSettlePrice().getValue()     
                    << recap.getSettleDate().getAsString()    
                    << listener.getOrderId()    
                    << listener.getUniqueId()     
                    << listener.getTradeAction()   
                    << listener.getTradeExecVenue() 
                    << listener.getTradeSellersSaleDays()
                    << listener.getOrigStopStock() 
                    //<< recap.getI64("wOrigSeqNum",423, 1) causes this test to abort    
                    << listener.getOrigPrice().getValue()   
                    << listener.getOrigVolume()    
                    << listener.getOrigPartId()    
                    << listener.getOrigQual()    
                    << listener.getOrigQualNative()    
                    //<< recap.getI64("wOrigSaleDays",422, 1) causes this test to abort    
                    << listener.getOrigStopStock()  
                    << listener.getCorrPrice().getValue()    
                    << listener.getCorrPartId()    
                    << listener.getCorrQual()    
                    << listener.getCorrQualNative()    
                    //<< recap.getI64("wCorrSaleDays",250, 1)causes this test to abort      
                    << listener.getCorrStopStock()    
                    << listener.getOffExchangeTradePrice().getValue()    
                    << listener.getOnExchangeTradePrice().getValue()   
                    << flush; 
  
        Fieldtest1.close();     
        
        ofstream  Fieldtest2;  
        //Fieldtest2.open ("ControlCallBackMsgs/TradeFieldStates/TradeFieldStateTest.out");
        Fieldtest2.open ("newMsgs/newTradeFieldStatesTest.out");  
        if(!Fieldtest2)
        {
            cout << "Cannot open file.\n";
            exit(1);
        }
            
        Fieldtest2  << recap.getSymbolFieldState()          
                    << recap.getSrcTimeFieldState()   
                    << event.getTradePartIdFieldState()
                    //<< recap.getF64("wTotalVolume",475,113561846)    
                    << recap.getTotalValueFieldState() 
                    << recap.getVwapFieldState()
                    << recap.getTradeCountFieldState()
                    << event.getIsIrregularFieldState() 
                    << event.getTradeQualFieldState()  
                    //<< recap.getI32("wTradeSeqNum",483, 1)
                    << event.getTradeQualNativeFieldState()
                    << listener.getTradePriceFieldState()
                    << recap.getNetChangeFieldState()  
                    << recap.getPctChangeFieldState()
                    << recap.getTradeUnitsFieldState() 
                    << recap.getTradeDirectionFieldState()
                    << recap.getLastTimeFieldState()
                    << event.getTradeVolumeFieldState()  
                    << recap.getActivityTimeFieldState() 
                    //<< recap.MamaMsg::getDateTime("wSendTime",?, val)    
                    << recap.getLineTimeFieldState()                       
                    << listener.getPubIdFieldState()    
                    << recap.getEventSeqNumFieldState()   
                    << event.getEventTimeFieldState()      
                    << recap.getIrregPartIdFieldState()     
                    << recap.getIrregVolumeFieldState()    
                    << recap.getIrregTimeFieldState()      
                    << recap.getTradeDateFieldState()  
                    << recap.getOffExAccVolumeFieldState()    
                    << recap.getOnExAccVolumeFieldState()   
                    << recap.getOpenPriceFieldState()         
                    << recap.getHighPriceFieldState() 
                    << recap.getLowPriceFieldState()  
                    << recap.getClosePriceFieldState()  
                    << recap.getPrevClosePriceFieldState()    
                    << recap.getAdjPrevClosePriceFieldState()    
                    << recap.getPrevCloseDateFieldState()    
                    << recap.getBlockCountFieldState()   
                    << recap.getBlockVolumeFieldState()  
                    << recap.getOffExVwapFieldState()    
                    << recap.getOnExVwapFieldState()    
                    << recap.getOffExTotalValueFieldState()    
                    << recap.getOnExTotalValueFieldState()    
                    << recap.getStdDevFieldState()    
                    << recap.getStdDevSumFieldState()    
                    << recap.getStdDevSumSquaresFieldState()   
                    << recap.getLastSeqNumFieldState()   
                    << recap.getHighSeqNumFieldState()    
                    << recap.getLowSeqNumFieldState()    
                    << recap.getTotalVolumeSeqNumFieldState()    
                    << recap.getCurrencyCodeFieldState()     
                    << recap.getSettlePriceFieldState()    
                    << recap.getSettleDateFieldState()    
                    << listener.getOrderIdFieldState()    
                    << listener.getUniqueIdFieldState()     
                    << listener.getTradeActionFieldState()   
                    << listener.getTradeExecVenueFieldState() 
                    << listener.getTradeSellersSaleDaysFieldState()
                    << listener.getOrigStopStockFieldState() 
                    //<< recap.getI64("wOrigSeqNum",423, 1) causes this test to abort    
                    << listener.getOrigPriceFieldState()   
                    << listener.getOrigVolumeFieldState()    
                    << listener.getOrigPartIdFieldState()    
                    << listener.getOrigQualFieldState()    
                    << listener.getOrigQualNativeFieldState()    
                    //<< recap.getI64("wOrigSaleDays",422, 1) causes this test to abort    
                    << listener.getOrigStopStockFieldState()  
                    << listener.getCorrPriceFieldState()   
                    << listener.getCorrPartIdFieldState()    
                    << listener.getCorrQualFieldState()    
                    << listener.getCorrQualNativeFieldState()    
                    //<< recap.getI64("wCorrSaleDays",250, 1)causes this test to abort      
                    << listener.getCorrStopStockFieldState()    
                    << listener.getOffExchangeTradePriceFieldState()   
                    << listener.getOnExchangeTradePriceFieldState()   
                    << flush;  
   
        Fieldtest2.close();            
        return ;   
    }