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

Reply
 
Thread Tools Rate Thread
  #1 (permalink)  
Old 04-13-2009, 12:30 PM
Member
 
Join Date: Jan 2009
Posts: 9
evanross is on a distinguished road
Multiple New/Stopped execution reports

I've seen situations, even on very small orders, where I receive multiple New/Stopped pairs of execution reports.
What does it mean?
Most liquidity providers will only send a single NEW ER to show that it has received my order.
Reply With Quote
  #2 (permalink)  
Old 04-20-2009, 08:28 PM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
Usually once you place an order, you will receive a several execution reports updating you to the status of your order. Going from New -> Pending -> eventually to Executed or Rejected.

If the cases you are having, would you be able to show some logs of what you are seeing to help determine what it is you are seeing?
Reply With Quote
  #3 (permalink)  
Old 08-06-2009, 11:19 AM
Registered User
 
Join Date: Jan 2009
Posts: 3
cparis64 is on a distinguished road
two orders created for a single request

I have a similar problem, sometimes when I request a new order, I get two execution reports.

I am attaching a log example and the code that I am using:

INFO 10:05:49(Processor.java:533) - Start Trade, Bid: 1.41052, Ask: 1.41059, at 07/29 10:05:49
INFO 10:05:49(Processor.java:535) - place long order
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:In process (P)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Pending Calculated (U)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:In process (P)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Pending Calculated (U)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Executing (E)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Executed (F)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Executing (E)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000
INFO 10:05:50(ExecutionReportProcessor.java:272) - exe.getPrice() = 1.41061
INFO 10:05:50(ExecutionReportProcessor.java:277) - exe.getFXCMOrdStatus() = FXCMOrdStatus:Executed (F)
INFO 10:05:50(ExecutionReportProcessor.java:279) - exe.getOrderQty() = 10,000



public boolean placeFXCMMarketOrder(ARCOrder order) {
Liaison liaison = Liaison.getInstance();
IRequestFactory requestFactory = liaison.getRequestFactory();
IRequest request;
String comment = Long.toString(System.currentTimeMillis());
request = requestFactory.createTrueMarketOrder(SessionData.f xPair.getPair(),
(String) SessionData.getFxAccountNames().elementAt(SessionD ata.getFxAccountIndex()),
order.isBuy() ? Side.BUY: Side.SELL,
order.getUnits(),
comment);
FXCMOrderListener orderListener = new FXCMOrderListener(this);

try {
TradeDesk.getInst().getOpenPositions().subscribe(o rderListener, SignalType.ADD);
TradeDesk.getInst().getOpenPositions().subscribe(o rderListener, SignalType.CHANGE);
TradeDesk.getInst().getOpenPositions().subscribe(o rderListener, SignalType.REMOVE);

liaison.sendRequest(request);
orderListener.waitForProcessing();

Position position = orderListener.getOrder(comment);
if (position == null) {
System.out.println("DataSourceManager NULL position");
return false;
}
order.setPrice(position.getOpenPrice());
order.setUnits(position.getAmount());
order.setOrderedTime(position.getOpenTime().getTim e() / 1000L);
order.setTranNbr(position.getTicketID());
} catch (LiaisonException aEx) {
aEx.printStackTrace();
return false;
} finally {
TradeDesk.getInst().getOpenPositions().unsubscribe (orderListener, SignalType.ADD);
TradeDesk.getInst().getOpenPositions().unsubscribe (orderListener, SignalType.CHANGE);
TradeDesk.getInst().getOpenPositions().unsubscribe (orderListener, SignalType.REMOVE);
}


return true;
}
Reply With Quote
  #4 (permalink)  
Old 08-06-2009, 11:44 AM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
As the order is being worked with the banks, the status may go to new again as part of its workflow. It does not indicate another new order, it just indicates the status is reset to new again because it did not fill.
Reply With Quote
  #5 (permalink)  
Old 08-06-2009, 01:02 PM
Registered User
 
Join Date: Jan 2009
Posts: 3
cparis64 is on a distinguished road
Yet, in this case we confirmed with FXCM that two orders were created.
Reply With Quote
  #6 (permalink)  
Old 08-06-2009, 01:04 PM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
you must be sending the order twice then somehow. seems like you took bits and pieces of JavaTradeStation code there. I would recommend you just use the straight API, take a look at ClientTester.java/QATest.java
Reply With Quote
  #7 (permalink)  
Old 08-06-2009, 06:06 PM
Registered User
 
Join Date: Jan 2009
Posts: 3
cparis64 is on a distinguished road
Where can I get ClientTester.java/QATest.java from?
Reply With Quote
  #8 (permalink)  
Old 08-06-2009, 06:10 PM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
You will find these files inside the trading_sdk.jar. in the following directory.

trading_sdk\fxcm-api\src
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 06:35 PM.
Copyright ©2009 Daily FX. All Rights Reserved.