Function for finding the 'N'th highest price in M days

Questions about MultiCharts and user contributed studies.
steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Function for finding the 'N'th highest price in M days

Postby steven » 17 Oct 2010

Hi, Is there any function for finding the 'N'th highest price in M days?

Steven

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

Re: Function for finding the 'N'th highest price in M days

Postby TJ » 17 Oct 2010

Hi, Is there any function for finding the 'N'th highest price in M days?

Steven

can you post a diagram to illustrate?

steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Re: Function for finding the 'N'th highest price in M days

Postby steven » 17 Oct 2010

Hi TJ,

For example, we have a function named highest(c, n) which will show the highest close of N bars, My question is: have we had another function which will show the second highest close of N bars, like highest2(c,n,2).

Steven

User avatar
CrazyNasdaq
Posts: 321
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 98 times
Been thanked: 89 times

Re: Function for finding the 'N'th highest price in M days

Postby CrazyNasdaq » 18 Oct 2010

Hi TJ,

For example, we have a function named highest(c, n) which will show the highest close of N bars, My question is: have we had another function which will show the second highest close of N bars, like highest2(c,n,2).

Steven
Hi Steven,

You have to create an array with N Highest close and then sort them to have the second N highest close. In this way you can have all the N highest close from the first to the last, ordered and you can retrive them. You can do this with all the quotes you need, close, high, low, volume, range and so on.

steven
Posts: 37
Joined: 07 Jun 2010
Location: china
Has thanked: 2 times

Re: Function for finding the 'N'th highest price in M days

Postby steven » 18 Oct 2010

Got it, Thanks CrazyNasdaq and TJ.

Steve

User avatar
CrazyNasdaq
Posts: 321
Joined: 02 Sep 2009
Location: ITALY
Has thanked: 98 times
Been thanked: 89 times

Re: Function for finding the 'N'th highest price in M days

Postby CrazyNasdaq » 18 Oct 2010

Got it, Thanks CrazyNasdaq and TJ.

Steve
You are welcome Steve.


Return to “MultiCharts”