Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Display Plot Restriction for Metastock
martin3
over 10 years ago
Metastock

Rating:
0 / 5 (Votes 0)
Tags:
metastock

Restricts any indicator plot to selected date period.

Created By Jose Silva of MetastockTools.com

Indicator / Formula

Copy & Paste Friendly

MetaStock -> Tools -> Indicator Builder -> New -> copy & paste complete formula

{ Display plot restriction v2.0
  Restricts plot display to selected dates.

 ┬ęCopyright 2005~2006 Jose Silva.
  The grant of this license is for personal use
   only - no resale or repackaging allowed.
  http://www.metastocktools.com }

{ Sample plot to restrict }
plot:=Mov(C,5,E);

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

{ Selected date periods }
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 signals }
date1:=start AND Alert(start=0,2);
date2:=end=0 AND Alert(end,2);
date2:=Zig(end AND Cum(1)>1,1,$)=1;

{ Restrict out of range date signals to chart }
start:=
 If(LastValue(Cum(date1))>0,date1,Cum(1)=1);
end:=If(LastValue(Cum(date2))>0,date2,
 LastValue(Cum(1))=Cum(1));

{ Restrict plot to selected date period }
pds:=LastValue(BarsSince(end));
restricted:=
 Ref(Ref(plot,-pds),pds)*ValueWhen(1,start,1);

{ Plot in own window }
restricted

0 comments

Leave Comment

Please login here to leave a comment.

Back