HELP: refer to the date of highest value

#1
<Part of the code>
X = IIf(BarsSince(up) < BarsSince(dn), BarsSince(up), IIf(BarsSince(up) > BarsSince(dn), BarsSince(dn)*-1, 0));

AddColumn(HHV(X,20),"Since 20 Days Highest count");

Can I add a column knowing the date of the results? i.e 4/2/2013, with count 49.

 

KelvinHand

Well-Known Member
#2
<Part of the code>
X = IIf(BarsSince(up) < BarsSince(dn), BarsSince(up), IIf(BarsSince(up) > BarsSince(dn), BarsSince(dn)*-1, 0));

AddColumn(HHV(X,20),"Since 20 Days Highest count");

Can I add a column knowing the date of the results? i.e 4/2/2013, with count 49.

You already added the DateTime column shown . why added again.

Column 5 shown your listed example.
 
#5
let me clarify:

say 8/2/2013, i would like to know over 20 past trading day, what is the highest price
HHV (C, 20), so i will get the price. But I would like to know the date of the highest price over 20 days as at today.

E.g.
Date, Today Close, Highest Price over 20 Days, Date of highest price
8/2/2013 3.4 3.5 2/2/2013
7/2/2013 3.3 3.5 2/2/2013
6/2/2013 3.2 3.6 18/1/2013
 

sr114

Well-Known Member
#8
let me clarify:

say 8/2/2013, i would like to know over 20 past trading day, what is the highest price
HHV (C, 20), so i will get the price. But I would like to know the date of the highest price over 20 days as at today.

E.g.
Date, Today Close, Highest Price over 20 Days, Date of highest price
8/2/2013 3.4 3.5 2/2/2013
7/2/2013 3.3 3.5 2/2/2013
6/2/2013 3.2 3.6 18/1/2013
FM

try this

AddColumn(Ref(BarsSince(HHV(H,20)), -1) + 1, "Prev Hi # Bars",1.0);
AddColumn( Ref( DateTime(), -(Ref(BarsSince(HHV(H,20)), -1) + 1) ) , " on Date ", formatDateTime );
AddColumn( Ref( H, -(Ref(BarsSince(HHV(H,20)), -1) + 1) ) , "@ Hi" );


this will find the day on which the highest value of 20 periods along with the bar nos and the high value occurred.

rgds
subroto
 
Last edited:
#9
FM

try this

AddColumn(Ref(BarsSince(HHV(H,20)), -1) + 1, "Prev Hi # Bars",1.0);
AddColumn( Ref( DateTime(), -(Ref(BarsSince(HHV(H,20)), -1) + 1) ) , " on Date ", formatDateTime );
AddColumn( Ref( H, -(Ref(BarsSince(HHV(H,20)), -1) + 1) ) , "@ Hi" );


this will find the day on which the highest value of 20 periods along with the bar nos and the high value occurred.

rgds
subroto
this will only locate the previous date, regardless of highest over the past 20 days. Please help see see. thanks
 

sr114

Well-Known Member
#10
this will only locate the previous date, regardless of highest over the past 20 days. Please help see see. thanks
this exploration will show the last occurrence of the highest high of 20 pds along with the date and the value. i think u need this. if not then can u specify the exact condition u r looking - specify the exact condition with a valid example like that of nifty of any stock making 20 pds high in last one and half months. then it will be easier to understand

rgds
subroto

p.s

i use this same code piece to get the last occurrence of highest high
 

Similar threads