Java SDK subscribe for Chart Candles fails

5 posts / 0 new
Last post
Java SDK subscribe for Chart Candles fails


I'm using Java SDK 2 and try to call the subscribeForChartCandles Method:
listeners.add(lightStreamerComponent.subscribeForChartCandles("CS.D.EURUSD.MINI.IP","SECOND",adapter ));

But I always get the error:
com.lightstreamer.ls_client.PushUserException: Mode MERGE is not supported for item CHARTS|IX.D.DAX.IFMM.IP|IX.D.DAX.IFMM.IP|DISTINCT|false|1

I found some suspicious things in this method, some fields appears twice like LTV, DAY_OPEN_MID or UTM and some fields are not specified in the docs like: CANDLE_START and CANDLE_TICK_COUNT.
But this seem not to be the problem.

I dont know why the error string says something about "DISTINCT" because it is "MERGE". The SDK and docs says it sould be "MERGE".

Has anyone a runnig application with this method? Or does anyone know whats the problem in this case? Thank you ;)

Re: Java SDK subscribe for Chart Candles fails

Hey mrmoor

It does appear that the Java sample is out of sync with Lightstreamer. CANDLE_START and CANDLE_TICK_COUNT look like they need to be replaced with CONS_END and CONS_TICK_COUNT respectively. There is also an extra field that can be subscribed to DAY_LOW.

We're going to set some time aside to fix the Java sample.


Thanky you so much! :)

Thanky you so much! :)


If anyone needs it, this is the fully functional and updated method:

public HandyTableListenerAdapter subscribeForChartCandles(String epic,String scale, HandyTableListenerAdapter adapter) throws Exception {

String subscriptionKey = CHART_CANDLE_PATTERN.replace("{epic}", epic);
subscriptionKey = subscriptionKey.replace("{scale}", scale);

ExtendedTableInfo extendedTableInfo = new ExtendedTableInfo(
new String[]{subscriptionKey}, "MERGE", new String[]{"LTV",
"CONS_TICK_COUNT"}, true);

final SubscribedTableKey subscribedTableKey = lsClient.subscribeTable(extendedTableInfo, adapter, false);
return adapter;


Thanks for posting this mrmoor!


Log in or register to post comments