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

Re: Code Help



PureBytes Links

Trading Reference Links

Hello Eric,

The following few lines, taking from my program, may give you a good
start, particularly if you use 3 min charts. This code use the same
trendline, but update it with new information.

-- Harrison
www.HarrisonProgramming.com

----------

Vars: TL_ID1(-1), TL_LastUpdateTime(0);
Vars: StartDate(0), StartTime(0), StartPrice(0), EndDate(0), EndTime(0),
EndPrice(0) ;

If (LastBarOnChart and Time <> TL_LastUpdateTime ) then begin

{ Define StartDate, StartTime, StartPrice, EndDate, EndTime, EndPrice here }

{Draw two horizontal lines around prior 5 bars, and extend to current bar}
If (TL_ID1 = -1) then begin
TL_ID1 = TL_New(StartDate, StartTime, StartPrice, EndDate, EndTime,
EndPrice);
end
else begin
Value1 = TL_SetBegin(TL_ID1, StartDate, StartTime, StartPrice);
Value2 = TL_SetEnd(TL_ID1, EndDate, EndTime, EndPrice);
End;
TL_LastUpdateTime = Time;

End;

----------


ericzhou wrote:

>Hi List,
>
>Need some help on coding:
>
>Draw a new TL every three mintues and delele the old TL.
>
>Appreciate any help.
>
>Eric
>
>
>
>  
>