afl code - highest and second highest close between two dates

#3
raj_jain you are trying to steal someone else's thread (your post has NOTHING to do with the title of this thread) and you are posting the exact same request on multiple threads! Stop being so selfish and inconsiderate.
 
#5
// Try this. Works on finding highest highs between the dates you choose in the Analysis "to" and "from" dates
// Status("barinrange") - returns 1 when current bar is within current auto-analysis From-To range

Period = EndValue( Cum( Status( "barinrange" ) ) ); // LastValue gives a number instead of an array, needed in Percentile function

function NthHV( array, period, nth )
{
return Percentile( array, period, ( period - nth ) / ( period - 1 ) * 100 );
}

HighestValue = HHV( H, Period );
SecondHighest = NthHV( H, period, 2 );
 
Last edited:

trash

Well-Known Member
#6
// Try this. Works on finding highest highs between the dates you choose in the Analysis "to" and "from" dates
// Status("barinrange") - returns 1 when current bar is within current auto-analysis From-To range

Period = EndValue( Cum( Status( "barinrange" ) ) ); // LastValue gives a number instead of an array, needed in Percentile function

function NthHV( array, period, nth )
{
return Percentile( array, period, ( period - nth ) / ( period - 1 ) * 100 );
}

HighestValue = HHV( H, Period );
SecondHighest = NthHV( H, period, 2 );
It is not you who came up with that. So what we have here is another guy trying to adorn himself with borrowed plumes.
 
#7
dear trash,
i don't know why are you so possessive. there is a idioms " khali hath aye the ,khali hath jana hai".
you better understand what i mean.
 
#8
Dear AmiFan,
I really appreciate your effort, i think this will work for me, let me check on ami and get back to you,
thanks for your help,
 
#9
It is not you who came up with that. So what we have here is another guy trying to adorn himself with borrowed plumes.
I didn't say that I came up with it, I just listed it as a possible solution to the question to help garry_gc

I would usually just post a link to something but in this case I made a small change to the code to answer the poster's question since the original link wasn't exactly what I thought he asked for. If you had wanted to help that's great, but the question had been waiting for weeks. And you made no effort to help.

If you post code on Internet then you should expect it to get used. If you don't like it then stop posting code on Internet. :yuck:
 
Last edited:

Similar threads

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?