Lunar

 
Hi,
Please can someone please help me correct mistakes on this lunar indicator.
I also need help adding it to my trading station.
Thanks,
Alan
===========
Lunar cycle
===========
---8<----------------------------------
 
{ 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:=Input(+10);
 
{ 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:=
 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)))))))))));
CurrentDay:=y+m+DayOfMonth()-TZ/24-Offset;
 
{ Full Moon }
FM:=Frac(CurrentDay/LunarMonth);
FM:=PeakBars(1,FM,1)=0;
 
{ New Moon }
NM:=Frac((CurrentDay+LunarMonth/2)/LunarMonth);
NM:=PeakBars(1,NM,1)=0;
 
{ Plot Moon signals in own window }
FM-NM
 
---8<----------------------------------
 
 
http://www.metastocktools.com
 
 
 
 
Feedback from Kuala Lumpur (Malaysia) resident:
 
"I've plotted the Lunar cycle indicator (FM: 9 Aug 2006),
but found it differs from the Chinese calendar's 8 Aug 2006."
 
 
KL Standard time zone:  UTC/GMT +8 hours
          KL location:  3deg 8' N, 101deg 42' E.
Exact Full Moon in KL:  Wed 9th August 2006,
                        18:56 (6:56pm) local KL time
 
The Lunar cycle indicator is correct, and the Chinese calendar shows
a wrong Full Moon date in this case.
 
 
 
 
 
Are Investors Moonstruck? - Lunar Phases and Stock Returns
========================
 
http://papers.ssrn.com/sol3/Delivery.cfm/SSRN_ID283156_code010918600.pdf?abstractid=283156
 
 
Psychological evidence and casual intuition predict that lunar phases
regulate mood.
 
This paper investigates the relation between lunar phases and stock
market returns in 48 countries.  We find strong global evidence that
stock returns are lower on days around a full moon than on days around
a new moon.  The magnitude of the return difference is 6.6 percent per
annum from our 15-day window panel analysis.
 
The lunar effect is independent of other calendar-related anomalies such
as the January effect, the day-of-week effect, and the calendar month
effect.
 


Not MQL ?