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. :/