hello support,
i use in my strategy a converted indicator.
i define it like this :
@Configurable("lsma")
public File jfxFile = new File("/home/eric/JForex/Indicators/iGentorLSMAEMA_v1102.jfx");
indName = indicators.registerCustomIndicator(jfxFile);
IIndicator indicator = indicators.getIndicator(indName);
double[][] lsma = calculateIndicatorDouble("indName",feedDescr, appliedPrice, optInputs, 2,bar.getTime(), 0);
private double[] calculateIndicatorDouble(String indicatorName, FeedDescriptor feedDescr, AppliedPrice appliedPrice, Object[] optInputs, int shift) throws JFException {
IBar bar = getBar(feedDescr, 0);
double[][] result = calculateIndicatorDouble(indName, feedDescr, appliedPrice, optInputs, shift + 1, bar.getTime(), 0);
return result[0];
}
private double[][] calculateIndicatorDouble(String indicatorName, FeedDescriptor feedDescr, AppliedPrice appliedPrice, Object[] optInputs, int candlesBefore, long time, int candlesAfter) throws JFException {
IndicatorInfo info = indicators.getIndicator(indName).getIndicatorInfo();
int inputCount = info.getNumberOfInputs();
int additionlBarCount = 0;
int minBarCount = 1000;
if(info.isRecalculateAll() || info.isUnstablePeriod()) {
additionlBarCount = minBarCount - (candlesBefore + candlesAfter);
if(additionlBarCount < 0) {
additionlBarCount = 0;
}
}
OfferSide[] offerSides = new OfferSide[inputCount];
AppliedPrice[] appliedPrices = new AppliedPrice[inputCount];
for(int i = 0; i < inputCount; i++) {
offerSides[i] = feedDescr.getOfferSide();
appliedPrices[i] = appliedPrice;
}
Object[] result = indicators.calculateIndicator(feedDescr, offerSides, indName, appliedPrices, optInputs, additionlBarCount + candlesBefore, time, candlesAfter);
double[][] newResult = new double[candlesBefore + candlesAfter][result.length];
for(int i = 0; i < result.length; i++) {
double[] values = (double[])result[i];
for(int j = 0; j < candlesBefore + candlesAfter; j++) {
newResult[j][i] = values[j + additionlBarCount];
}
}
return newResult;
}
that's good and it work well. but i want to use this indicator on custom period. for example my signal is on 15 minutes timeframe but depends of my indicator on 4h timeframe.
how to chance the calculation timeframe for the indicator?
thank and sorry for my english