Solved

Only last value

Posted on 2011-03-13
61
269 Views
Last Modified: 2012-08-13
I need ONLY final result of counting:
public void openPositionControl(PositionReport aPositionReport) {

        java.util.Date now = new java.util.Date();
//        System.out.println("now: " + now.toString());

        if (aPositionReport != null) {
             
            if (lastReceived == null)
                lastReceived = now;
            o_pos = Math.max(o_pos, ++counter);
            if ((now.getTime() - lastReceived.getTime()) > 50L) {
                counter = 1;
//            } else {
//                counter++;
            }
             
             
//            System.out.println(" OpenPositionControl counter  " + counter);
//            System.out.println(" OpenPositionControl now: " + now.toString());
//            System.out.println(" OpenPositionControl now.getTime()  " + now.getTime());
//            System.out.println(" OpenPositionControl lastReceived  " + lastReceived);
//            System.out.println(" OpenPositionControl lastReceived.getTime()  " +lastReceived.getTime());
            
            open_pos = String.valueOf(counter);
            DCC.getInstance().setEURUSD_open_pos(open_pos);
            lastReceived = now;

            limit_pos = DCC.getInstance().getLimitPosEURUSD();
            l_pos = Integer.parseInt(limit_pos);
            pos_aval = l_pos - o_pos;
            System.out.println(" OpenPositionControl o_pos  " + o_pos);

Open in new window

So, for each request, in has to be only one printout which shows final result of counting.
0
Comment
Question by:gbcbr
  • 32
  • 25
  • 4
61 Comments
 
LVL 92

Expert Comment

by:objects
Comment Utility
that code has no way of knowing if its the final call that I can see
If thats the case then you shouldn't be printing out the value there, and instead handling it elsewhere
0
 

Author Comment

by:gbcbr
Comment Utility
what you advice?
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
need to see how it is being called, and what gets called for a request
0
 

Author Comment

by:gbcbr
Comment Utility
As soon trade signal created, it generate request to server about all opened positions, I filter them by pairs, so in this class we get only positionReports about EURUSD. As soon they counted here final result compared with defined limit and send for execution or block any actions.
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
your problem is that you are displaying the value for every position
you need to be displaying the value after you have looped through everything
0
 

Author Comment

by:gbcbr
Comment Utility
I understand this, I don't know how to do it.
It has ti be something like this:
if during 51L NO NEW MESSAGES, GIVE ME RESULT OF previous counting .
0
 
LVL 92

Expert Comment

by:objects
Comment Utility
you wouldn't do it in that code, you would do it in the code recieving the request
0
 

Author Comment

by:gbcbr
Comment Utility
This code receive the request:  
PMDS bidPx[0]   1.39418
DBFX open positions = RequestForPositionsAck{mAccount='all', mFXCMErrorDetails='null', mFXCMRequestRejectReason=-1, mParties=Parties [Party:3:D:FXCM ID();], mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqResult=PosReqResult:Valid Request (0), mPosReqStatus=PosReqStatus:Completed (0), mText='null', mTotalNumPosReports=25, mTradingSessionID='FXCM', mTradingSessionSubID='DBFXUSDD1', mPosMaintRptID='541484206', mMakingTime=1300066390319}
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40732104,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2184,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:18:38 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585606', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:18:38, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484206', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35288, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40732094,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2175,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:18:35 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585602', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:18:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484203', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.3529, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731289,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-1572,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:11:58 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585051', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:11:58, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484221', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35303, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731168,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-1489,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:11:02 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16584985', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:11:02, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484224', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35311, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731944,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2087,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:48 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585518', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:48, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484191', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35323, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731946,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2089,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:49 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585523', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:49, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484194', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35323, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731951,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2093,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:50 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585525', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:50, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484197', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35324, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731972,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2108,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:56 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585537', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:56, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484200', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35324, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40733199,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2801,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:25:39 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16586358', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:25:39, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484209', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35404, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40734889,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-3352,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:31:51 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16587878', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:31:51, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484212', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35428, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40734901,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-3363,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:31:57 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16587886', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:31:57, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484215', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35429, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40735417,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-3581,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:34:17 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16588301', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:34:17, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484218', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35438, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40737533,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-4590,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:46:47 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16589973', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:46:47, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484233', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35493, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40737542,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-4595,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:46:49 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16589978', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:46:49, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484236', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35493, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40737425,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-4558,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:46:27 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16589894', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:46:27, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484230', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35502, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40739705,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-5690,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:59:33 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16591793', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:59:33, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484239', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35517, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40739930,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-5785,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-09:00:36 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16591985', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-09:00:36, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484242', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35517, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40737256,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-4440,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:45:07 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16589765', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:45:07, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484227', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35524, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40740915,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-6301,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-09:06:34 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16592790', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-09:06:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484245', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35544, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40747269,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-11892,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:13:38 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16597626', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:13:38, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484251', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35572, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40747270,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-11894,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:13:39 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16597627', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:13:39, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484255', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35573, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40752779,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-13359,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:31:33 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16600393', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:31:33, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484258', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.36003, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40753980,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-13816,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:36:36 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16600581', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:36:36, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484264', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.36144, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40753975,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-13805,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:36:30 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16600579', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:36:30, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484261', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.36155, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40753986,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-13824,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-10:36:39 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16600582', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-10:36:39, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484267', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.36159, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
DBFX open positions = RequestForPositionsAck{mAccount='all', mFXCMErrorDetails='null', mFXCMRequestRejectReason=-1, mParties=Parties [Party:3:D:FXCM ID();], mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqResult=PosReqResult:Valid Request (0), mPosReqStatus=PosReqStatus:Completed (0), mText='null', mTotalNumPosReports=26, mTradingSessionID='FXCM', mTradingSessionSubID='DBFXUSDD1', mPosMaintRptID='541484206', mMakingTime=1300066391778}
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40732104,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2184,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:18:38 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585606', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:18:38, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484206', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35288, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40732094,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2175,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:18:35 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585602', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:18:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484203', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.3529, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731289,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-1572,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:11:58 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585051', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:11:58, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484221', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35303, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731168,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-1489,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:11:02 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16584985', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:11:02, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484224', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35311, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731944,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2087,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:48 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585518', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:48, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484191', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35323, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731946,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2089,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:49 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585523', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:49, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484194', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35323, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731951,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2093,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:50 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585525', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:50, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484197', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35324, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40731972,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2108,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:17:56 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16585537', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:17:56, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484200', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35324, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40733199,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-2801,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:25:39 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16586358', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:25:39, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484209', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35404, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40734889,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-3352,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:31:51 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16587878', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:31:51, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484212', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-233', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35428, mText='null', mTotalNumPosReports=26, mUnsolicitedIndicator=false}
 OpenPositionControl o_pos  53
 OpenPositionControl aPositionReport  Position

Open in new window

0
 

Author Comment

by:gbcbr
Comment Utility
Now problem increase, in starts count same positions without reseting, so I see some times double and even triple numbers of positions. Maybe it's better to count them by OrderID, so we sure that this positions counted only once.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Maybe it would be an option not to display it immediately when you receive it, but
 just store in one variable the value which you receive in another the last time
when you recieve it. The next time you receive new data before changing these variables, you compare the dates,
if the date is too soon, just simply replace the vlues, if the date is sufficiently later, only then
actually display. Well, then you'll display only after a little delay, when you knoe that it was not changing
for some time. On the other hand as objects put it above, anyway there is no other way that you would know that
this is the value you want to display, as the only difference between all other values
is that this one sits for a longer time
0
 

Author Comment

by:gbcbr
Comment Utility
Displaying is the last question, the problem is in confusing bot, because it supplies number directly to formula.
Displaying is only for my visual control, how many positions opened for each pair.
But the main problem that counting is the current process. This I agree with you and I try to do it, we need some intermediary variable which will keep maximum counted number of positions and use it for calculations and displaying.
Now this class looks like this:
public class OpenPositionControl_EURUSD {

    IGateway mFxcmGateway;
    protected static RequestForPositionsAck rfpa;
    ITransportable message;
    private static String openPositionMassID;
    protected static PositionReport aPositionReport;
    int counter = 0;
    java.util.Date lastReceived = null;
    java.util.Date now = new java.util.Date();
    String open_pos;
    String limit_pos;
    int o_pos;
    int l_pos;
    int pos_aval;
    boolean opc0;

    private static OpenPositionControl_EURUSD instance =
        new OpenPositionControl_EURUSD();

    public static OpenPositionControl_EURUSD getInstance() {
        return instance;
    }

    public OpenPositionControl_EURUSD() {
        this.mFxcmGateway = DBFXConnect.getGateway();
        aPositionReport = (PositionReport)message;

    }

    public void openPositionCounter(PositionReport aPositionReport) {
        java.util.Date now = new java.util.Date();

        System.out.println(" OpenPositionControl aPositionReport = " +
                           aPositionReport);

        if (aPositionReport != null) {

            if (lastReceived == null)
                lastReceived = now;

            o_pos = Math.max(o_pos, ++counter);

            if ((now.getTime() - lastReceived.getTime()) > 2L) {

                counter = 1;

            } else {
                counter++;
            }


            open_pos = String.valueOf(counter);

            DCC.getInstance().setEURUSD_open_pos(open_pos);

            lastReceived = now;
            
          openPositionControl(opc0);

        }
    }

    public void openPositionControl(boolean opc0) {


        limit_pos = DCC.getInstance().getLimitPosEURUSD();

        l_pos = Integer.parseInt(limit_pos);

        pos_aval = l_pos - o_pos;

        System.out.println(" OpenPositionControl o_pos = " + o_pos);
        System.out.println(" OpenPositionControl l_pos = " + l_pos);
        System.out.println(" OpenPositionControl pos_aval = " + pos_aval);

        if (pos_aval > 0) {

            opc0 = true;
        }

        else {

            opc0 = false;
        }

        System.out.println(" OpenPositionControl opc0 = " + opc0);
        
        DecisionCenter_EURUSD_B.getInstance().positionControl(opc0);
        DecisionCenter_EURUSD_S.getInstance().positionControl(opc0);
    }
}

Open in new window

But better to add identification by ID
0
 

Author Comment

by:gbcbr
Comment Utility
The problem with proper counting, that even filtered by pairs these messages come permanently, end even I put gap interval 2L, it still count double.
Please advice how to filter messages per unique ID, so we have as result only number of messages with unique ID, and all duplicates will be ignored.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Waht is unique ID - ?
Do you mean that your values are also accomanied bu ID, and you are looking for the moment when ID changes, and want
to show last message with the previous ID-?

If so, then you can treat ID in the same way as we were talking about dates before - keep track of the previous value of ID,
and when you see that it changed and  subsequent stufgfg will be getting another ID - from that moment
start displayien this previous value until you percieve the next change.

If this is not the case, then explain what is this ID
0
 

Author Comment

by:gbcbr
Comment Utility
Each PositionReport has unique ID:
OpenPositionControl aPositionReport  PositionReport --- begin superclass toString mAccount=00779442,mOrderID=40734889,mClOrdID=DB_U100D1_wI0cMRcIHFxyapvtyEuClCcZDfpdty4gaXezDojrHZVEzZgBKG1559-3352,mSecondaryClOrdID=EURUSD.AlgoTradeMarket_EURUSD.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=1, mFXCMSymPointSize=1.0E-4, mFXCMSymPrecision=5, mFXCMSymSortOrder=1, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/USD', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.15, mFXCMSymInterestSell=-0.34, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='Default', mID=1}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:dbd11070132001;22:Grebnevsky;10:779442;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXUSDD1,mTransactTime=20110222-08:31:51 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='16587878', mFXCMPosIDRef='null', mFXCMPosInterest=-5.16, mFXCMPosOpenTime=20110222-08:31:51, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='541484212', mPosReqID='DB_U100D1_R519s85Evb1n5xrtlXIsu5mXUetGil98RF9N1wmp3wTXREqDQOYwWl-180', mPosReqType=PosReqType:Positions (0), mSettlPrice=1.35428, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}

Open in new window

in this case - mOrderID=40734889 is the unique number, no one else PositionReport has the same number, because it's number of open position. But if server send it few times, it will be counted as new incoming report and added to sum.
The question is to count only once and ignore all duplicates which have the same mOrderID number.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
That is still difficul to understand - if this is so store this orderID in the varaible,
and then check - if the enxt one has the same OrderId just done't count it, and count only if it is
different from your stored value, then when you count store new value and wait till
a new OrderID arrives again.
0
 

Author Comment

by:gbcbr
Comment Utility
and how to store them and where? DB not acceptable, because it will take too much time just sending and receiving.
How to do this directly in this class?
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
That depends when a hwo you want to use them - if you are going to use them within
the same program - I'd add them to the ArrayList and then use later say for report, etc.
If you want them to persiste after the program exit and till it start again, if not in the databse,
then you want to write them to the file either at every step or before you exit form the program
and then read them back at the start of the program
0
 

Author Comment

by:gbcbr
Comment Utility
This set is one time use data, as soon it's updated, it's past, we need only fresh, last one. All other sets start to be garbage when new sum arrive.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Well, you don't knw to keep the old ones - even better - you just need the String which keeps the last one.
Why is this a problem?
0
 

Author Comment

by:gbcbr
Comment Utility
:)
0
 

Author Comment

by:gbcbr
Comment Utility
The problem is that 2 days I can't supply to my bot proper QTY of open positions, and if I have limit 10 position, and open 5 it counts 12 and block trades without reason.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Well, how could that happen? Why would it count 12 if you have just 5  opened?
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
So it send you this line every second - and it has only open positions?
So you need to count how manty difdferent orderid's you have?
Does it send you at any time information that sertain position (orderId) is closed?
0
 

Author Comment

by:gbcbr
Comment Utility
Yes, this is second possible way, but I suppose it much complicated.
I'll explain you procedure;
1. Many parts of my app ask about open positions and send this request:
this.mFxcmGateway = DBFXConnect.getGateway();
        aPositionReport = (PositionReport)message;

Open in new window

2. When (PositionReport)messages arrive into DBFX class they filtered there by currency pairs and each pair report forwarded to his class:
if (aPositionReport.getInstrument().getSymbol() ==
                                null ? "EUR/USD" == null :
                                aPositionReport.getInstrument().getSymbol().equals("EUR/USD")) {

                                aStopLimitEntryOrder_EURUSD =
                                        new StopLimitEntryOrderPR_EURUSD();
                                aStopLimitEntryOrder_EURUSD.stopLimitEntryOrder(aPositionReport);

                                OpenPositionControl_EURUSD.getInstance().openPositionCounter(aPositionReport);

Open in new window

3. Than, in this class we have to find from these filtered by pair bulked messages real number of open positions. Because< as I told before it's a limitation rule for opening only defined QTY for each pair. If number of open positions even to limit, all trade orders ignored. If it's possible to solve this problem by filtering unique ID numbers, it will be easiest way.
 
client: streaming = ClosedPositionReport --- begin superclass toString PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11868774,mClOrdID=DB_E100R1_133Zi8hytSHD6EuSt7EpzZbHsgJMGESEcdnJr14lqQ41whn3QoQeS3-1240,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=-4.56, mFXCMSymInterestSell=-2.0, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110315-17:30:50 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6610464', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110315-17:29:36, mFXCMUsedMargin=0.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218028129', mPosReqID='null', mPosReqType=PosReqType:Trades (1), mSettlPrice=112.985, mText='I', mTotalNumPosReports=0, mUnsolicitedIndicator=true} --- end superclass toString {mFXCMCloseClOrdID='DB_E100R1_133Zi8hytSHD6EuSt7EpzZbHsgJMGESEcdnJr14lqQ41whn3QoQeS3-1251', mFXCMCloseOrderID='11868783', mFXCMCloseSecondaryClOrdID='EURJPY.StopLimitEntryOrderPR_EURJPY.<init>()', mFXCMCloseSettlPrice=113.015, mFXCMPosClosePNL=2,65, mFXCMPosCloseTime=20110315-17:30:50}

Open in new window

4. If not, we have to make DB where to record all open positions and all closed positions and get result from there.
Of course it much accurate method, but will need additional time to create separate counting system, because it has to work independent from trade system, otherwise, when I restart trading app and I have open positions, I will lose all closing reports and some parts of already closed positions will remain permanently and  look as open.
If we can't do it in simple way, I will do it.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
If you want to maintain information when your application is closed, you cannot get away without either database or file.

Within ath application what I would do, I would mainatin the ArrayList of orderId's.
As soon as you get the message that position is opened you add the ID to this arraylist
if(!arralist.contains(orderId))arraylst.add(orderId);

If you receive a message that position is closed - you remove this ID from the list.
So at any moment you'll have the list of all ID's opened, and the arraylisrt.size()
will give you at any time the count how many ID's are opened.
 
0
 

Author Comment

by:gbcbr
Comment Utility
That's nice, because I don't need to persist this useless information. As I understood, even I restart app, I'l create new array with open positions and as soon they close, they will be deducted from the array.
This what I need exactly.
0
 

Author Comment

by:gbcbr
Comment Utility
@for_yan
Any idea how to create this array?
I  make some preparation, please advice how to continue:
PositionReport aPositionReport;
    ClosedPositionReport cPositionReport;
..........


                    } else if (message instanceof ClosedPositionReport) {
                        cPositionReport =
                            (ClosedPositionReport)message;

                        try {

                            if (cPositionReport.getInstrument().getSymbol() ==
                                null ? "EUR/USD" == null :
                                cPositionReport.getInstrument().getSymbol().equals("EUR/USD")) {

                                
                                OpenPositionControl_EURUSD.getInstance().openPositionCounter(aPositionReport, cPositionReport);

.............

                    } else if (message instanceof PositionReport) {

                        aPositionReport = (PositionReport)message;
                        try {

                            if (aPositionReport.getInstrument().getSymbol() ==
                                null ? "EUR/USD" == null :
                                aPositionReport.getInstrument().getSymbol().equals("EUR/USD")) {

                                aStopLimitEntryOrder_EURUSD =
                                        new StopLimitEntryOrderPR_EURUSD();
                                aStopLimitEntryOrder_EURUSD.stopLimitEntryOrder(aPositionReport);

                                OpenPositionControl_EURUSD.getInstance().openPositionCounter(aPositionReport,
                                                                                             cPositionReport);

Open in new window

public void openPositionCounter(PositionReport aPositionReport, ClosedPositionReport cPositionReport) {
        java.util.Date now = new java.util.Date();

        //        System.out.println(" OpenPositionControl aPositionReport = " +
        //                           aPositionReport);

        if (aPositionReport != null || cPositionReport != null) {
            
            open_ordID[???] = aPositionReport.getOrderID();
            close_ordID[???] = cPositionReport.getOrderID();

????????????????????????????

Open in new window

0
 

Author Comment

by:gbcbr
Comment Utility
Sorry:
String[] open_ordID = new String[50];
    String[] close_ordID = new String[50];
.............

public void openPositionCounter(PositionReport aPositionReport, ClosedPositionReport cPositionReport) {
        java.util.Date now = new java.util.Date();

        //        System.out.println(" OpenPositionControl aPositionReport = " +
        //                           aPositionReport);

        if (aPositionReport != null || cPositionReport != null) {
            
            open_ordID[???] = aPositionReport.getOrderID();
            close_ordID[???] = cPositionReport.getOrderID();

????????????????????????????

Open in new window

0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
I would not go for array in this situation; I think arraylist is better,
as array needs to be created with the set size upfront - you rather have ArrayList

From what I undeserstood from you I'm not sure you want two arrays - just one arraylist where you add new
open position and remove closed positions would be OK
0
 

Author Comment

by:gbcbr
Comment Utility
It has problem with this API, you can't mix these two reports in one method, I tried and I have error, you can't use pretrade and posttrade massages.
So, now I create two separated methods, to extract orderID, I think we can manage these variables without above mentioned restrictions.
But I didn't understand
>>you want two arrays - just one arraylist
how we create array list if we don't have any array?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 47

Accepted Solution

by:
for_yan earned 500 total points
Comment Utility
You don't need to have array to create arraylist.

You first say ArrayList al= new ArrayList();
Then, as soon as your data arrives you add it to your ArrayList:
al.add(object)

If you store say Strings or any other objects you just say al.add(s);
If you want to store double or int you need to wrap them into Object like new Integer(int) or new Double(double) and then add wrapped object.
ArrayList can expand as you like, and you do not need to allocate space to it on creation. Ot is in general much more convenient than array - I use arrays only in very special cases.

My previoius remark about going to arraylist and maintaining one arraylist has nothing to do with your response. No one could disallow us to do it.
0
 

Author Comment

by:gbcbr
Comment Utility
I construct two new methods
String open_ordID;
    String close_ordID;    

public void openPositionCounter(PositionReport aPositionReport) {

        if (aPositionReport != null) {

            open_ordID = aPositionReport.getOrderID();

            System.out.println("CHF/JPY openPositionCounter aPositionReport = " +
                               aPositionReport);

            System.out.println(" CHF/JPY open_ordID     " + open_ordID);
        }
    }

    public void closePositionCounter(ClosedPositionReport cPositionReport) {

        if (cPositionReport != null) {

            close_ordID = cPositionReport.getOrderID();

            System.out.println("CHF/JPY closePositionCounter cPositionReport = " +
                               cPositionReport);

            System.out.println(" CHF/JPY close_ordID     " + close_ordID);

        }
    }

Open in new window

and make analysis of messages:
1. During trading session between trades I receive sorted by pair PositionReports, but the as I told before they are coming with duplicates:
MarginControl = true
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218049615', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3188', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     12053551
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951236,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3379,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:34 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611357', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042417', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3205', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.89, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951236
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951240,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3388,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:35 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611361', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042431', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3205', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.915, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951240
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218049615', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3205', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     12053551
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951236,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3379,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:34 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611357', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042417', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3232', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.89, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951236
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951240,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3388,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:35 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611361', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042431', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3232', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.915, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951240
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218049615', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3232', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     12053551
   bl1 = false
 DC_S EUR/CHF  BusinessLogic =  false
 DC_S EUR/CHF  TradeOpen =  false
 DC_S EUR/CHF  BorderControl =  false
 DC_S EUR/CHF  PositionControl =  false
    side  null
    MarginControl = true
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951236,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3379,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:34 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611357', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042417', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3280', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.89, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951236
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951240,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3388,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:35 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611361', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042431', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3280', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.915, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951240
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218049615', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3280', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     12053551
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951236,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3379,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:34 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611357', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042417', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3283', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.89, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951236
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951240,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3388,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:35 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611361', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:35, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042431', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3283', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.915, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951240
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218049615', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3283', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     12053551
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11951236,mClOrdID=DB_E100R1_hM1JTEMpm02zl03xJ0dYQ7nXtPhQUhsW6ElZvQKhLZMfTU585ploBK-3379,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-09:39:34 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611357', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-09:39:34, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218042417', mPosReqID='DB_E100R1_CBTLwGhwO7aQoPdi6XcZr2gwIrJVEJIMuxHzkYKTPm9kri8PiyTihD-3270', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.89, mText='null', mTotalNumPosReports=25, mUnsolicitedIndicator=false}
 CHF/JPY open_ordID     11951236

Open in new window

I'm already extract ID numbers for easy reading and sorting.
So, first we need to write somewhere these number and count them.
2. After trade, which close position, I get two messages:
- one is PositionReport with ID traded position and
- second is ClosePositionReport which show ID of closed positions, so the similar;
MarginControl = true
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050095', mPosReqID='null', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='U', mTotalNumPosReports=0, mUnsolicitedIndicator=true}
 CHF/JPY open_ordID     12053551
CHF/JPY closePositionCounter cPositionReport = ClosedPositionReport --- begin superclass toString PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-15:01:19 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=0.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050096', mPosReqID='null', mPosReqType=PosReqType:Trades (1), mSettlPrice=87.98, mText='I', mTotalNumPosReports=0, mUnsolicitedIndicator=true} --- end superclass toString {mFXCMCloseClOrdID='DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3082', mFXCMCloseOrderID='12053600', mFXCMCloseSecondaryClOrdID='CHFJPY.StopLimitEntryOrderPR_CHFJPY.<init>()', mFXCMCloseSettlPrice=87.95, mFXCMPosClosePNL=2,68, mFXCMPosCloseTime=20110316-15:01:19}
 CHF/JPY close_ordID     12053551
client: streaming = ClosedPositionReport --- begin superclass toString PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-15:01:19 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=0.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050096', mPosReqID='null', mPosReqType=PosReqType:Trades (1), mSettlPrice=87.98, mText='I', mTotalNumPosReports=0, mUnsolicitedIndicator=true} --- end superclass toString {mFXCMCloseClOrdID='DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3082', mFXCMCloseOrderID='12053600', mFXCMCloseSecondaryClOrdID='CHFJPY.StopLimitEntryOrderPR_CHFJPY.<init>()', mFXCMCloseSettlPrice=87.95, mFXCMPosClosePNL=2,68, mFXCMPosCloseTime=20110316-15:01:19}

Open in new window

As you told before, we can store this numbers in ArrayList
al.add(open_orderID), but how we will remove closed orders number from this list and how to read number of stored positions?
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 500 total points
Comment Utility
I think remove(String orderid) should work to remove those which are closed

To count the number of iopen is simple:
whwn you add, you first check that this order does not already exists in the array list
if(!al.contains(orderid))al.add(orderId)
thereofr you'll have each orderid only once there
then al.size() will give you the number of currently open positions at every momemnt
0
 

Author Comment

by:gbcbr
Comment Utility
public void arrayCount(String open_ordID, String close_ordID){

   ArrayList al= new ArrayList();
   
   if (!al.contains(open_ordID)){
       al.add(open_ordID);
       o_pos = al.size();

            System.out.println(" EUR/JPY o_pos     " + o_pos);
  }
  if (open_ordID == close_ordID){
  al.remove(open_ordID);
  al.size();
  }
  }

Open in new window

EUR/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11897607,mClOrdID=DB_E100R1_Ukh8e5Q7PXcHEe7sYpdGNCVkiF5LNbDNfjsmzceQa1MUHiwoxTO9lx-8354,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.12, mFXCMSymInterestSell=-1.15, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-07:18:04 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6611079', mFXCMPosIDRef='null', mFXCMPosInterest=0.48, mFXCMPosOpenTime=20110316-07:18:04, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218056201', mPosReqID='DB_E100R1_sut5IwWjOlmsyg08GfcUO4A7fJxF4NWV8n5ZwzmYcvNwhvbOvUoedC-12', mPosReqType=PosReqType:Positions (0), mSettlPrice=113.168, mText='null', mTotalNumPosReports=23, mUnsolicitedIndicator=false}
 EUR/JPY open_ordID     11897607
 EUR/JPY o_pos     1
client: reply = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11897607,mClOrdID=DB_E100R1_Ukh8e5Q7PXcHEe7sYpdGNCVkiF5LNbDNfjsmzceQa1MUHiwoxTO9lx-8354,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.12, mFXCMSymInterestSell=-1.15, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-07:18:04 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6611079', mFXCMPosIDRef='null', mFXCMPosInterest=0.48, mFXCMPosOpenTime=20110316-07:18:04, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218056201', mPosReqID='DB_E100R1_sut5IwWjOlmsyg08GfcUO4A7fJxF4NWV8n5ZwzmYcvNwhvbOvUoedC-12', mPosReqType=PosReqType:Positions (0), mSettlPrice=113.168, mText='null', mTotalNumPosReports=23, mUnsolicitedIndicator=false}
EUR/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11897574,mClOrdID=DB_E100R1_Ukh8e5Q7PXcHEe7sYpdGNCVkiF5LNbDNfjsmzceQa1MUHiwoxTO9lx-8319,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.12, mFXCMSymInterestSell=-1.15, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-07:18:03 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6611078', mFXCMPosIDRef='null', mFXCMPosInterest=0.48, mFXCMPosOpenTime=20110316-07:18:03, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218056204', mPosReqID='DB_E100R1_sut5IwWjOlmsyg08GfcUO4A7fJxF4NWV8n5ZwzmYcvNwhvbOvUoedC-12', mPosReqType=PosReqType:Positions (0), mSettlPrice=113.169, mText='null', mTotalNumPosReports=23, mUnsolicitedIndicator=false}
 EUR/JPY open_ordID     11897574
 EUR/JPY o_pos     1
client: reply = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11897574,mClOrdID=DB_E100R1_Ukh8e5Q7PXcHEe7sYpdGNCVkiF5LNbDNfjsmzceQa1MUHiwoxTO9lx-8319,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.12, mFXCMSymInterestSell=-1.15, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-07:18:03 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6611078', mFXCMPosIDRef='null', mFXCMPosInterest=0.48, mFXCMPosOpenTime=20110316-07:18:03, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218056204', mPosReqID='DB_E100R1_sut5IwWjOlmsyg08GfcUO4A7fJxF4NWV8n5ZwzmYcvNwhvbOvUoedC-12', mPosReqType=PosReqType:Positions (0), mSettlPrice=113.169, mText='null', mTotalNumPosReports=23, mUnsolicitedIndicator=false}
EUR/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=11896862,mClOrdID=DB_E100R1_Ukh8e5Q7PXcHEe7sYpdGNCVkiF5LNbDNfjsmzceQa1MUHiwoxTO9lx-7366,mSecondaryClOrdID=EURJPY.AlgoTradeMarket_EURJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=10, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=10, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='EUR/JPY', mTouchTime=0} --- end superclass toString {mCurrency='EUR', mRoundLot=1.0, mFXCMSymInterestBuy=0.12, mFXCMSymInterestSell=-1.15, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-07:15:01 --- end superclass toString {mCurrency='EUR', mFXCMPosCommission=0.0, mFXCMPosID='6611074', mFXCMPosIDRef='null', mFXCMPosInterest=0.48, mFXCMPosOpenTime=20110316-07:15:01, mFXCMUsedMargin=100.0, mLastRptRequested=false, mListID='null', mPositionQty=Position amount (Buy) 10000.0, mPosMaintRptID='218056207', mPosReqID='DB_E100R1_sut5IwWjOlmsyg08GfcUO4A7fJxF4NWV8n5ZwzmYcvNwhvbOvUoedC-12', mPosReqType=PosReqType:Positions (0), mSettlPrice=113.188, mText='null', mTotalNumPosReports=23, mUnsolicitedIndicator=false}
 EUR/JPY open_ordID     11896862
 EUR/JPY o_pos     1

Open in new window

Why it's printout only 1?
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
What is this method - and why you feed both open and close orderiD into it?
Does not seem logical.
And why do you create ArrayList insiide it?
Makes not much sense.

How I see it - you have process which sends you messages - some of them conatin infgormation about openeing
others - about closing.

So you create ArrayList in the very beginning - before you start handiling these messages.

Then you receive the message and see if it is mesage abbout opening, or mayeb about say price of the
position which you are holding - you check idf it already exists in your arrayList you just skip it.
If it is a message about closing you remove it.

But you do not have any coupling between opening ID's and closed Id's within one method, and of course you do not create your ArrayList every time



0
 

Author Comment

by:gbcbr
Comment Utility
I make stupid mistake about placing ArrayList inside the method.
But when I place it  at the class beginning it counts very well, only the problem with deleting closed positions. But adding very accurate.
I don't understand this
>>When you receive the message
I have to receive message into some method and I can't receive these two messages in one method, as I told before, this is the reason why I create two separated methods,  get data from both methods, create third method which collect data from both messages.
If I just create ArrayList from one type of messages, I will not be able to use in this ArrayList data from another type of message. They are completely different types, like String and double. This is the reason why I created variables independent from type of messages.
Please help to delete closed positions from this ArrayList and this question will be solved
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Well, don't understadn what you mean.
In my mind you should have one ArrayList - it should be class level instance variable and
at each moment it should contain currently open positions.
So at the moment when you receive the message about opening you add this ID to the list.
At the moment when you receive a message about closing - either in the msae method or in idfferent method -
as your list is instance-wide variable - it does not matter - at this moment you remove this
ID from rthe list.
Even if these mmessages arrive to you in the methods of different class it is still doable by passing the
ArrayList between the classes, but I think you have it within one class, but in different methods - so that
should be very strightforrward. You don't need even special method for any
of that - just a line of code in the beginning for creating ArrayList,
one line of code at the place where you receive message about opening and another where you receive
message about closing. And then at any place where you want to display the totla number just use size()
method of the ArrayList

 
0
 

Author Comment

by:gbcbr
Comment Utility
Can you please show on my code where you suggest to place this code, I'm completely confused with you advice.
public class OpenPositionControl_CHFJPY {

    ArrayList al = new ArrayList();
    IGateway mFxcmGateway;
    protected static RequestForPositionsAck rfpa;
    ITransportable message;
    protected static PositionReport aPositionReport;
    protected static ClosedPositionReport cPositionReport;
    int counter = 0;
    java.util.Date lastReceived = null;
    java.util.Date now = new java.util.Date();
    String open_pos;
    String limit_pos;
    int o_pos;
    int l_pos;
    int pos_aval;
    boolean opc9;
    String aval_pos;
    String open_ordID;
    String close_ordID;

    private static OpenPositionControl_CHFJPY instance =
        new OpenPositionControl_CHFJPY();

    public static OpenPositionControl_CHFJPY getInstance() {
        return instance;
    }

    public OpenPositionControl_CHFJPY() {
        this.mFxcmGateway = DBFXConnect.getGateway();
        aPositionReport = (PositionReport)message;
        cPositionReport = (ClosedPositionReport)message;
    }

    public void openPositionCounter(PositionReport aPositionReport) {

        if (aPositionReport != null) {

            open_ordID = aPositionReport.getOrderID();
            arrayCount(open_ordID, close_ordID);
        }
    }

    public void closePositionCounter(ClosedPositionReport cPositionReport) {

        if (cPositionReport != null) {

            close_ordID = cPositionReport.getOrderID();
            arrayCount(open_ordID, close_ordID);
        }
    }

    public void arrayCount(String open_ordID, String close_ordID) {

        if (!al.contains(open_ordID)) {
            al.add(open_ordID);
            o_pos = al.size();
        }
        if (open_ordID == close_ordID) {
            al.remove(open_ordID);
            al.size();
        }
        openPositionControl(opc9);
    }

    public void openPositionControl(boolean opc9) {

        limit_pos = DCC.getInstance().getLimitPosEURUSD();

        l_pos = Integer.parseInt(limit_pos);

        pos_aval = l_pos - o_pos;

        if (pos_aval >= 0) {

            opc9 = true;
            aval_pos = "Open";
        }

        else {

            opc9 = false;
            aval_pos = "Close";
        }

        open_pos = String.valueOf(o_pos);

        DCC.getInstance().setCHFJPY_open_pos(open_pos);
        FlagControl.getInstance().setPositions_CHFJPY(aval_pos);
        DecisionCenter_CHFJPY_B.getInstance().positionControl(opc9);
        DecisionCenter_CHFJPY_S.getInstance().positionControl(opc9);
    }
}

Open in new window

0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 500 total points
Comment Utility
I don't think you need so many counter methods.

You now declared ArrayList al in the rifght place as instance variable.
I would rather create it in constructor - not in the middle of nowhere like you do - don't understand how that works.

Then answer the following questions (I don't know the flow of your application - I cannot do it myself):
Is there a place where you receive the message that the position Order_ID  is opened (forget about counting it)?
(say, where you receive some string or parse some received string, which contains this information)
as soon as you receive such notification and Order_ID beciomes known to you add line
 al.add(Order_ID);

Is there a place where you receive the mssage that the position Order_ID is closed (forget about counting it)?
at this pioint add line:

al.remove(Order_ID);

Is there a place where you want to display the total number of opend Orders?
At this point add line:

System.out.println("Number of opened positions: " + al.size());
or setText on the text box or label or whatever





0
 

Author Comment

by:gbcbr
Comment Utility
>>Is there a place where you receive the message that the position Order_ID
yes, but to see it I have to extract it, this I'm doing by  
open_ordID = aPositionReport.getOrderID();
because message full of different data.
So, it has to be like this:
public OpenPositionControl_CHFJPY() {
        this.mFxcmGateway = DBFXConnect.getGateway();
        aPositionReport = (PositionReport)message;
        cPositionReport = (ClosedPositionReport)message;
    }

    public void openPositionCounter(PositionReport aPositionReport) {

        if (aPositionReport != null) {

            open_ordID = aPositionReport.getOrderID();

         if (!al.contains(open_ordID)) {
            al.add(open_ordID);
            o_pos = al.size();
        }
            openPositionControl(opc9)
    }

    public void closePositionCounter(ClosedPositionReport cPositionReport) {

        if (cPositionReport != null) {
             
            close_ordID = cPositionReport.getOrderID();

          if (open_ordID == close_ordID) {
            al.add(open_ordID);
            o_pos = al.size();
          }
        }
            openPositionControl(opc9)
    }

Open in new window

0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Well, but how does it contradict with what I wrote?
You pick up hundred kilos of stuff - underneath you undig your jewell - no matter
how you got to it - there it is now - so after you got hold of it - so add it to your ArrayList

the same also when you get it as closed
0
 

Author Comment

by:gbcbr
Comment Utility
You confuse me completely.
Please insert in my code, how you see it.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
I can't insert into your code - I don't understand what your code is doing.

Is your code only dedicated to counting the number of open positions?
Or it is supposed to do some other stuff? Or as I had assumed, it was showing something
on the screen, implementing trades, etc. ?
In any case I don't see the reason of having so many counter methods.

This is the general scheme:

You maintain the ArrayList, the elements of which at any given moment will be the OrderId's of open positions.

You declare this ArrayList as instabnce variable.

At the moment when your class is instantiated (usually in constructor)
you also create this ArrayList - it will be empty at this moment.

My assumption that somewhere in your class there is a method
which is called with some argument which in some way (perhaps encapsulated in some text)
has the orderId of the opened position.

I also believe that somewhere in your class (perhaps in the same method or in another method)
you receive another another string(text) containing information of the closing position and this
information refers to the order_id of the opening of this position.
If this assumption is not true, then we need some other way to know
which of the opened positions is closed, but for now this is my assumpltion.

With these assumtions when you receieve and extract information about openieng
position you add element order_id to your array list.
When you receive information about closing of the position (which contains reference to the
openeing orderid for this position) then you remove the string order_id from your arraylist.

With these two condditions your ArrayList at any moment of its life will contain
only ID's of those positions which are opened.
If you count the size of the ArrayList (just use its size() method), you'll
always have the mnumer of open positions.

Don't write - I am confused - this statement contains zero information - rather
explain what in particular you do not understand.

 



0
 

Author Comment

by:gbcbr
Comment Utility
>>I can't insert into your code
I write that I'm confused because in my imagination I did exactly what you say above.
>>you also create this ArrayList - it will be empty at this moment.
1. create new ArrayList in constructor;
public OpenPositionControl_EURUSD() {
        al = new ArrayList();
        this.mFxcmGateway = DBFXConnect.getGateway();
        aPositionReport = (PositionReport)message;
        cPositionReport = (ClosedPositionReport)message;
    }

Open in new window

>>My assumption that somewhere in your class there is a method
which is called with some argument which in some way (perhaps encapsulated in some text)
has the orderId of the opened position.
2.  
public void openPositionCounter(PositionReport aPositionReport) {

        if (aPositionReport != null) {

            open_ordID = aPositionReport.getOrderID();
            if (!al.contains(open_ordID)) {
                al.add(open_ordID);
                o_pos = al.size();
            }

          closePositionCounter( cPositionReport);
            openPositionControl(opc0);
        }
    }

Open in new window

and it perfect add positions to the list and displays result in GUI.

>> When you receive information about closing of the position (which contains reference to the
openeing orderid for this position) then you remove the string order_id from your arraylist.
3.
public void closePositionCounter(ClosedPositionReport cPositionReport) {

        if (cPositionReport != null) {

            close_ordID = cPositionReport.getOrderID();
            if (open_ordID == close_ordID) {
                al.remove(open_ordID);
                al.size();
                o_pos = al.size();
            }

            System.out.println(" ClosePositionCounter open_ordID = " + open_ordID);
            System.out.println(" ClosePositionCounter close_ordID = " + close_ordID);
            openPositionControl(opc0);
        }
    }

Open in new window

this part doesn't work, means doesn't remove closed positions from array list.

I don't ask you to write some specific code for my app.
Logically this code has to remove records.
a. it gets close message;
b. ID identified;
c. we can see in outprint that all necessary values arrive to this method for deleting record, but it doesn't.


I ask only to correct the part responsible for removing old data only.
client: streaming = CollateralReport{mAccount='5200002168', mCashOutstanding=13 374,21, mCollInquiryID='null', mCollRptID='218094157', mFXCMCashDaily=0, mFXCMMarginCall='N', mFXCMUsedMargin=2 100, mFXCMUsedMargin3=2 100, mLastRptRequested=true, mStartCash=11 879,82, mTotNumReports=0, mTradingSessionID='FXCM', mTradingSessionSubID='DBFXEURR1', mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;4000:Y;);], mMarginRatio=0, mQuantity=10 000, mEndCash=13 374,21}
 OpenPositionControl o_pos = 7
 OpenPositionControl l_pos = 5
 OpenPositionControl pos_aval = -2
 OpenPositionControl opc0 = false
 DealControl position = 0
 ClosePositionCounter open_ordID = 12279179
 ClosePositionCounter close_ordID = 12279179
 OpenPositionControl o_pos = 7
 OpenPositionControl l_pos = 5
 OpenPositionControl pos_aval = -2
 OpenPositionControl opc0 = false
 DealControl position = 0

Open in new window

0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility

There is a lot of extra activity in these counters.
Say, why do you need this check

 if (open_ordID == close_ordID)

and what does this mean?

I assume that you receive order_id  (I guess order_id under which this position was bought)
for the postion you want to close, then why do you need this check?

Well, place system.printout of the id and system.printout of the arraylist before
remove and fterr remove - all that just around the remove statement - we'll probably then have
some understanding
 
0
 

Author Comment

by:gbcbr
Comment Utility
I store not messages, just numbers of position, so in this way

if (open_ordID == close_ordID)

I try to show which exact number has to be deleted.
Otherwise I don't understand how to manage deleting of exact numbers from the ArrayList
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility


Do you recieve information about closing of position ?
Does it contain order_id under which this position was registered when it was bought?
0
 

Author Comment

by:gbcbr
Comment Utility
ClosePositionCounter open_ordID = 12279179
 ClosePositionCounter close_ordID = 12279179
0
 

Author Comment

by:gbcbr
Comment Utility
MarginControl = true
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050095', mPosReqID='null', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='U', mTotalNumPosReports=0, mUnsolicitedIndicator=true}
 CHF/JPY open_ordID     12053551
CHF/JPY closePositionCounter cPositionReport = ClosedPositionReport --- begin superclass toString PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-15:01:19 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=0.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050096', mPosReqID='null', mPosReqType=PosReqType:Trades (1), mSettlPrice=87.98, mText='I', mTotalNumPosReports=0, mUnsolicitedIndicator=true} --- end superclass toString {mFXCMCloseClOrdID='DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3082', mFXCMCloseOrderID='12053600', mFXCMCloseSecondaryClOrdID='CHFJPY.StopLimitEntryOrderPR_CHFJPY.<init>()', mFXCMCloseSettlPrice=87.95, mFXCMPosClosePNL=2,68, mFXCMPosCloseTime=20110316-15:01:19}
 CHF/JPY close_ordID     12053551

Open in new window

0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
I don't understand why you should get them two times - is it opened or is it closed?

Anyway, add printouts, as I specified above, - we'll then see why it is not removed
0
 

Author Comment

by:gbcbr
Comment Utility
This what I try explain you many times, I have numbers, I make this counting abstract from type of messages.
This numbers arrive in both methods, why it doesn't remove it from the list?
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
I don't understand what you mean by  "abstract" - you
should know if it is opening position message or closing position message - and this is
a crucial part of information - how can you count anything without it?
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Anyway, add printouts inside your if's and we should understand what
is going on irrespective of whether I can understand what you are doing
0
 

Author Comment

by:gbcbr
Comment Utility
Let's go from the beginning:
1. It's two types of messages (Open) PositionReport which I get after opening position and it comes periodically for some calls until this position will be closed and I can't get them in one method:
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050095', mPosReqID='null', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='U', mTotalNumPosReports=0, mUnsolicitedIndicator=true}

Open in new window

2. ClosePositionReport comes when the position closed and this message comes in pair with relative PositionReport:
CHF/JPY openPositionCounter aPositionReport = PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-14:41:08 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=100.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050095', mPosReqID='null', mPosReqType=PosReqType:Positions (0), mSettlPrice=87.98, mText='U', mTotalNumPosReports=0, mUnsolicitedIndicator=true}
 CHF/JPY open_ordID     12053551
CHF/JPY closePositionCounter cPositionReport = ClosedPositionReport --- begin superclass toString PositionReport --- begin superclass toString mAccount=5200002168,mOrderID=12053551,mClOrdID=DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3031,mSecondaryClOrdID=CHFJPY.AlgoTradeMarket_CHFJPY.<init>(),mInstrument=TradingSecurityAdj --- begin superclass toString TradingSecurity --- begin superclass toString Instrument{mCFICode='null', mContractMultiplier=1, mFactor=1, mFXCMCondDistEntryLimit=0.0, mFXCMCondDistEntryStop=0.0, mFXCMCondDistLimit=0.0, mFXCMCondDistStop=0.0, mFXCMMaxQuantity=5.0E7, mFXCMMinQuantity=1.0, mFXCMProductID=1, mFXCMSymID=12, mFXCMSymPointSize=0.01, mFXCMSymPrecision=3, mFXCMSymSortOrder=12, mFXCMTradingStatus='O', mProduct=4, mSecurityType='null', mSymbol='CHF/JPY', mTouchTime=0} --- end superclass toString {mCurrency='CHF', mRoundLot=1.0, mFXCMSymInterestBuy=-0.32, mFXCMSymInterestSell=-0.84, mFXCMSubscriptionStatus='T'} --- end superclass toString {mAskAdjustment=0.0, mBidAdjustment=0.0, mPriceStream=PriceStream{mName='BBO', mID=2}},mParties=Parties [Party:3:D:FXCM ID(26:32;2:5200002168;22:Lion Commercial Llc;10:2168;);],mTradingSessionID=FXCM,mTradingSessionSubID=DBFXEURR1,mTransactTime=20110316-15:01:19 --- end superclass toString {mCurrency='CHF', mFXCMPosCommission=0.0, mFXCMPosID='6611774', mFXCMPosIDRef='null', mFXCMPosInterest=0.0, mFXCMPosOpenTime=20110316-14:41:08, mFXCMUsedMargin=0.0, mLastRptRequested=true, mListID='null', mPositionQty=Position amount (Sell) 10000.0, mPosMaintRptID='218050096', mPosReqID='null', mPosReqType=PosReqType:Trades (1), mSettlPrice=87.98, mText='I', mTotalNumPosReports=0, mUnsolicitedIndicator=true} --- end superclass toString {mFXCMCloseClOrdID='DB_E100R1_V6qdNaid14NWbvML68ymwFKDtCeIYSzdTPnlBwUaWzIzX0kkTsmOCv-3082', mFXCMCloseOrderID='12053600', mFXCMCloseSecondaryClOrdID='CHFJPY.StopLimitEntryOrderPR_CHFJPY.<init>()', mFXCMCloseSettlPrice=87.95, mFXCMPosClosePNL=2,68, mFXCMPosCloseTime=20110316-15:01:19}
 CHF/JPY close_ordID     12053551

Open in new window

this is reason why I make if (open_ordID == close_ordID), because in other time, just regular messages they arrive like this:
ClosePositionCounter open_ordID = 12140572
ClosePositionCounter close_ordID = 12279140

Open in new window

So, this is crazy stream which has information about all closed positions and if we just use any ClosePositionReport for deleting records it will be big mess. This is why I try to define which exactly number of position has to be deleted.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Well, that still makes not much sense - why they should come in pairs - close and open togrther - and who gurantees that they come
simultaneously, and what that another message about open has to do with the closing.
And if the opening message didn't arrive, but only the closing message - should not you still
remove it?

I would look only for waht contains critical information.

Whatever is opened should trigger adding, wherever you receive this message.
 If you happen to receive more than one message about
openeing the same order_id
then, as we discussed below, check if arrayList already containes this order_id and add only if
it does not contain such order_id - no matter how many times you'll receive opening messge
- your ArrayList in this case will contain this order_id only once.

About removing - even that precaution is unnecessary - once you receive closing position message - remove
corresponding order_id; even if you receve two closing messages for one number -
second removal of the same order_id will not hurt - there is no reason to check - just remove.
Why to wait for another opening message when you need to remove is not understandable to me.

Once again, no sense to explain it to me - just add printouts and see
what is happening and why it does not remove.
0
 

Author Comment

by:gbcbr
Comment Utility
>>and who gurantees that they come
simultaneously,

This is the obvious

Please tell me which exactly printout you want to see, because I'm already posted above all existing printouts.
If you want to see something specific, just tell what I have to add.
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 500 total points
Comment Utility
Something like that:  


close_ordID = cPositionReport.getOrderID();
            if (open_ordID == close_ordID) {
System.out.println("al_size_before: " + al.size());
System.out.println("al_before: " + al.toString());
System.out.println("open_ordID: " + open_ordID);
                al.remove(open_ordID);
System.out.println("al_size_after: " + al.size());
System.out.println("al_after: " + al.toString());

                al.size();
                o_pos = al.size();
            }
0
 

Author Comment

by:gbcbr
Comment Utility
It's very strange, but it doesn't print these messages?
public void closePositionCounter(ClosedPositionReport cPositionReport) {

        if (cPositionReport != null) {

            close_ordID = cPositionReport.getOrderID();

                        if (open_ordID == close_ordID) {
                System.out.println("al_size_before: " + al.size());
                System.out.println("al_before: " + al.toString());
                System.out.println("open_ordID: " + open_ordID);
                            al.remove(open_ordID);
                System.out.println("al_size_after: " + al.size());
                System.out.println("al_after: " + al.toString());
                            al.size();
                            o_pos = al.size();
                        }

                        System.out.println(" ClosePositionCounter open_ordID = " + open_ordID);
                        System.out.println(" ClosePositionCounter close_ordID = " + close_ordID);
                        openPositionControl(opc0);
        }
    }

Open in new window

OpenPositionControl o_pos = 7
 OpenPositionControl l_pos = 5
 OpenPositionControl pos_aval = -2
 OpenPositionControl opc0 = false
 DealControl opc0 = false
 ClosePositionCounter open_ordID = 12292679
 ClosePositionCounter close_ordID = 12292679

Open in new window

but we see that open_ordID and close_ordID have the same value.
0
 
LVL 47

Assisted Solution

by:for_yan
for_yan earned 500 total points
Comment Utility
Are open_ordID and close_ordID - strings?
if so you should not compare strings like that:open_ordID == close_ordID
you should use open_ordID.eqiuals( close_ordID)

0
 

Author Comment

by:gbcbr
Comment Utility
I suppose that this was a problem.
So, now my code works perfect.
0
 
LVL 47

Expert Comment

by:for_yan
Comment Utility
Great!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now