Highest High

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Guest

Highest High

Postby Guest » 15 Dec 2006

I'm trying to label and retrieve the highest high over a counted area then label it with an arrow. I start the count with condition1 then label it once condition2 is met. The issue I have is that sometimes the highest high occurs before conditon2 is met. I want to label that highest high once contion2 is meet, however, it sometimes requires moving the arrow back. Here is my attempt at doing this, however, it's not working. If anyone could help that would be great.

if Condition1 then begin
counter=counter+1;
if condition2 and condition3 then begin
MyArray[0]=MyArray[1];
MyArray[1]=MyArray[2];
MyArray[2]=highest(high,counter);
id = arw_new(d,t,MyArray[2],true);
arw_setcolor(id,yellow);
arw_setstyle(id, ArrowStyle);
arw_setsize(id, ArrowSize);
arw_settextcolor(id, ArrowTextColor);
arw_settext(id, "PF");
end;
end;

Chris
Posts: 150
Joined: 17 Nov 2005

Postby Chris » 16 Dec 2006

You need the correct date and time when your High occured, so something like this should do the job:

Code: Select all


variables:
id(0),
HighPrice(0),
HighDate(0),
HighTime(0);

if Condition1 then begin

If High >= HighPrice then begin
HighPrice = High;
HighDate = Date;
HighTime = Time;
end;

if condition2 and condition3 then begin

id = arw_new(HighDate,HighTime,HighPrice,true);
arw_setcolor(id,yellow);
arw_setstyle(id, ArrowStyle);
arw_setsize(id, ArrowSize);
arw_settextcolor(id, ArrowTextColor);
arw_settext(id, "PF");

HighPrice = 0;
end;
end;



If you need further help in getting this to work, you can contact me through PM.

Chris


Return to “User Contributed Studies and Indicator Library”