changing the startingindex of a passing array

Questions about MultiCharts and user contributed studies.
User avatar
siscop
Posts: 197
Joined: 09 Jan 2011
Has thanked: 34 times
Been thanked: 29 times

changing the startingindex of a passing array

Postby siscop » 03 Oct 2015

Code: Select all

//Function _fRateOfChangeArray
Inputs:
C2[MaxSize](numericarray),
Len(numericsimple);
Function calling the function

Code: Select all


For counter=0 to Ma1+1
Begin
RocArray[counter]=_fRateOfChangeArray(PriceArray[counter],Roc1Len); // bad code (PriceArray[counter]) in this line.
End;
//It expects an array and not a single value.
The problem is that passing array PriceArray[counter]. The function is expecting an array but getting a single value.
What I am trying to do is to change the starting index of the given array.
It should start with position counter and not with “0”.
So RocArray[0] should get the _fRateOfChangeArray which starts from index “0”.
RocArray[10] should get the _fRateOfChangeArray which starts from index ”10” – the function itself will consider the index “10” as the starting index and will continue from there.

Does someone has an idea how to change the starting index of an passing array?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: changing the startingindex of a passing array

Postby Henry MultiСharts » 07 Oct 2015

Hello siscop,

Please adjust the code the following way:

Code: Select all

For counter=0 to Ma1+1
Begin
RocArray[counter]=_fRateOfChangeArray(PriceArray,Roc1Len);
End;


Return to “MultiCharts”