Re: [amibroker] Planetary system calcs

 

Thank you for the indicators.
I have several of these lunar type but the one that they have on the web site has every planet and comet.
I am wandering if java script can be referenced in ami or this has to be completely rewritten.
Thanks

Sent from my iPhone

> On May 11, 2016, at 2:23 AM, reinsley reinsley@yahoo.fr [amibroker] <amibroker@yahoogroups.com> wrote:
>
>
>
>
>
> https://www.google.fr/search?hl=en&q=site:www.amibroker.com+Tooltip&btnG=Search&gws_rd=cr,ssl&ei=GvgyV9rGD8yeaPb9m-AO#hl=en&q=site:www.amibroker.com+luna
>
> https://www.google.fr/search?hl=en&q=site:www.amibroker.com+Tooltip&btnG=Search&gws_rd=cr,ssl&ei=GvgyV9rGD8yeaPb9m-AO#hl=en&q=amibroker+lunar+afl
>
> I have these two on the shelves.
> I never try them.
>
> Best regards
>
> the first fmla
>
> // 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);
>
> and the second fmla
>
> // Luna Phase
> // by Michael.S.G :
>
>
> _SECTION_BEGIN("LunaPhase");
> // Luna Phase Calculator.
> // Code converted from: http://home.att.net/~srschmitt/lunarphasecalc.html
> // OzFalconAB
>
> // Get Day/Month/Year in number format (NOT array).
> Y = SelectedValue(Year()); M = SelectedValue(Month()); D =
> SelectedValue(Day());
>
>
> // normalize values to range 0...1
> function normalize( Val )
> {
>
> Val = Val - floor( Val );
> if (Val < 0) {Val = Val + 1;}
> return Val;
> }
>
> // Set Pi.
> PI = 3.1415926535897932385;
>
> // calculate the Julian Date at 12H UT
> YY = Y - floor( ( 12 - M ) / 10 );
> MM = M + 9;
> if (MM >= 12) {MM = MM - 12;}
>
> K1 = floor( 365.25 * ( YY + 4712 ) );
> K2 = floor( 30.6 * MM + 0.5 );
> K3 = floor( floor( ( YY / 100 ) + 49 ) * 0.75 ) - 38;
>
> JD = K1 + K2 + D + 59; // for dates in Julian calendar
> if (JD > 2299160) {JD = JD - K3;} // for Gregorian calendar
>
> // calculate moon's age in days
> IP = normalize( ( JD - 2451550.1 ) / 29.530588853 );
> AG = IP*29.53;
>
> Phase = "NEW";
> if (AG < 27.68493) {Phase = "Waning crescent";S1=4;S2=8;}
> if (AG < 23.99361) {Phase = "Last quarter";S1=4;S2=12;}
> if (AG < 20.30228) {Phase = "Waning gibbous";S1=6;S2=14;}
> if (AG < 16.61096) {Phase = "FULL";S1=6;S2=15;}
> if (AG < 12.91963) {Phase = "Waxing gibbous";S1=6;S2=7;}
> if (AG < 9.22831) {Phase = "First quarter";S1=2;S2=3;}
> if (AG < 5.53699) {Phase = "Waxing crescent";S1=2;S2=1;}
> if (AG < 1.84566) {Phase = "NEW";S1=0;S2=0;}
>
> IP1 = IP;
> IP = IP*2*PI; // Convert phase to radians
>
> // calculate moon's distance
> DP = 2*PI*normalize( ( JD - 2451562.2 ) / 27.55454988 );
> DI = 60.4 - 3.3*cos( DP ) - 0.6*cos( 2*IP - DP ) - 0.5*cos( 2*IP );
>
> // calculate moon's ecliptic latitude
> NP = 2*PI*normalize( ( JD - 2451565.2 ) / 27.212220817 );
> LA = 5.1*sin( NP );
>
> // calculate moon's ecliptic longitude
> RP = normalize( ( JD - 2451555.8 ) / 27.321582241 );
> LO = 360*RP + 6.3*sin( DP ) + 1.3*sin( 2*IP - DP ) + 0.7*sin( 2*IP );
>
> Zodiac = "Pisces";
> if (LO < 348.58) {Zodiac = "Aquarius";}
> if (LO < 311.72) {Zodiac = "Capricorn";}
> if (LO < 302.49) {Zodiac = "Sagittarius";}
> if (LO < 271.26) {Zodiac = "Scorpio";}
> if (LO < 242.57) {Zodiac = "Libra";}
> if (LO < 224.17) {Zodiac = "Virgo";}
> if (LO < 173.34) {Zodiac = "Leo";}
> if (LO < 135.30) {Zodiac = "Cancer";}
> if (LO < 119.48) {Zodiac = "Gemini";}
> if (LO < 93.44) {Zodiac = "Taurus";}
> if (LO < 51.16) {Zodiac = "Aries";}
> if (LO < 33.18) {Zodiac = "Pisces";}
>
>
> _N(Title = "Date = " + Y + "/" + M + "/" +D + "\n" +
> "Age: " + AG + " Phase: " + Phase + "\n" +
> "distance: " + DI + " earth radii\n" +
> "ecliptic\n" +
> " latitude = " + LA + "°\n" +
> " longitude = " + LO + "°\n" +
> "constellation = " + Zodiac+ "\n" +
> "IP: " + IP1);
>
>
> Color = IIf(O > C, colorBlack, colorYellow);
> Plot( Close, "Price", color, styleCandle | styleOwnScale );
> _SECTION_END();
>
>
> Le 10/05/2016 19:43, ERKAN BISEVAC ebisevac@yahoo.com [amibroker] a écrit :
>> Hi,
>> I was looking into planetary (astrology) indicator and couldn't find any on the web for amibroker.
>> Than I started looking for equations and found this web page
>> http://cosinekitty.com/solar_system.html
>> There they have astronomy.js file that has all the calculations.
>> I am not that good with programing but I was wondering if some of our gurus can help.
>> Thanks,
>> Erkan
>>
>>
>>
>>
>> ------------------------------------
>> Posted by: ERKAN BISEVAC <ebisevac@yahoo.com>
>> ------------------------------------
>>
>> **** IMPORTANT PLEASE READ ****
>> This group is for the discussion between users only.
>> This is *NOT* technical support channel.
>>
>> TO GET TECHNICAL SUPPORT send an e-mail directly to
>> SUPPORT {at} amibroker.com
>>
>> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at

>> http://www.amibroker.com/feedback/
>> (submissions sent via other channels won't be considered)
>>
>> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
>> http://www.amibroker.com/devlog/
>>
>>
>> ------------------------------------
>>
>> Yahoo Groups Links
>>
>>
>>
>>
>
>
>
> ------------------------------------
>
> ------------------------------------
>
> **** IMPORTANT PLEASE READ ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
>
> ------------------------------------
>
> Yahoo Groups Links
>
>
>

__._,_.___

Posted by: ERKAN BISEVAC <ebisevac@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv