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

Re: Why does this TrendLine function fails at times?



PureBytes Links

Trading Reference Links

Dear Ernie,

I had problems getting multiple prints as time went forward and was able to
solve that as follows (I'm using text here, but trendline works the same):

Var:    ID(-1),
            OldID(-1);

Value1 = [what I'm wanting to plot];

IF LastBarOnChart THEN BEGIN
 OldID = ID;
  IF OldID <> -1 THEN Value11 = Text_Delete(OldID);
  ID = Text_New(D,T+10,C,NumToStr(Value1,2));
 Text_SetStyle(ID,0,0);
 Text_SetColor(ID,8);
END;

Congratulations on your pig.

Sincerely,

Richard


Ernie Bonugli wrote:

> DH,
>
> Just got back from a hunting trip to North Texas.  Killed a
> wild pig!  Anyway, thanks for looking at my problem.  I had
> started out with the coding looking like what you suggested.
> Your suggestion makes since.
>
> But, with,
>
>     TL_Level_ID = TL_New( Date[1], time[1], Level, Date, Time, Level ) ;
>
> in place, I get a different problem.   That is, at times,  trendlines stay
> enabled and never get removed.
>
> This function is support to terminate the older TL and
> replace it with a newer support/resistence level.  With this
> version of code I get a "bunch" of old historicial lines
> continually extending to the right.  This problems is also erratic.
> That is, most of the time the lines do get terminated, but sometimes
> they linger.
>
> Is my assumption about functions incorrect?  I am assuming
> that each distinct call to a function, is such that each
> gets a unique variable storage area (possibly a stack) for the functions
> variables.
>
> Regards,
> Ernie
> ebonugli@xxxxxxxx