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.

FeedListener with JFException
 Post subject: FeedListener with JFException Post rating: 0   New post Posted: Wed 15 Jan, 2014, 23:59 

User rating: 1
Joined: Thu 02 Jan, 2014, 19:06
Posts: 16
Location: ThailandThailand
Could you add "throws JFException" in the signature of https://www.dukascopy.com/client/javadoc/com/dukascopy/api/feed/IFeedListener.html

It would make Feeds easier to code
it's also hard to print the whole Exception in console
https://www.dukascopy.com/wiki/#Chart_feeds


 
 Post subject: Re: FeedListener with JFException Post rating: 0   New post Posted: Thu 16 Jan, 2014, 08:06 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
This is not possible, since it would make the existing strategies fail to compile.


 
 Post subject: Re: FeedListener with JFException Post rating: 0   New post Posted: Thu 16 Jan, 2014, 23:42 

User rating: 1
Joined: Thu 02 Jan, 2014, 19:06
Posts: 16
Location: ThailandThailand
just a suggestion from my experience

Except this annoying problem they are very flexible to use, allows ONE_SEC periods, and would be a good replacement of public void onBar(Instrument instrument, Period p, IBar a, IBar b) throws JFException


 
The Best Answer  Post subject: Re: FeedListener with JFException Post rating: 0   New post Posted: Fri 17 Jan, 2014, 09:25 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
If this is an issue to you then simply create another method with added the throws notation, e.g.:
public void myOnFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) throws JFException {
    //put all the logic here
}
   
@Override
public void onFeedData(IFeedDescriptor feedDescriptor, ITimedData feedData) {
    try {
        myOnFeedData(feedDescriptor, feedData);
    } catch (JFException e) {
        console.getErr().println(e);
        e.printStackTrace();
    }
}


 

Jump to:  

  © 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