Rank: Advanced Member
Groups: Registered, Registered Users Joined: 1/19/2005(UTC) Posts: 1,065 Location: Koh Pha-Ngan, Earth
Was thanked: 2 time(s) in 2 post(s)
|
Try this indicator as a base for your formula:
[code:1:d009f93c39]
{ Plots data array at chosen date.
©Copyright 2003~2006 Jose Silva.
For personal use only.
http://www.metastocktools.com }
{ User inputs }
day:=Input("Day of month",1,31,1);
mth:=Input("Month",1,12,1);
yr:=Input("Year",1800,2200,2006);
plot:=Input("Plot at date: [1]Value, [2]Signal",1,2,1);
{ Sample data array }
x:=RSI(14);
{Date signal - plot next avail date if holiday}
period:=Year()>yr
OR (Year()=yr AND (Month()>mth
OR Month()=mth AND DayOfMonth()>=day));
date:=period AND Alert(period=0,2);
{ Data at date signal }
init:=Cum(IsDefined(x))=1;
DateVal:=ValueWhen(1,date OR init,x);
{ Plot in own window }
If(plot=1,DateVal,date)
[/code:1:d009f93c39]
Also try the Yearly RoC.
jose '-)
|