Ranking Rate of Change Data1 .. Data30

Questions about MultiCharts and user contributed studies.
wullenweber helmut
Posts: 60
Joined: 21 Dec 2007
Has thanked: 3 times
Been thanked: 9 times

Ranking Rate of Change Data1 .. Data30

Postby wullenweber helmut » 07 Mar 2017

I would like to create an indicator that shows the development of the performance rank from one stock relative to other stocks over the time.

First step: calculate the RateofChange from data 1, data2 ...data30.

H1= RateOfChange (cloce data1,Lookback);
H2= RateOfChange (close data2,Lookback);
H30= RateOfChange (close data30,Lookback);

Which algo returns the NumericRank of H1, H2 ... H30 for each bar in the chart?
Last edited by wullenweber helmut on 08 Mar 2017, edited 1 time in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Ranking Data1 .. Data30

Postby TJ » 07 Mar 2017

Look up

NthMaxList

wullenweber helmut
Posts: 60
Joined: 21 Dec 2007
Has thanked: 3 times
Been thanked: 9 times

Re: Ranking Data1 .. Data30

Postby wullenweber helmut » 07 Mar 2017

This is my attemp, but unfortunately it does not work

Code: Select all

Array: UpArray[37](0), DnArray[37](0);
var: counter(0);
var: RH1(0),RH2(0),RH3(0),RH4(0),RH5(0),RH6(0),RH7(0),RH8(0),RH9(0),RH10(0),
RH11(0),RH12(0),RH13(0),RH14(0),RH15(0),RH16(0),RH17(0),RH18(0),RH19(0),RH20(0),
RH21(0),RH22(0),RH23(0),RH24(0),RH25(0),RH26(0),RH27(0),RH28(0),RH29(0),RH30(0),
RH31(0),RH32(0),RH33(0),RH34(0),RH35(0),RH36(0),RH37(0),RH38(0),RH39(0),RH40(0),
RH41(0),RH42(0),RH43(0),RH44(0),RH45(0),RH46(0),RH47(0),RH48(0),RH49(0),RH50(0),RH51(0);


//Fill array with ROCs Data 2 to Data 37
for counter = 2 to 37
begin
UpArray[counter] = RateOfChange(close,lookback) data(counter);
end;

RH23 = NumericRankArray(23,UpArray,36,1);

if RH23 > 0 then plot1 (RH23,"ROC Rank Data23",blue);

User avatar
bensat
Posts: 331
Joined: 04 Oct 2014
Has thanked: 46 times
Been thanked: 104 times

Re: Ranking Data1 .. Data30

Postby bensat » 07 Mar 2017

This is my attemp, but unfortunately it does not work

Code: Select all

Array: UpArray[37](0), DnArray[37](0);
var: counter(0);
var: RH1(0),RH2(0),RH3(0),RH4(0),RH5(0),RH6(0),RH7(0),RH8(0),RH9(0),RH10(0),
RH11(0),RH12(0),RH13(0),RH14(0),RH15(0),RH16(0),RH17(0),RH18(0),RH19(0),RH20(0),
RH21(0),RH22(0),RH23(0),RH24(0),RH25(0),RH26(0),RH27(0),RH28(0),RH29(0),RH30(0),
RH31(0),RH32(0),RH33(0),RH34(0),RH35(0),RH36(0),RH37(0),RH38(0),RH39(0),RH40(0),
RH41(0),RH42(0),RH43(0),RH44(0),RH45(0),RH46(0),RH47(0),RH48(0),RH49(0),RH50(0),RH51(0);


//Fill array with ROCs Data 2 to Data 37
for counter = 2 to 37
begin
UpArray[counter] = RateOfChange(close,lookback) data(counter);
end;

RH23 = NumericRankArray(23,UpArray,36,1);

if RH23 > 0 then plot1 (RH23,"ROC Rank Data23",blue);
Try to change it into ....

Code: Select all

RH23 = SortArray(UpArray, 36, 1);
Regards

Ben

wullenweber helmut
Posts: 60
Joined: 21 Dec 2007
Has thanked: 3 times
Been thanked: 9 times

Re: Ranking Data1 .. Data30

Postby wullenweber helmut » 08 Mar 2017

@Ben

The Output of

RH23 = SortArray(UpArray, 36, 1);

is +1 over all bars.


Return to “MultiCharts”