Hello,
I have troubles getting the same values as the chart for the SAR
indicator when using the universal method with feed descriptors.
// This works :
print("SAR : "+ indicators.sar(Instrument.EURUSD, Period.ONE_MIN, OfferSide.BID, 0.02, 0.2, 0));
// This doesn't
FeedDescriptor feed = new FeedDescriptor();
feed.setPeriod(Period.ONE_MIN);
feed.setInstrument(Instrument.EURUSD);
feed.setDataType(DataType.TIME_PERIOD_AGGREGATION);
feed.setOfferSide(OfferSide.BID);
feed.setFilter(Filter.NO_FILTER);
Object[] output = indicators.calculateIndicator(feed,new OfferSide[]{feed.getOfferSide()}, "SAR", new AppliedPrice[] { null }, new Object[] { 0.02, 0.2 }, 0);
print("Sar feed : [0] " + output[0]);
output = indicators.calculateIndicator(feed,new OfferSide[]{feed.getOfferSide()}, "SAR", null, new Object[] { 0.02, 0.2 }, 0);
print("Sar feed : [1] " + output[0]);
output = indicators.calculateIndicator(feed,new OfferSide[]{feed.getOfferSide()}, "SAR", new AppliedPrice[] { AppliedPrice.CLOSE }, new Object[] { 0.02, 0.2 }, 0);
print("Sar feed : [2] " + output[0]);
I'm attaching a strategy with the different things I tried. Maybe you
could help me figure out what to do .. or is it a bug ?
Thanks and regards