JavaParts Forums

Discuss JavaParts services, ask for help with JavaParts products, be notified about product updates.

You are not logged in.

#1 2010-06-28 14:59:14

bethdf
New member
Registered: 2010-06-28
Posts: 1

DDE for Java with MT4

Hello,

We'are making a java application to get data from MT4 using DDE for Java... The connection with MT4 seems to be Ok, bue when we invoke the request with any item of MT4 ("EURUSD"), the response is "N/A".

We tested using DDE with Visual Basic and we got data without problems. MT4 is configurated ofr bieng a DDE server...

This is our code:

        DDEClient client;
        Conversation conv = null;
        byte[] data=null;
        client = DDEClient.getInstance();
        try {
            conv = client.connect("MT4", "BID");
            System.out.println("Connected to MT4");
            String Topic= conv.getTopic();
            data=conv.request("EURUSD", 5000);
            String sEURUSD = new String(data);
            System.out.println("EURUSD value: " + sEURUSD);
        } catch(DDEException e) {
            System.out.println(e);
        } finally {
            // disconnect in a finally clause
            try {conv.close();} catch (Exception e) {}
        }
        client.close();

Please helps us...

Offline

 

#2 2010-07-02 02:19:06

gin
Administrator
Registered: 2005-08-17
Posts: 53

Re: DDE for Java with MT4

Try advice transactions instead of direct requests.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson