User rating: 0
Joined: Sun 04 Sep, 2016, 05:22 Posts: 5 Location: AustraliaAustralia
Hi support. I want to ask, when is going to be released the supertrend indicator on API ? At the moment is only available to use it on the charts but not to programming / development. Regards. Beto
int atrPeriod = 20; double multiplier = 1.7; int shift = 1; Object[] supertrendValue = indicators.calculateIndicator(Instrument.EURUSD, Period.ONE_HOUR, new OfferSide[]{OfferSide.ASK, OfferSide.ASK}, "SUPERTREND", new IIndicators.AppliedPrice[]{IIndicators.AppliedPrice.CLOSE}, new Object[]{atrPeriod, multiplier}, shift);
You can get the values of any indicator by directly specifying it's name.
Beto
Post subject: Re: Supertrend indicator on API
Post rating: 0
Posted: Fri 02 Nov, 2018, 00:58
User rating: 0
Joined: Sun 04 Sep, 2016, 05:22 Posts: 5 Location: AustraliaAustralia
Hello, please your feedback......
I am using the below code to get the values but I am getting an Exception. This is happening quite often. Some times the Exception say (value > Infinite or NaN) and did't present a value. Some times I am getting the correct values according to the settings.
Below part of the code:
public IFeedDescriptor Feed1 = new TickBarFeedDescriptor(Instrument.EURUSD, TickBarSize.valueOf(100),OfferSide.ASK); double superTrendValue = Double.NaN;
// OnBar>Method Object[] spValue = indicators.calculateIndicator(Feed1, new OfferSide[] { OfferSide.ASK, OfferSide.ASK }, "SUPERTREND", new AppliedPrice[] { AppliedPrice.CLOSE }, new Object[]{10, 5.0}, 1);
superTrendValue = (Double) spValue[0];
// result
--- superTrendValue = NaN // most of the time I am getting this value --- superTrendValue = 1.403 // sometimes I got the correct one.