With that setup the days 5 to 7 after the full moon and 1 or 2 before the full moon produced considerably more return, on average, than other days. In fact the best days produced about 80 to 90% of the average yearly return for the index, even though the system was only invested for less than half the month.
The yearly return is not high enough for this to be a stand-alone system, but it could be combined with some other system to bias the amount bought if the other factors produced a buy signal in the good moon days. For instance, you might want to buy with some margin leverage if the other system produced a buy on the favorable moon days.
Dave H.
//From: "rhoemke" <[EMAIL PROTECTED]>
//Sender: [email protected]
//Mailing-List: list [email protected]; contact [EMAIL PROTECTED]
//Date: Sat, 02 Sep 2006 20:44:51 -0000
// Input your local time zone
TZ=Param("Your local Time Zone? [-12 to +12hrs]",-5, -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, Red = New, Black = Full", IIf((FM-NM)> 0, colorBlack, colorRed), styleHistogram);
// ----------------------------------------------------------------------------
// Set Delay
// ----------------------------------------------------------------------------
SetTradeDelays( 0, 0, 0, 0 );
Startoffset = Optimize("startoffset", 0, 1, 28, 1);
Hold_days = Optimize("hold_days", 4, 1, 10, 1);
MBuy = Ref(FM, -Startoffset) > 0.5;
MSell = Ref(FM, -Hold_days -startoffset ) > 0.5;
Buy = DateNum() >= 881201 && (MBuy);
Sell = DateNum() <= 881130 || (MSell);
Buy = Flip(Buy, Sell);
Sell = NOT Buy;
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
| Software support | Small business finance | Business finance online |
| Business finance training | Business finance course |
YAHOO! GROUPS LINKS
- Visit your group "amibroker" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
