max H/min L function for time period

Questions about MultiCharts and user contributed studies.
User avatar
Gargoyle
Posts: 92
Joined: 18 May 2014
Has thanked: 7 times
Been thanked: 5 times

max H/min L function for time period

Postby Gargoyle » 16 Sep 2015

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!

Fredi
Posts: 45
Joined: 01 Nov 2013
Been thanked: 2 times

Re: max H/min L function for time period

Postby Fredi » 17 Sep 2015

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;


Return to “MultiCharts”