Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

read from remote server
 Post subject: read from remote server Post rating: 0   New post Posted: Wed 08 Feb, 2017, 12:09 

User rating: 0
Joined: Fri 31 May, 2013, 21:20
Posts: 14
Location: Syrian Arab RepublicSyrian Arab Republic
Hi

I have an expert which run on the remote server and at sometimes I need to read one or more variable from it

so is there a way to read variables from a running expert ?


 
 Post subject: Re: read from remote server Post rating: 0   New post Posted: Wed 08 Feb, 2017, 15:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
To send message from one instance to another do the following.
On remote server:
    public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
        if(instrument.equals(Instrument.EURUSD) && period.equals(Period.ONE_MIN)) {
            engine.broadcast("topic", "contents");
        }
    }


On local client:
    public void onMessage(IMessage message) throws JFException {
        console.getOut().println(message);
    }


 
 Post subject: Re: read from remote server Post rating: 0   New post Posted: Thu 09 Feb, 2017, 12:33 

User rating: 0
Joined: Fri 31 May, 2013, 21:20
Posts: 14
Location: Syrian Arab RepublicSyrian Arab Republic
ok, Thanks

I just searched and found that a broadcast messeage could be sent once every 1 second and when I run multiple strategy on the same Live account I will get at least 15 broadcast when a certain condition meet in less than a second, so will be there a problem even with live account ?, and if so How to get over it ?




 
 Post subject: Re: read from remote server Post rating: 0   New post Posted: Fri 10 Feb, 2017, 16:02 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, it will limit live account too.
Alternative could be to monitor order states with onMessage(IMessage) method.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com