Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

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

News Filtering not working
 Post subject: News Filtering not working Post rating: 0   New post Posted: Tue 26 Apr, 2016, 17:33 

User rating: 0
Joined: Tue 19 Apr, 2016, 19:19
Posts: 6
Location: HungaryHungary
I have tried your examples: https://www.dukascopy.com/wiki/#Trade_on_news and https://www.dukascopy.com/wiki/#IClient_functionality/News_and_Calendar (NewsFilterMain.java and NewsStrategyNoTrades.java)

My observations:
  • metaInfo (Stock Indicies, Regions, Market sectors, Currencies): always empty
  • endOfStory: always false
  • hot: always false
  • getCurrencies() always return 0 element
  • getStockIndicies().add(…) ineffective
  • getCountries().add(…) ineffective
  • getMarketSectors().add(…) ineffective
  • getEventCategories().add(…) ineffective

Only the keyword filtering successful!


 
 Post subject: Re: News Filtering not working Post rating: 0   New post Posted: Wed 27 Apr, 2016, 14:15 
User avatar

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

We would like to inform you, that both codes (both are taken from WIKI articles) were successfully compiled and executed.
At this point , we assume that something didnt work properly from your side. Please make sure, that you didn't forgot to specify username / password or else.

Feel free to ask questions

Good luck and have a nice day


 
 Post subject: Re: News Filtering not working Post rating: 0   New post Posted: Wed 27 Apr, 2016, 16:24 

User rating: 0
Joined: Tue 19 Apr, 2016, 19:19
Posts: 6
Location: HungaryHungary
Hi,
You did not understand me.
The example codes are compilable. It is true.
But they do not working as they should.
The FILTERING does not work!!!

In the NewsFilterMain.java, if you comment out the "keywords", you get all news without any filtering!
NewsFilter newsFilter = new NewsFilter();
newsFilter.setTimeFrame(NewsFilter.TimeFrame.TODAY);

//filter indicies
newsFilter.getStockIndicies().add(INewsFilter.StockIndex.NYSE);
newsFilter.getStockIndicies().add(INewsFilter.StockIndex.DJI);

//filter countries and regions
newsFilter.getCountries().add(INewsFilter.Country.US);
newsFilter.getCountries().add(INewsFilter.Country.FR);

//filter market sectors
newsFilter.getMarketSectors().add(INewsFilter.MarketSector.FCL);
newsFilter.getMarketSectors().add(INewsFilter.MarketSector.ENE);

//filter keywords
//newsFilter.getKeywords().add("Profit");
//newsFilter.getKeywords().add("Loss");

client.addNewsFilter(newsFilter);


In the https://www.dukascopy.com/wiki/#IClient_functionality/News_and_Calendar example, news.getCurrencies() always return empty set:
if (message.getType().equals(IMessage.Type.NEWS)) {
    Set<String> currencies = news.getCurrencies();
    for (String currency: currencies) {
      if (currency.equals("EUR")) {
          engine.submitOrder(getLabel(Instrument.EURUSD), Instrument.EURUSD, OrderCommand.BUY , 0.01);
      }
    }
}


Furthermore I have turned on the API trace log:

    BinaryProtocolFilter - [DDS2 Standalone Transport Client] Decoded message [<NewsStoryMessage(newsSource=FXSPIDER_NEWS,newsId=4617669523023936177,publishDate=1461766920000,header= IBM Expands Flash Storage Solutions to Target New, Intelligent Apps in the Cloud,hot=false,geoRegions=[],marketSectors=[],currencies=[],indicies=[],endOfStory=false,categories=[],sources=[],resources=[],originalStoryUrl=[HREF=https://us.rd.yahoo.com/finance/external/noodlsaunz/rss/SIG=128rnsogg/*https://www.publicnow.com/view/76C16542B2DA632C657C1094D12A4B8E2B3E5B01]Read full story[/HREF],dukascopyStoryUrl=[HREF=https://www.dukascopy.com/fxspider/en/m/4617669523023936177?utm_campaign=platform&utm_medium=platform&utm_source=market_news]Read full story[/HREF],language=en,timestamp=1461766952934)>]

Like in this, the metadatas are always empty. :/


 

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