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