PureBytes Links
Trading Reference Links
|
Sorry About That!!!!
What follows was contributed by Gary Funk a long time ago.
Indicator was modified somewhat to my liking.
Don't forget. There is a function and there is an indicator!!!!
Have at it and see what goes. I did a very large study a couple
years ago an published it here that ABSOLUTELY CONCLUSIVELY AND
WITHOUT A DOUBT showed that there was a correlation between the
moon's phase and the profitability of a simple buy/sell on opposite
phases of the moon.
Clyde Lee
{+ + + + + + + function follows + + + + + + + + + + + + + +}
{
Function Moondays returns the number of days since a new moon.
The values returned range between 0 and 29.
(0 = new, and 15 is a full moon to +/- 2 day accuracy.)
Author: Gary Funck, gary@xxxxxxxxxxxx, 7/15/97
No restrictions on use/copying. No warranties, expressed/implied.
This code uses an approximation described in the the "Astro FAQ";
summarized below:
Subject: C.11 How do I calculate the phase of the moon?
Author: Bill Jefferys <bill@xxxxxxxxxxxxxxxxxxx>
John Horton Conway (the Princeton mathematician who is responsible for
"the Game of Life") wrote a book with Guy and Berlekamp, _Winning
Ways_, that describes in Volume 2 a number of useful calendrical
rules. One of these is an easy "in your head" algorithm for
calculating the phase of the Moon, good to a day or better depending
on whether you use his refinements or not.
In the 20th century, calculate the remainder upon dividing the
last two digits of the year by 19; if greater than 9, subtract
19 from this to get a number between -9 and 9.
Multiply the result by 11 and reduce modulo 30 to obtain a
number between -29 and +29.
Add the day of the month and the number of the month (except
for Jan and Feb use 3 and 4 for the month number instead of
1 and 2).
Subtract 4.
Reduce modulo 30 to get a number between 0 and 29. This is
the age of the Moon.
Example: What was the phase of the Moon on D-Day (June 6,
1944)?
Answer: 44/19=2 remainder 6.
6*11=66, reduce modulo 30 to get 6.
Add 6+6 to this and subtract 4: 6+6+6-4=14; the Moon was (nearly)
full. I understand that the planners of D-day did care about the phase
of the Moon, either because of illumination or because of tides. I
think that Don Olsen recently discussed this in _Sky and Telescope_
(within the past several years).
In the 21st century use -8.3 days instead of -4 for the last number.
Conway also gives refinements for the leap year cycle and also
for the slight variations in the lengths of months; what I have
given should be good to +/- a day or so.
}
inputs: dt(numericsimple);
variables: x1(0), x2(0), x3(0), x4(0),DT1(0);
DT1=JulianToDate(DateToJulian(DT+1));
x1 = Modulus(year(DT1), 19);
if x1 > 9 then x1 = x1 - 19;
x2 = Modulus(x1 * 11, 30);
x3 = month(DT1);
if month(DT1) < 3 then x3 = x3 + 2;
x4 = x2 + dayofmonth(DT1) + x3 - 4;
Moondays = Modulus(x4, 30);
{+ + + + + + + indicator below + + + + + + + + + + + + + +}
{
Indicator Moonphase, returns a value between 0..100, that
indicates (approximately) the fullness of the moon, where
0 is a new moon, and 100 is a full moon. This indicator
calls the Moondays function, and is accurate to +/- 2 days.
Accepts an input, offset, which should be in the range -14..14.
Generally, you will not need to change the offset value, unless
for example, you want the display to agree with the offset
value used by Moontrade.
Author: Gary Funck, gary@xxxxxxxxxxxx, 7/15/97
No restrictions on use/copying. No warranties, expressed/implied.
}
input: offset(0);
variables: dt(0), phase(0), mday(0),mphase(0);
dt = juliantodate(datetojulian(date) + offset);
mday = Moondays(dt);
phase = 100*( mday /(29.530588853/2));
If (phase>100 and phase[1]<=100) then Value2=-1;
Value2=Value2+1;
If Value2=0 then Value5=100 else Value5=0;
Plot2(Value5,"vl");
if phase > 100 then mphase = 200 - phase else mphase=phase;
plot1(mphase, "moon phase");
Larry Muir wrote:
>
> There was an article in The Technical Analysis of Stocks and Commodities
> magazine about trading one of the agricultural commodities with astrology.
> It said in the article that this market went up on the full moon and down on
> the new moon. It would be interesting to mark the new and full moons on an
> SP500 chart and see what it looked like.
>
> >From: JCDuffy@xxxxxxx
> >To: mseflin@xxxxxxxxxxxxx, chmeyer@xxxxxxxx
> >CC: realtraders@xxxxxxxxxxxx, info@xxxxxxxxxxxxxxxxxxxxx, boggio@xxxxxxxxx
> >Subject: Re: GEN: DUCKS, ASTROLOGY, ETC......
> >Date: Thu, 8 Jul 1999 21:35:44 EDT
> >
> >In a message dated 99-07-08 00:28:15 EDT, mseflin@xxxxxxxxxxxxx writes:
> >
> ><< please...this
> > conversation is not useful to the majority of participants >>
> >
> >
> >I do not use astrology to trade, nor do I know much about it. That is why I
> >found it precisely interesting. How do you what the "majority" of other
> >people think about a discussion, or whether or not it is useful to them?
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Clyde Lee Chairman/CEO (Home of SwingMachine)
SYTECH Corporation email: <clydelee@xxxxxxx>
7910 Westglen, Suite 105 Work: (713) 783-9540
Houston, TX 77063 Fax: (713) 783-1092
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
To subscribe / unsubscribe from SwingMachine list
http://www.egroups.com/list/swingmachine/
After joining list the freeware SwingMachine program
(DOS Version) is available in the VAULT at:
http://www.egroups.com/list/swingmachine/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Attachment Converted: "c:\eudora\attach\Moonphas.ela"
Attachment Converted: "c:\eudora\attach\junk11.gif"
|