Code vertical lines on 3rd fridays
Posted: Nov 20 2015
To draw a vertical line on the 3rd friday of every month on an historical graph I have come up with the following code. Given MC calculates for ever, i believe i may have an infinite loop.
Thank you for your help
Code: Select all
while (count < 3) begin
if (month(date) = month(date[1])) and (dayofweek(date) = 5) and (count = 3) then
begin
thirdfriday = date;
print(thirdfriday);
TLID =
tl_new(thirdfriday,900,0,thirdfriday,900,low-100);
tl_SetColor(TLID, green);
tl_setstyle(TLID, 1);
count = 0;
// txtID = Text_New(thirdfriday, Time, low-50, text(thirdfriday));
end
else if ( (month(date) = month(date[1])) and (dayofweek(date) = 5) and (count < 3) ) then
count = (count + 1);
end;