Determine High Low

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?
 
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;
 
Quote from 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;
 
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.
 
Back
Top