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

Reply
 
Thread Tools Rate Thread
  #1 (permalink)  
Old 07-07-2009, 03:46 PM
Member
 
Join Date: Nov 2007
Posts: 23
forexecutor is on a distinguished road
changes to API

are there going to be any changes made to the API when the new FIFO rules starts on August 1? do we need to do anything with our platform?
Reply With Quote
  #2 (permalink)  
Old 07-07-2009, 09:36 PM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
If you are a client of FXCM US, and you are using one of the functions that is going to be disallowed for those users (e.g. stops, limits, closing trades by ticket id etc), then yes, you would be required to either adapt your application to not use those functions, or transfer your account out of the US to one of our other entities if you would prefer to keep those functions.
Reply With Quote
  #3 (permalink)  
Old 07-10-2009, 12:56 PM
Member
 
Join Date: Nov 2007
Posts: 23
forexecutor is on a distinguished road
New API

I think you missed the most important part of his questions, will the API change, and when can we get the new API so that we can make the platform compliant with the new rule changes?
Reply With Quote
  #4 (permalink)  
Old 07-16-2009, 11:30 AM
Member
 
Join Date: Nov 2007
Posts: 23
forexecutor is on a distinguished road
API changes

When will The new API be released for the changes coming as of august 1?
Reply With Quote
  #5 (permalink)  
Old 07-16-2009, 11:32 AM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
The current release is compatible. It has OCO support.
Reply With Quote
  #6 (permalink)  
Old 07-31-2009, 09:59 PM
Registered User
 
Join Date: Nov 2008
Posts: 3
xmess7 is on a distinguished road
Just to make sure that I am on the right track.
The current functions such as:
Market orders and Stop/Limit entry orders.
will continue to function in the same manner after 1 Aug.

Is this correct or do I need to download any new modification to the platform?
Thnx Jess
Reply With Quote
  #7 (permalink)  
Old 08-04-2009, 06:11 AM
Registered User
 
Join Date: Jul 2009
Posts: 4
hytech is an unknown quantity at this point
Hi,

Can any one tell me how to implement OCO order? I cant find any function in Java Trading API which allows me to create OCO order.

Thanks..

Last edited by hytech; 08-04-2009 at 06:13 AM..
Reply With Quote
  #8 (permalink)  
Old 08-04-2009, 10:08 AM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
Here is some example code: you can see the full example in QATest.testOCO()

Code:
OrderList ol = new OrderList();
ol.setContingencyType(ContingencyTypeFactory.OCO);
OrderSingle eo = MessageGenerator.generateStopLimitEntry(
        null,
        aMarketDataSnapshot.getAskClose() + .01150,
        OrdTypeFactory.STOP,
        mCollateralReport.getAccount(),
        mCollateralReport.getQuantity(),
        SideFactory.BUY,
        "EUR/USD",
        "entry order - contingency - stop loss");
ol.addOrder(eo);
mOrderRequests.add(eo.getSecondaryClOrdID());

eo = MessageGenerator.generateStopLimitEntry(
        null,
        aMarketDataSnapshot.getAskClose() - .01150,
        OrdTypeFactory.LIMIT,
        mCollateralReport.getAccount(),
        mCollateralReport.getQuantity(),
        SideFactory.BUY,
        "EUR/USD",
        "entry order - contingency - limit profit");

ol.addOrder(eo);
mOrderRequests.add(eo.getSecondaryClOrdID());

try {
    mRequestId = mFxcmGateway.sendMessage(ol);
    System.out.println("client: submitting OCO order = " + mRequestId);
} catch (Exception e) {
    e.printStackTrace();
}
Reply With Quote
  #9 (permalink)  
Old 08-05-2009, 09:48 AM
Registered User
 
Join Date: Jul 2009
Posts: 4
hytech is an unknown quantity at this point
Thanks for quick reply.

It appears that FXCM Trading Station(FTS) has not implemented OCO orders this way.In case of FTS, my observation says whole logic for OCO orders has been written in FTS not in server end.

The fact is that when you create OCO order in FTS , FTS just replaces those entry orders with same entry orders values and create some logical relationship between those. Upon execution on one of entry orders, all related entry orders are canceled.

I just want to know if I am correct or not. If I am not right , please put some light as to how FTS has implemented OCO orders.

waiting for your reply.

Thanks.
Reply With Quote
  #10 (permalink)  
Old 08-05-2009, 09:53 AM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
no that is not correct.
Reply With Quote
  #11 (permalink)  
Old 08-06-2009, 01:02 AM
Registered User
 
Join Date: Jul 2009
Posts: 4
hytech is an unknown quantity at this point
Quote:
Originally Posted by FXCM Help View Post
no that is not correct.
Thanks moderator.

where am I missing ? Please put some explainations on this . FXCM Server responses say that entry orders are just replaced when FXCM Trading Station (FTS) creates OCO orders and when one of them executes , all related entry orders are canceled.

Now If I am wrong means FXCM Server is not giving the accurate information in case of OCO orders.

Please help me to implement OCO orders as FTS has implemented it.
Reply With Quote
  #12 (permalink)  
Old 08-06-2009, 10:30 AM
Moderator
 
Join Date: Jan 2006
Posts: 1,990
FXCM Help is on a distinguished road
If you are wondering how to move an entry order in or out of an OCO group you can use OrderCancelReplaceRequest.

To move an existing entry order to a new OCO group:
OrderCancelReplaceRequest ocrr = MessageGenerator.generateOrderReplaceRequest(
"modify oco",
ep.getOrderID(),
ep.getSide(),
ep.getOrdType(),
ep.getPrice(),
ep.getAccount());
ocrr.setContingencyType(ContingencyTypeFactory.OCO );
try {
fxcmGateway.sendMessage(ocrr);
} catch (Exception e) {
e.printStackTrace();
}

To add an existing entry order to an existing OCO group:
OrderCancelReplaceRequest ocrr = MessageGenerator.generateOrderReplaceRequest(
"modify oco",
ep.getOrderID(),
ep.getSide(),
ep.getOrdType(),
ep.getPrice(),
ep.getAccount());
ocrr.setFXCMContingencyID("5920");
ocrr.setContingencyType(ContingencyTypeFactory.OCO );
try {
fxcmGateway.sendMessage(ocrr);
} catch (Exception e) {
e.printStackTrace();
}

To remove an OCO order from an OCO group:
OrderCancelReplaceRequest ocrr = MessageGenerator.generateOrderReplaceRequest(
"modify oco",
ep.getOrderID(),
ep.getSide(),
ep.getOrdType(),
ep.getPrice(),
ep.getAccount());
ocrr.setFXCMContingencyID(ep.getFXCMContingencyID( ));
try {
fxcmGateway.sendMessage(ocrr);
} catch (Exception e) {
e.printStackTrace();
}
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 10:58 PM.
Copyright ©2009 Daily FX. All Rights Reserved.