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.

How to print remote data
 Post subject: How to print remote data Post rating: 0   New post Posted: Mon 28 Oct, 2013, 16:43 

User rating: 0
Joined: Thu 29 Aug, 2013, 01:01
Posts: 21
Location: ChinaChina
Management, hello!
I wrote a strategy,it runs on a remote service, excuse me, if I want to monitoring a some data and Prints data to the client?


 
 Post subject: Re: How to print remote data Post rating: 0   New post Posted: Mon 28 Oct, 2013, 16:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
See Portfolio -> Strategy Log. Remote strategies can not log to the console of your local machine.


 
 Post subject: Re: How to print remote data Post rating: 2   New post Posted: Mon 28 Oct, 2013, 21:12 
User avatar

User rating: 98
Joined: Mon 23 Jul, 2012, 02:02
Posts: 656
Location: United States, Durham, NC
Your Remote Strategy must use IEngine.broadcast(String, String).

All Strategy instances currently logged into your Account will receive
this in onMessage. It is best if you have some "tagging convention"
so that your special messages are recognized as originating from
a specific Remote Strategy instance. That's up to you.

   final public void onMessage(final IMessage message) throws JFException {
      if (message instanceof IStrategyBroadcastMessage) {
         IStrategyBroadcastMessage myMessage = (IStrategyBroadcastMessage)message;
         // handle topic and/or content of myMessage any way you wish
      }
   }


All other instances will receive the message broadcast by any given
Strategy instance, almost instantly. But only 1 per second maximum
messaging rate.

You must then write another strategy running locally which will trap
and print those broadcast messages to the local Strategy Log console
as they appear in the onMessage callback.

This method works on both Demo and Live Remote Server, but only within
the same Account login for all Strategy instances. All Strategies in the SAME
Account will receive these broadcast messages almost instantaneously.

One thing: You must not use IEngine.broadcast(...) more frequently than
1 second between successive broadcasts or you will receive an exception.
Your String content can be anything you wish. There are restrictions on
maximum sizes.

viewtopic.php?f=96&t=49992

"Broadcast topic max length:100 symbols.
Broadcast message max length: 1000 symbols.
Broadcast message sending min interval: 1000 milliseconds.

We cannot change a broadcast min interval because of a possible overload of our trading servers."

HyperScalper


 
 Post subject: Re: How to print remote data Post rating: 0   New post Posted: Tue 29 Oct, 2013, 20:41 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Good job, hyperscalper! I myself not using Remote Strategies, but this is very useful.
@Support:
Could you consider to make a wiki page about the subject? I think that would be a good idea.


 

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