[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new highs for xn periods ?



PureBytes Links

Trading Reference Links



Hi TJ sometime ago you shared this search with us for an all 
time high ..
can it be modified to find a stock that is setting a new high 
for a set period ?
lets say we want stocks that have set a new high for 150 
days  changing the range periods doesn't find stocks that are setting new 
highs for xn periods 
 
Thanks David
alltimehigh = LastValue<FONT 
size=1>( Highest( 
High ) );
alltimehighbar = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Cum(1<FONT 
size=1>) );
alltimeyear = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Year() );
alltimemonth = ValueWhen<FONT 
size=1>( High == alltimehigh, <FONT color=#0000ff 
size=1>Month() );
alltimeday = ValueWhen( 
High == alltimehigh, Day<FONT 
size=1>() );
"All time highest was " + <FONT color=#0000ff 
size=1>WriteVal( alltimehigh );<FONT 
color=#ff00ff size=1>
"on the " + <FONT color=#0000ff 
size=1>WriteVal( alltimeyear, <FONT color=#ff00ff 
size=1>1 ) + <FONT color=#ff00ff 
size=1>"." + <FONT color=#0000ff 
size=1>WriteVal( alltimemonth, <FONT color=#ff00ff 
size=1>1 ) + <FONT color=#ff00ff 
size=1>"." + <FONT color=#0000ff 
size=1>WriteVal( alltimeday, <FONT color=#ff00ff 
size=1>1 );
/* Draw also a buy arrow on highest day */
cond1 = High == alltimehigh ;