0% found this document useful (0 votes)
541 views4 pages

Astro Planetary Aspect Dates Pine Script

tradingview pine script

Uploaded by

anil sawant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
541 views4 pages

Astro Planetary Aspect Dates Pine Script

tradingview pine script

Uploaded by

anil sawant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

// This source code is subject to the terms of the Mozilla Public License 2.

0 at
https://mozilla.org/MPL/2.0/
// © BarefootJoey

//@version=5
indicator("Astro: Planetary Aspect Dates", overlay=true)

import BarefootJoey/AstroLib/2 as AL

interplanet = input.bool(false, "Interplanetary aspects?", tooltip="Leave this box


unchecked for single planet aspects.")
planet1_in = input.string("☿ Mercury", "Which planets?", options=["☉︎ Sun", "☽︎
Moon", "☿ Mercury", "♀ Venus", "🜨 Earth", "♂ Mars", "♃ Jupiter", "♄ Saturn", "⛢
Uranus", "♆ Neptune", "♇ Pluto", "Vesta", "Juno", "Ceres", "Pallas", "Chiron",
"Astraea", "Hebe", "Iris", "Flora", "Psyche", "Icharus", "Bellerophon", "Apophis",
"Nessus"], inline="3")
planet2_in = input.string("♂ Mars", " ", options=["☉︎ Sun", "☽︎ Moon", "☿ Mercury",
"♀ Venus", "🜨 Earth", "♂ Mars", "♃ Jupiter", "♄ Saturn", "⛢ Uranus", "♆
Neptune", "♇ Pluto", "Vesta", "Juno", "Ceres", "Pallas", "Chiron", "Astraea",
"Hebe", "Iris", "Flora", "Psyche", "Icharus", "Bellerophon", "Apophis", "Nessus"],
inline="3")
precision = input.float(6.0, "Aspect Precision (+/- °)", minval=0, maxval=15)
showlast = input.int(5000, "Show last?", minval=1, tooltip="Number of historical
plots to display. The fewer plots, the faster the load time (especially on loweer
timeframes). Use the Time Machine feature for distant historical analysis.")
col_asp = input.color(color.white, "Aspect & Info Color")
iTxtSize=input.string("Normal", title="Text Size", options=["Auto", "Tiny",
"Small", "Normal", "Large"], inline="1")
vTxtSize=iTxtSize == "Auto" ? size.auto : iTxtSize == "Tiny" ? size.tiny : iTxtSize
== "Small" ? size.small : iTxtSize == "Normal" ? size.normal : iTxtSize ==
"Large" ? size.large : size.small
position = input.string(position.top_center, "Aspect Info Position",
[position.top_center, position.top_right, position.middle_right,
position.bottom_right, position.bottom_center, position.bottom_left,
position.middle_left, position.top_left])

grol = "🔭 Observer Location 🔭"


gt = time
htz = input.float(0, "Hour", step=0.5, inline="2", group=grol)
mtz = input.int(0, "Minute", minval=0, maxval=45, inline="2", group=grol)
tz = htz + math.round(mtz / 60, 4)
latitude = input.float(0, "Latitude", inline="1", group=grol)
longitude = input.float(0, "Longitude", inline="1", group=grol)
geo = input.bool(false, "Geocentric?", tooltip="Leave this box unchecked for
heliocentric.", group=grol)
geoout = geo ? 0 : 1 // Corrected Apr 15, 2024 by @BarefootJoey

day = AL.J2000(AL.JDN(gt, 0, tz))


dayr = AL.J2000(AL.JDN(gt, 1, tz))

if interplanet and planet1_in == planet2_in


runtime.error("Planet cannot aspect itself. Please select 2 different planets
for interplanetary analysis.")

long1_out = planet1_in == "☉︎ Sun" ? AL.getsun(geoout, day, dayr, latitude,


longitude, tz) :
planet1_in == "☽︎ Moon" ? AL.getmoon(geoout, day, dayr, latitude, longitude) :
planet1_in == "☿ Mercury" ? AL.getplanet(1, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "♀ Venus" ? AL.getplanet(2, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "🜨 Earth" ? AL.getplanet(3, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "♂ Mars" ? AL.getplanet(4, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "♃ Jupiter" ? AL.getplanet(5, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "♄ Saturn" ? AL.getplanet(6, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "⛢ Uranus" ? AL.getplanet(7, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "♆ Neptune" ? AL.getplanet(8, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "♇ Pluto" ? AL.getplanet(9, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "Juno" ? AL.getplanet(12,geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Vesta" ? AL.getplanet(13,geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Ceres" ? AL.getplanet(14,geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Pallas" ? AL.getplanet(19, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Chiron" ? AL.getplanet(20, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Astraea" ? AL.getplanet(21, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "Hebe" ? AL.getplanet(22, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Iris" ? AL.getplanet(23, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Flora" ? AL.getplanet(24, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Psyche" ? AL.getplanet(25, geoout, day, dayr, latitude, longitude,
tz) :
planet1_in == "Icharus" ? AL.getplanet(26, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "Bellerophon" ? AL.getplanet(27, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "Apophis" ? AL.getplanet(28, geoout, day, dayr, latitude,
longitude, tz) :
planet1_in == "Nessus" ? AL.getplanet(29, geoout, day, dayr, latitude, longitude,
tz) :
na

long2_out = planet2_in == "☉︎ Sun" ? AL.getsun(geoout, day, dayr, latitude,


longitude, tz) :
planet2_in == "☽︎ Moon" ? AL.getmoon(geoout, day, dayr, latitude, longitude) :
planet2_in == "☿ Mercury" ? AL.getplanet(1, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "♀ Venus" ? AL.getplanet(2, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "🜨 Earth" ? AL.getplanet(3, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "♂ Mars" ? AL.getplanet(4, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "♃ Jupiter" ? AL.getplanet(5, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "♄ Saturn" ? AL.getplanet(6, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "⛢ Uranus" ? AL.getplanet(7, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "♆ Neptune" ? AL.getplanet(8, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "♇ Pluto" ? AL.getplanet(9, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "Juno" ? AL.getplanet(12,geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Vesta" ? AL.getplanet(13,geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Ceres" ? AL.getplanet(14,geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Pallas" ? AL.getplanet(19, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Chiron" ? AL.getplanet(20, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Astraea" ? AL.getplanet(21, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "Hebe" ? AL.getplanet(22, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Iris" ? AL.getplanet(23, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Flora" ? AL.getplanet(24, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Psyche" ? AL.getplanet(25, geoout, day, dayr, latitude, longitude,
tz) :
planet2_in == "Icharus" ? AL.getplanet(26, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "Bellerophon" ? AL.getplanet(27, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "Apophis" ? AL.getplanet(28, geoout, day, dayr, latitude,
longitude, tz) :
planet2_in == "Nessus" ? AL.getplanet(29, geoout, day, dayr, latitude, longitude,
tz) :
na

p1p2=math.abs(AL.degtolowest180(AL.AngToCirc(long1_out - (interplanet?
long2_out:0))))

var label conj = na


var label ssex = na
var label sext = na
var label squa = na
var label trin = na
var label inco = na
var label oppo = na

retro_tt(deg) => deg > deg[1] ? "" : " ℞"


retro_tt_out = retro_tt(AL.AngToCirc(long1_out - (interplanet?long2_out:0)))

var table Info = na


table.delete(Info)
Info := table.new(position, 1, 1)
if barstate.islast
table.cell(Info, 0, 0,
text = planet1_in + (interplanet?" ∡ "+planet2_in:"") + retro_tt_out,
text_size = vTxtSize,
text_color = color.new(col_asp,0),
tooltip = AL.aspectsignprecisionV2ext(p1p2, precision) + "°\nPrecision: +/- "
+ str.tostring(precision) + "°")

conjunction = ta.crossunder(AL.AngToCirc(long1_out - (interplanet?


long2_out:0)),180)
semisextile = ta.cross(p1p2,30)
sextile = ta.cross(p1p2,60)
square = ta.cross(p1p2,90)
trine = ta.cross(p1p2,120)
inconjunct = ta.cross(p1p2,150)
opposition = ta.crossover(AL.AngToCirc(long1_out - (interplanet?long2_out:0)),180)

bg_col = conjunction ? color.red : semisextile ? color.orange : sextile ?


color.yellow : square ? color.green : trine ? color.aqua : inconjunct ?
color.navy : opposition ? color.purple : na
bgcolor(color.new(bg_col,80), offset=-1, show_last=showlast)

plotshape(conjunction, "Conjunction", shape.labelup, location.bottom,


color=color.new(color.white,100),size=size.tiny, offset=-1, text="☌",
textcolor=bg_col, show_last=showlast)
plotshape(semisextile, "SemiSextile", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="⊻",
textcolor=bg_col, show_last=showlast)
plotshape(sextile, "Sextile", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="🞶",
textcolor=bg_col, show_last=showlast)
plotshape(square, "Square", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="□",
textcolor=bg_col, show_last=showlast)
plotshape(trine, "Trine", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="△",
textcolor=bg_col, show_last=showlast)
plotshape(inconjunct, "Inconjunct", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="⊼",
textcolor=bg_col, show_last=showlast)
plotshape(opposition, "Opposition", shape.labelup, location.bottom,
color=color.new(color.white,100),size=size.tiny, offset=-1, text="☍",
textcolor=bg_col, show_last=showlast)

// EoS made w/ ❤ by @BarefootJoey ✌💗📈

You might also like