See:
https://www.dukascopy.com/wiki/index.php ... s_on_chartConsider the following example of formatting and output value options for MAX indicator:
package jforex.strategies.indicators;
import java.awt.Color;
import com.dukascopy.api.*;
import com.dukascopy.api.indicators.IIndicator;
import com.dukascopy.api.indicators.OutputParameterInfo.DrawingStyle;
public class AddIndicatorToChart3 implements IStrategy {
private IIndicators indicators;
private IChart chart;
public void onStart(IContext context) throws JFException {
this.indicators = context.getIndicators();
this.chart = context.getChart(Instrument.EURUSD);
//MAX with default input AND default formatting AND custom output
IIndicator max = indicators.getIndicator("MAX");
for (int i = 0; i < max.getIndicatorInfo().getNumberOfOutputs(); i++) {
max.getOutputParameterInfo(i).setShowValueOnChart(false); //don't show value on chart
}
chart.addIndicator(max);
//MAX with customized input AND default formatting
chart.addIndicator(indicators.getIndicator("MAX"), new Object[]{10});
//MAX with customized input AND customized formatting
chart.addIndicator(indicators.getIndicator("MAX"), new Object[]{10}, new Color[]{Color.ORANGE},
new DrawingStyle[]{DrawingStyle.DASHDOT_LINE}, new int[]{5});
}
public void onAccount(IAccount account) throws JFException { }
public void onMessage(IMessage message) throws JFException { }
public void onStop() throws JFException { }
public void onTick(Instrument instrument, ITick tick) throws JFException { }
public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException { }
}