Vertical Autoscale system of IIndicatorChartPanel is something weird at one pattern value.
e.g.
When the indicator value has 2 pattern values(50 & 100), that value shows up on indicator panel.
But, when the indicator value has only 1 pattern values(All 50), that value didn't shows up on indicator panel.
Sample IIndicator is as below,
package jforex;
import com.dukascopy.api.indicators.*;
public class SampleIIndi implements IIndicator {
private IndicatorInfo indicatorInfo;
private InputParameterInfo[] inputParameterInfos;
private OptInputParameterInfo[] optInputParameterInfos;
private OutputParameterInfo[] outputParameterInfos;
private double[][][] inputs = new double[1][][];
private int p = 1;
private double[][] outputs = new double[1][];
public void onStart(IIndicatorContext context) {
indicatorInfo = new IndicatorInfo("Sample", "Sample IIndicators", "My indicators",
false, false, false, 1, 1, 1);
inputParameterInfos = new InputParameterInfo[] {new InputParameterInfo("Input data", InputParameterInfo.Type.PRICE)};
final int ONE_PATTERN = 0, TWO_PATTERN = 1;
optInputParameterInfos = new OptInputParameterInfo[] {
new OptInputParameterInfo("Pattern", OptInputParameterInfo.Type.OTHER, new IntegerListDescription(TWO_PATTERN , new int[]{TWO_PATTERN, ONE_PATTERN}, new String[]{"50 & 100", "All 50"})),
};
outputParameterInfos = new OutputParameterInfo[] {new OutputParameterInfo("out", OutputParameterInfo.Type.DOUBLE,
OutputParameterInfo.DrawingStyle.LINE)};
}
public IndicatorResult calculate(int startIndex, int endIndex) {
//calculating startIndex taking into account lookback value
if (startIndex - getLookback() < 0) {
startIndex -= startIndex - getLookback();
}
int i, j;
final double[] VALUES = {50,100};
for (i = startIndex, j = 0; i <= endIndex; i++, j++) {
outputs[0][j] = VALUES[(i & p)];
}
return new IndicatorResult(startIndex, j);
}
public IndicatorInfo getIndicatorInfo() {
return indicatorInfo;
}
public InputParameterInfo getInputParameterInfo(int index) {
if (index <= inputParameterInfos.length) {
return inputParameterInfos[index];
}
return null;
}
public int getLookback() {
return 0;
}
public int getLookforward() {
return 0;
}
public OptInputParameterInfo getOptInputParameterInfo(int index) {
if (index < optInputParameterInfos.length) {
return optInputParameterInfos[index];
}
return null;
}
public OutputParameterInfo getOutputParameterInfo(int index) {
if (index < outputParameterInfos.length) {
return outputParameterInfos[index];
}
return null;
}
public void setInputParameter(int index, Object array) {
inputs[index] = (double[][]) array;
}
public void setOptInputParameter(int index, Object value) {
p = (Integer) value;
}
public void setOutputParameter(int index, Object array) {
outputs[index] = (double[]) array;
}
}
best regards