Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Lunar cycle for Amibroker (AFL)

Rating:
3 / 5 (Votes 3)
Tags:
amibroker, cycle

Original metastock version by Jose Silva → metastocktools.com/MetaStock/Lunar.txt

Translated from metastock to amibroker by Marcelin Tudor, Date/Time added:2006-09-03 10:02:09

This script Plot Full Moon and New Moon on your chart,which will make it easy for moon traders.

We can see there is good recognition for moon trading in higher levels of industry, recently, The Royal Bank of Scotland came up with a report
“Sheer Lunacy staring at the heavens” i suggest to read this report and know how one can use moon phases in trading i am pasting the pdf link below available on web.

xa.yimg.com/kq/groups/17324418/945690453/…/RBS+Moon+Phase.pdf

There is also another script in amibroker called “LUNA PHASE” if we are comfortable, i request to combine both the codes and use as one.

Thank you,
SAHASRA.

Screenshots

Similar Indicators / Formulas

Trigonometric Fit
Submitted by knifeman almost 14 years ago
Cycle Highlighter
Submitted by jaredliang over 14 years ago
MultiCycle 1.0
Submitted by mamunbaf9117 almost 14 years ago
bad tick clean
Submitted by pious243 over 11 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
XTL - AG -4 AmiB
Submitted by ajmal017 almost 13 years ago

Indicator / Formula

Copy & Paste Friendly
_SECTION_BEGIN("Lunar cycle");
// Input your local time zone
TZ=Param("Your local Time Zone? [-12 to +12hrs]",2, -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;
FullMoon=FM-NM==1;
NewMoon=FM-NM==-1;

//Plot Moon Phase in own window }

SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 

SetChartBkGradientFill( ParamColor("BgTop", colorWhite),ParamColor("BgBottom", colorLightYellow));

shape = IIf(FullMoon,shapeCircle+shapePositionAbove,IIf(NewMoon,shapeCircle+shapePositionAbove,Null));

PlotShapes(shape,IIf(FullMoon,colorYellow,colorBlack),0,H);
_SECTION_END();

1 comments

1. indyan

Not showing the details at left top. help plz

Leave Comment

Please login here to leave a comment.

Back