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

Re: Code Help



PureBytes Links

Trading Reference Links

Hello Eric,

You don't need to delete the existing trendlines. Just update them to
the new positions. (see Chris' suggestion and my prior message/code to you).

> anybody knows how to code high/low of previous trading session's last
> two hours' trading.

A lot of people in omega list know how to do that. There are different
ways too. One simple way is to insert 60-min bars as Data2, and find the
high and low of the two last 60-min bars of the prior trading day. Use
proper chart settings such the the last two 60-min bars cover the last
two hours. You can hide Data2 plot if you don't need to look at. The
following few lines may get you STARTED. Please note that these lines
are not tested.

Vars: HighPDLast2hr(0), {The High of prior day's last 2 hr)
LowPDLast2hr(0) ; {The Low of prior day's last 2 hr)

if Date Data2 <> Date[1] Data2 then begin
HighPDLast2hr = MaxList(High[1] Data2, High[2] Data2) ;
LowPDLast2hr = MinList(Low[1] Data2, Low[2] Data2) ;
end ;

There are several books out there on EasyLanguage. You can learn more EL
by studying them. Or, you can hire a EL programmer to help you.

-- Harrison
www.HarrisonProgramming.com


ericzhou wrote:

>I'm still struggling with the code.
>What I'm going to do it to plot three mintue high/low on an one mintue chart
>every three mintues, and delete the previous lines, I was able to code with
>all history lines shown on chart, just can't figure out how to delete
>history lines.
>BTW, anybody knows how to code high/low of previous trading session's last
>two hours' trading.
>Any help will be appreicated.
>
>Here is my code:
>
>if lastbaronchart then begin
>if DnTLRef >= 0 then TL_Delete(DnTLRef);
>DnTLRef = TL_New(Date, Time, Value1, Date, Time+3, value1);
>   TL_SetColor(DnTLRef,color4);
>      TL_SetSize(DnTLRef,0);
>      TL_SetStyle(DnTLRef,Tool_Dashed);
>      TL_SetExtRight(DnTLRef,false);
>      TL_SetExtLeft(DnTLRef,False);
>end;
>
>Eric
>
>
>
>
>----- Original Message ----- 
>From: "Harrison" <Harrison@xxxxxxxxxxxxxxxxxxxxxxx>
>To: "ericzhou" <ericzh2003@xxxxxxxx>
>Cc: "Omega-list" <Omega-List@xxxxxxxxxx>
>Sent: Wednesday, March 30, 2005 7:19 PM
>Subject: Re: Code Help
>
>
>  
>
>>Hello Eric,
>>
>>The following few lines, taken from my program, may give you a good
>>start, particularly if you use 3 min charts. This code uses 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
>>>
>>>
>>>
>>>
>>>
>>>      
>>>
>
>
>
>
>  
>