- Katılım
- 23 Eki 2020
- Mesajlar
- 1,828
Hello, A while ago, I believe that Jose or someone else posted the code for the Full Moon/New Moon. Does anybody have that code and do they know if it is accurate? Any help would be appreciated. Thanks, Al =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Re: Full Moon/New Moon indicator To celebrate the auspicious Full Moon / Lunar eclipse last night, I've updated the Lunar Indicator code. The Lunar Indicator is still as accurate as ever, but now incorporates a signal advance input (in calendar days) so that lunar signals may be shifted and viewed on weekends and trading holidays. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lunar Cycle { Full/New Moon signals indicator MkVIII Plots +1 signal on Full Moon; -1 on New Moon. Accurate to within 1 minute per 69 years. If FM/NM falls on a holiday or weekend, signal is plotted on the next trading day. Use the signal advance function to shift signals and view on non-trading days. ŠCopyright 2001~2007 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } { User inputs } shift:=Input("Advance signal by x calendar days",-30,30,0); TZ:=Input("Your local Time Zone? [-12 to +12hrs]",-12,12,7); { http://www.travel.com.hk/region/timezone.htm } { Lunar cycle } LunarMonth:=29.530589; Offset:=7.254621; { Calendar engine } 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:= If(Month()=2,31-leap, If(Month()=3,59, If(Month()=4,90, If(Month()=5,120, If(Month()=6,151, If(Month()=7,181, If(Month()=8,212, If(Month()=9,243, If(Month()=10,273, If(Month()=11,304, If(Month()=12,334, -leap))))))))))); DayNr:=y+m+DayOfMonth()-TZ/24-Offset+shift+1; { Full Moon cycle } FM:=Frac(DayNr/LunarMonth); { New Moon cycle } NM:=Frac((DayNr+LunarMonth/2)/LunarMonth); { Lunar cycle signals } cycle:=FM-NM; FM:=cycle<0 AND Alert(cycle>0,2); NM:=cycle>0 AND Alert(cycle<0,2); { Plot Lunar signals in own window } FM-NM
|
Son düzenleme: