Using a live strategy I am receiving news/calendar messages in the console display, for example:
2012-04-17 21:06:13.222 WARN CurvesJsonProtocolHandler - NewsStoryMessage received from history server, but none is waiting for it: {"news_id":"1994992","markets":[],"minit":false,"header":"DJ 1994992:INSERT","end":"true","content":{"event_details":[{"actual":"5","description":"Benchmark TPM Rate",
"previous":"5.0%","detail_id":"1"}],"isin":"","event_id":"1994992","description":"Banco Central de Chile Monetary Policy Meeting & interest rate announcement",
"event_code":"IEP","venue":"","confirmed":"true","company_url":"https://www.bcentral.cl/","action":"INSERT","period":"Apr",
"event_url":"https://www.bcentral.cl/","event_date":"1334620800000","country":"CHI","ticker":"","organization":"Banco Central de Chile"},"c":"2012,
Dow Jones & Company, Inc.","currs":[],"index":[],"news_src":"DJ_LIVE_CALENDAR","pub_date":"1334696640000","geo":["CL"],"type":"news_story","hot":"false"}This severely clutters the console output. Will adding similar code to the following remove these messages from the console:
NewsFilter newsFilter = new NewsFilter();
newsFilter.setTimeFrame(NewsFilter.TimeFrame.TODAY);
newsFilter.getKeywords().add("MARKET TALK");
_client.addNewsFilter(newsFilter);
CalendarFilter calendarFilter = new CalendarFilter();
calendarFilter.setType(INewsFilter.Type.IEP);
//filter keywords
calendarFilter.getKeywords().add("Treasury");
calendarFilter.getKeywords().add("GDP");
calendarFilter.getKeywords().add("trade");
_client.addNewsFilter(calendarFilter);
I'm not to sure what parameters to use with the filter either. Note: I'm checking for news and calendar messages in the strategy as well.