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

Why does this TrendLine function fails at times?



PureBytes Links

Trading Reference Links

list,

This function will draws a horizontal line starting at one
date,time,and level.  The trend line ends whenever a new level is
presented to the function.  The function then starts a new
horizontal line.  Works most of the time.  So from the
indicator code, I can place a call to this function at several distinct
places in the code and the result is that multiple parallel
lines are maintained.

But, why does it draw a vertical line at times?  I have noticed
this vertical lines more on 3 minute charts and I want to
say it happens more when there is sparse data ( ie ESZ02
overnite time) .  Seems to work better on 30 minute charts.

Why?


input: Level(numericsimple),plotcolor(numericsimple);;
var: LastLevel(9999);
var: TL_Level_ID(9999);
if Level<>LastLevel then begin
        if LastLevel <> 9999 then begin
                TL_SetExtRight( TL_Level_ID, false ) ;
                TL_SetEnd( TL_Level_ID, Date, Time, LastLevel ) ;
                LastLevel=9999;
                end;
        TL_Level_ID = TL_New( Date, time, Level, Date, Time, Level ) ;
        TL_SetColor( TL_Level_ID, plotcolor ) ;
        TL_SetExtLeft( TL_Level_ID, false ) ;
        TL_SetExtRight( TL_Level_ID, true ) ;
        LastLevel = Level;
        end;
TL= TL_Level_ID;



Regards,
Ernie
ebonugli@xxxxxxxx