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.

Mistake in wiki regarding Indicator API?
 Post subject: Mistake in wiki regarding Indicator API? Post rating: 0   New post Posted: Wed 30 Sep, 2015, 16:51 

User rating: 0
Joined: Fri 04 Apr, 2014, 16:35
Posts: 50
Location: Monaco, Monte-Carlo
Hi support,

I was reading back through the Wiki and I think I have found a mistake:
Under "Method Calculate" in the "IIndicator Interface" page of the wiki https://www.dukascopy.com/wiki/#IIndicator_interface it says:

"If there is input array with 30 elements and calculate method is called for SMA indicator with ''startIndex'' 0 and ''endIndex'' 29, then if there is time period of 20, indicator will have ''firstValueIndex'' 20 and ''lastValueIndex 29."

Given that arrays start at 0 and not at 1, surely a 20 period SMA indicator would have a "firstValueIndex" of 19, rather than 20? (since 0,1,2,.....18,19 is 20 data points)

Please can you clarify?


 
 Post subject: Re: Mistake in wiki regarding Indicator API? Post rating: 0   New post Posted: Fri 02 Oct, 2015, 13:05 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Yes, firstValueIndex should be 19


 

Jump to:  

cron
  © 1998-2025 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