Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

API RSI not the same as the visual plotting indicator
 Post subject: API RSI not the same as the visual plotting indicator Post rating: 0   New post Posted: Fri 19 Apr, 2019, 21:56 

User rating: 0
Joined: Thu 02 Nov, 2017, 20:06
Posts: 2
Hello,

The RSI-Indikator which is plotting visual in the chart has not the same value as the rsi which I get through the API back.

I tried different things. With Filter or without. ASK or BID. But the results are always different.

IFeedDescriptor feedDescriptor = new TimePeriodAggregationFeedDescriptor(
Instrument.EURUSD,
Period.DAILY,
OfferSide.BID,
Filter.WEEKEND);
rsi = sb.getIndicators().rsi(feedDescriptor, AppliedPrice.CLOSE,OfferSide.BID, timePeriod).calculate(0);

Can someone help?

Artur


 
 Post subject: Re: API RSI not the same as the visual plotting indicator Post rating: 0   New post Posted: Thu 16 May, 2019, 15:01 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,

There was a little issue with unstable-period indicator calculation. Problem will be fixed in next JForex version.

Also note, that indicator calculation with shift doesn't use filters in calculation process, even if you intentionally specify them. For this case it's better to use another method.
long curBarTime = history.getStartTimeOfCurrentBar(feedDescriptor.getInstrument(), feedDescriptor.getPeriod());        

Object[] rsi = indicators.calculateIndicator(
                feedDescriptor,
                new OfferSide[] {OfferSide.BID},
                Period.WEEKLY,
                "RSI",
                new IIndicators.AppliedPrice[] {IIndicators.AppliedPrice.CLOSE},
                new Object[] {14},
                2, curBarTime, 0
        );


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com