MetaStock™ Zone Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

A B C D E F G H I J K L M N O P R S T U V W Y Z #

Time Filters by Jose Silva
Date & Intraday time filters, with user date/time inputs & sample application.

Time Filters - Date Filter

{ Date filter }
{ Plots +1 signal within user-input date period }
{ http://www.metastocktools.com }

StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,1);
StYear:=Input("start Year",1800,2200,2003);
EnDay:=Input("end Day",1,31,31);
EnMnth:=Input("end Month",1,12,12);
EnYear:=Input("end Year",1800,2200,2003);

start:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
end:=Year()<EnYear
OR (Year()=EnYear AND (Month()<EnMnth
OR Month()=EnMnth AND DayOfMonth()<=EnDay));

start AND (end OR (start AND Alert(start=0,2)))

 

 

Time Filters - Date Filter Sample Application

{ Open/Hi/Lo/Close of specified date period }
{ http://www.metastocktools.com }

{ Date inputs }
StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,12);
StYear:=Input("start Year",1800,2200,2004);
EnDay:=Input("end Day",1,31,31);
EnMnth:=Input("end Month",1,12,12);
EnYear:=Input("end Year",1800,2200,2004);

{ Selected date period }
start:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
end:=Year()<EnYear
OR (Year()=EnYear AND (Month()<EnMnth
OR Month()=EnMnth AND DayOfMonth()<=EnDay));
date:=
start AND (end OR (start AND Alert(start=0,2)));

{ Open/Hi/Lo/Close for date period }
Op:=ValueWhen(1,date=1 AND Alert(date=0,2),O);
Hi:=Highest(ValueWhen(1,date,H));
Lo:=Lowest(ValueWhen(1,date,L));
Cl:=ValueWhen(1,
date=0 AND Alert(date,2),Ref(C,-1));

{ Plot on price chart }
Op; { Black }
Hi; { Red }
Lo; { Blue }
Cl; { Green }

 

 

 


Time Filters - Date Signals

{Date signals}
{Plots +1/-1 signals on user-input dates}
{http://www.metastocktools.com}

StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,1);
StYear:=Input("start Year",1800,2200,2003);
EnDay:=Input("end Day",1,31,31);
EnMnth:=Input("end Month",1,12,12);
EnYear:=Input("end Year",1800,2200,2003);

today:=Year()+Month()/12+DayOfMonth()/373;
stInput:=StYear+StMnth/12+StDay/373;
endInput:=EnYear+EnMnth/12+EnDay/373;
start:=stInput>Ref(today,-1) AND stInput<=today;
end:=endInput>Ref(today,-1) AND endInput<=today;
signals:=If(start=end,start,start-end);

signals

 

 

Time Filters - Time filter

{Intraday time filter}
{Plots +1 signal within user-input time period}
{http://www.metastocktools.com}

StHour:=Input("start Hour",0,23,12);
StMin:=Input("start Minute",0,59,1);
EnHour:=Input("end Hour",0,23,14);
EnMin:=Input("end Minute",0,59,15);

start:=Hour()>StHour
OR Hour()=StHour AND Minute()>=StMin;
end:=Hour()<EnHour
OR Hour()=EnHour AND Minute()<=EnMin;

start AND (end OR (start AND Alert(start=0,2)))

 

Source / From: TOP
http://www.metastocktools.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie i rynkach walutowych (FOREX) niesie ze sob± ryzyko poważnych strat finansowych!