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.

Broadcast messege
 Post subject: Broadcast messege Post rating: 0   New post Posted: Wed 31 Dec, 2014, 21:21 

User rating: 0
Joined: Sat 08 Dec, 2012, 12:32
Posts: 6
Location: United KingdomUnited Kingdom
Hi
I`m using this code to broadcast a message form my strategy

try {
this.engine.broadcast("New", "" + _Current);
}catch (Exception ex) {
ex.printStackTrace();
console.getErr().println("Error while broadcasting : " + ex);
}

and to receive it I use this

if (message instanceof IStrategyBroadcastMessage) {
IStrategyBroadcastMessage myMessage = (IStrategyBroadcastMessage)message;
}
but how to specify the topic of the current broadcast
should it be like this, if (myMessage = "New")


 
 Post subject: Re: Broadcast messege Post rating: 0   New post Posted: Fri 02 Jan, 2015, 10:22 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please consider the following code
IStrategyBroadcastMessage myMessage = (IStrategyBroadcastMessage)message;
if(myMessage.getTopic().equals("New")) {
               
}


 
 Post subject: Re: Broadcast messege Post rating: 0   New post Posted: Mon 05 Jan, 2015, 18:25 

User rating: 0
Joined: Sat 08 Dec, 2012, 12:32
Posts: 6
Location: United KingdomUnited Kingdom
Thanks
Is it possible to read previous broadcast ?


 
 Post subject: Re: Broadcast messege Post rating: 0   New post Posted: Wed 07 Jan, 2015, 12:27 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
No.


 

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