General Topics
Markets
Technical Topics
Brokerage Firms
Community Lounge
Site Support

# Determine High Low

Discussion in 'Strategy Development' started by clarodina, Feb 15, 2009.

1. ### clarodina

Hi anyone knows how to code in easylanguage of the following?

Determine the different between highest high and lowest low for a time period like 0900 - 1100 in a new trading day?

2. ### flyingdutchmen

for 1 minute bars
avg = highest value minus lowest value within the chosen time

inputs: StartTime ( 0900 ), EndTime ( 1100 );

variables: ll(0), hh(0), avg(0), counter(0);

if time >= StartTime and time < EndTime then counter = counter + 1;

if time = EndTime then begin
ll = lowest( low, counter );
hh = highest( high, counter );
avg = ( hh - ll );
counter = 0;
end;

Maybe this will work:

counter =0;

if time >= StartTime and time < EndTime then begin

counter = counter + 1;

if time = EndTime then begin
ll = lowest( low, counter );
hh = highest( high, counter );
avg = ( hh - ll );
counter = 0;
end;

end;

4. ### flyingdutchmen

both will do the job

I din't think your if...then...statement will count as a loop, unless you place it in one...

6. ### clarodina

try to use the code in the above and problem in have to code to define a new trading day to recalculate the hl range. Possible to use the date function like d>d[1] but some days are left out when this is included.

7. ### flyingdutchmen

the script will save the 3 value's untill there is a new value available which is at your definied enttime, this wil do every