Go Back   DailyFX Forex Forum | FX Forum > FXCM Products and Services > FXProgrammers > Discussion / Support Forum > Java Trading API Support

Reply
 
Thread Tools Rate Thread
  #1 (permalink)  
Old 01-09-2009, 07:41 AM
Junior Member
 
Join Date: Jan 2009
Posts: 4
vkapartzianis is on a distinguished road
Any way to request a specific ClosedPositionReport?

I've tried filling in any or all of the fields below in a RequestForPositions (with PosReqType = PosReqTypeFactory.TRADES), in addition to setting Account and Account ID in FXCM party fields.

FXCMPosID
ClOrdID
SecondaryClOrdID


All I get back is

RequestForPositionsAck{mAccount='00532171', mFXCMErrorDetails='No open positions in response', mFXCMRequestRejectReason=2, mParties=Parties [Party:3:D:FXCM ID();], mPosReqID='U100D3_hyGg8muiH08PbhgtfslR8FZo1cMEqQ8P Fdkq7veCvtKS2oPskPFzY147z-2682', mPosReqResult=PosReqResult:No positions found that match criteria (2), mPosReqStatus=PosReqStatus:Rejected (2), mText='No positions in response', mTotalNumPosReports=0, mTradingSessionID='FXCM', mTradingSessionSubID='PREMIUMDEMO', mPosMaintRptID='0', mMakingTime=1231506954836}


Is it possible to request a specific closed position?
Reply With Quote
  #2 (permalink)  
Old 01-14-2009, 10:25 AM
Moderator
 
Join Date: Jan 2006
Posts: 2,005
FXCM Help is on a distinguished road
Please make sure you have the latest version of the Java API and try the following to get closed trades.

RequestForPositions rfp = new RequestForPositions();

//set criteria for search
rfp.setClOrdID("foo");
//or
rfp.setOrderID("foo");
//or
rfp.setFXCMPosID("foo");
//or
rfp.setSecondaryClOrdID("foo");

rfp.setPosReqType(PosReqTypeFactory.TRADES);
fxcmGateway.sendMessage(rfp);
Reply With Quote
  #3 (permalink)  
Old 01-15-2009, 07:58 AM
Junior Member
 
Join Date: Jan 2009
Posts: 4
vkapartzianis is on a distinguished road
Thanks guys, for fixing this so quickly
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Disclaimer: Trading foreign exchange on margin carries a high level of risk, and may not be suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to trade foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with foreign exchange trading, and seek advice from an independent financial advisor if you have any doubts. Any opinions, news, research, analyses, prices, or other information contained on this website is provided as general market commentary and does not constitute investment advice. Forex Capital Markets LLC. will not accept liability for any loss or damage, including without limitation to, any loss of profit, which may arise directly or indirectly from use of or reliance on such information.

All times are GMT -5. The time now is 12:05 AM.
Copyright ©2009 Daily FX. All Rights Reserved.