[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Moon Phases



PureBytes Links

Trading Reference Links


Thanks for this afl . Though this afl gives the FM/NM only, I 
combined this with Lunar Phases afl.

Thanks once again.





--- In amibroker@xxxxxxxxxxxxxxx, "rhoemke" <robert@xxx> wrote:
>
> Another nice one:
> 
> /* Full/New Moon signals indicator MkVII
>   Accurate to within 1 Minute per 69 years.
> 
>  ©Copyright 2001-2006 Jose Silva
>   for personal use only
>   http://www.metastocktools.com
> 
>   Plots +1 Signal on Full Moon; -1 on New Moon.
>   if FM/NM falls on a holiday OR weekend,
>    Signal is plotted on the next trading Day.
>   Warning: will NOT Plot last FM/NM Signal
>    until it is confirmed on next trade Day.*/
> 
> // Input your local time zone 
> TZ=Param("Your local Time Zone?  [-12 to +12hrs]",1, -12,12,1);
> 
> // Lunar cycle 
> LunarMonth=29.530589;
> Offset=7.254621;
> 
> // Calendar }
> leap=frac(Year()/4)==0 AND frac(Year()/100)!=0 OR frac(Year()/400)
==0;
> y=Year()*365+int(Year()/4)-int(Year()/100)+int(Year()/400);
> m=
>  IIf(Month()==2,31-leap,
>  IIf(Month()==3,59,
>  IIf(Month()==4,90,
>  IIf(Month()==5,120,
>  IIf(Month()==6,151,
>  IIf(Month()==7,181,
>  IIf(Month()==8,212,
>  IIf(Month()==9,243,
>  IIf(Month()==10,273,
>  IIf(Month()==11,304,
>  IIf(Month()==12,334, -leap)))))))))));
> CurrentDay=y+m+Day()-TZ/24-Offset;
> 
> // Full Moon }
> FM=frac(CurrentDay/LunarMonth);
> FM=PeakBars(FM, 1, 1)==0; 
> 
> // New Moon }
> NM=frac((CurrentDay+LunarMonth/2)/LunarMonth);
> NM=PeakBars(NM, 1,1)==0;
> 
> //Plot Moon signals in own window }
> 
> Plot(fm-nm, "Moon", colorWhite, styleHistogram);
> PlotShapes(IIf((FM-NM)>0,shapeCircle, IIf((FM-NM)<0,
> shapeHollowCircle, shapeNone)), colorBlack, 0,0);
> 
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "rhoemke" <robert@> wrote:
> >
> > Hope its correct.
> > 
> > /* Full/New Moon signals indicator MkVII
> >   Accurate to within 1 Minute per 69 years.
> > 
> >  ©Copyright 2001-2006 Jose Silva
> >   for personal use only
> >   http://www.metastocktools.com
> > 
> >   Plots +1 Signal on Full Moon; -1 on New Moon.
> >   if FM/NM falls on a holiday OR weekend,
> >    Signal is plotted on the next trading Day.
> >   Warning: will NOT Plot last FM/NM Signal
> >    until it is confirmed on next trade Day.*/
> > 
> > // Input your local time zone 
> > TZ=Param("Your local Time Zone?  [-12 to +12hrs]",1, -12,12,1);
> > 
> > // Lunar cycle 
> > LunarMonth=29.530589;
> > Offset=7.254621;
> > 
> > // Calendar }
> > leap=frac(Year()/4)==0 AND frac(Year()/100)!=0 OR frac(Year
()/400)==0;
> > y=Year()*365+int(Year()/4)-int(Year()/100)+int(Year()/400);
> > m=
> >  IIf(Month()==2,31-leap,
> >  IIf(Month()==3,59,
> >  IIf(Month()==4,90,
> >  IIf(Month()==5,120,
> >  IIf(Month()==6,151,
> >  IIf(Month()==7,181,
> >  IIf(Month()==8,212,
> >  IIf(Month()==9,243,
> >  IIf(Month()==10,273,
> >  IIf(Month()==11,304,
> >  IIf(Month()==12,334, -leap)))))))))));
> > CurrentDay=y+m+Day()-TZ/24-Offset;
> > 
> > // Full Moon }
> > FM=frac(CurrentDay/LunarMonth);
> > FM=PeakBars(FM, 1, 1)==0; 
> > 
> > // New Moon }
> > NM=frac((CurrentDay+LunarMonth/2)/LunarMonth);
> > NM=PeakBars(NM, 1,1)==0;
> > 
> > //Plot Moon signals in own window }
> > Plot(FM-NM, "Moonphase", colorBlack, styleHistogram);
> > 
> > Regards
> > Robert
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "vichooo_1999" <vichooo_1999@> 
wrote:
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "Richard Dale" <richard@> 
wrote:
> > > >
> > > > For anyone who is genuinely interested, Jose Silva has 
developed 
> > > such an
> > > > indicator for Metastock (for free) and the code is here:
> > > > 
> > > > http://www.metastocktools.com/MetaStock/Lunar.txt
> > > > 
> > > >  
> > > > 
> > > > It should be pretty easily portable to  AmiBroker.
> > > > 
> > > >  
> > > > 
> > > > Best regards,
> > > > Richard Dale.
> > > > Norgate Investor Services
> > > > - Premium quality Stock, Futures and Foreign Exchange Data 
for
> > > >   markets in Australia, Asia, Canada, Europe, UK & USA -
> > > > www.premiumdata.net
> > > >
> > > 
> > > 
> > > Please add a vertical line for Full Moon and New moon in the 
afl.
> > > thanks
> > >
> >
>