PureBytes Links
Trading Reference Links
|
You're welcome. Here is an updated version:
=============
Date at Event
=============
---8<--------------------------
{ Date at event signals - v2.0 }
{ ©Copyright 2005 Jose Silva
For personal use only.
http://www.metastocktools.com }
{ User inputs }
plot:=Input("Event: [1]Date, [2]Signal, [3]Date+Signal",1,3,1);
format:=Input("Date format: [1]0.yymmdd, [2]ymmdd, [3]ddmmyy",1,3,
1);
{ Event example }
event:=Cross(Mov(C,5,E),Mov(C,20,E));
{ Date components }
y:=If(Year()<2000,Year()-1900,Year()-2000);
m:=Month();
d:=DayOfMonth();
{ Date in selected format }
yymmdd:=y*10000+m*100+d;
ptyymmdd:=yymmdd/1000000;
ddmmyy:=y+m*100+d*10000;
date:=If(format=1,ptyymmdd,
If(format=2,yymmdd,ddmmyy));
{ Extend date from last event }
xtDate:=ValueWhen(1,event,date);
{ Plot in own window }
If(plot=1,xtDate,If(plot=2,event,event*date))
---8<--------------------------
jose '-)
http://www.metastocktools.com
--- In equismetastock@xxxxxxxxxxxxxxx, "Hitendra Vasudeo" <hitendra@x
...> wrote:
> Thank you very much, Jose
>
> _____
>
> From: equismetastock@xxxxxxxxxxxxxxx [mailto:
> equismetastock@xxxxxxxxxxxxxxx]
> On Behalf Of Jose Silva
> Sent: Monday, May 02, 2005 8:51 AM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: Re: [EquisMetaStock Group] EXPLORATION
>
>
> Hitendra, try this MS indicator code:
>
> =============
> Date at Event
> =============
> ---8<--------------------------
>
> { yymmdd Date at event signals }
> { http://www.metastocktools.com }
>
> { Plot choice }
> plot:=Input("Event [1]yymmdd date, [2Signal",
> 1,2,1);
>
> { Event example }
> event:=Cross(Mov(C,8,E ),Mov(C,25,S));
>
> { Date in yymmdd format }
> y:=If(Year()<2000,Year()-1900,Year()-2000);
> m:=Month()*100;
> d:=DayOfMonth()*10000;
> yymmdd:=y+m+d;
>
> { yymmdd at event }
> eventDate:=ValueWhen(1,event,yymmdd);
>
> { Plot in own window }
> If(plot=1,eventDate,event)
>
> ---8<--------------------------
>
>
> jose '-)
> http://www.metastocktools.com
------------------------ Yahoo! Groups Sponsor --------------------~-->
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/BefplB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|