Hello,
I need to build a signal, that calculates the max H and the minimun L, using a start time and an end time.... so it has to found them between this time period.
Until the moment, I have used the functions "Highest"/"Lowest", which work with "n" bars.
Is there any or a way to base that calculation on time value periods?
Many thanks!
max H/min L function for time period
Re: max H/min L function for time period
A first approach...
Code: Select all
Inputs: xseconds(60);
vars: intrabarpersist MaxHigh(0), intrabarpersist MinLow(0),
StrDateTime(""), endtime_s(0);
StrDateTime = FormatDate("dd.MM.yy", el_datetodatetime(Date))+" "+FormatTime("HH:mm:ss", el_timetodatetime_s(time_s));
MaxHigh = maxlist(MaxHigh, High);
MinLow = minList(MinLow, Low);
If (BarStatus(1) = 2) then begin
if el_timetodatetime_s(time_s) >= endtime_s then begin
endtime_s = el_timetodatetime_s(time_s) + ( xseconds * eltimetodatetime_s(1) );
Print( StrDateTime + " MaxHigh=" + NumtoStr(MaxHigh,2) + " MinLow=" + NumtoStr(MinLow,2) );
MaxHigh = close;
MinLow = close;
end;
end;