Free code Mars-Jupiter aspects
My AI Tests Famous Trading Systems
Mars-Jupiter aspects, free for TradingView and Python
My AI coding agent rebuilt the Mars-Jupiter aspects of financial astrology from public sources. It found every aspect in NASA's public ephemeris, wrote its test plan before the first run, tested the aspects on 50 markets against 1,000 shifted calendars, and checked its own work. This is the code it wrote: a TradingView indicator and the full Python test.
Download the code (zip, 149 KB) Source on GitHub
Free, with no sign-up. This is an experiment in what AI agents can build and verify, not trading advice.
The honest result
Mars-Jupiter aspects did no better than random dates. Across 50 markets, the average aspect trade lost 0.36% after costs, worse than 84% of 1,000 shifted calendars. As one portfolio, it lost 1.1% a year after costs. SPY, bought and held, made 8.7% a year, price only.
−0.36%
average trade after costs, all 50 markets. The shifted calendars averaged +0.01%.
16%
of 1,000 shifted calendars did worse than the real aspect dates. A real edge needs 95%.
−1.10%
a year after costs. Equal-weight portfolio of all 50 markets. SPY, bought and held, made +8.7%.
0 of 50
markets beat 95% of their own shifted calendars. Luck alone gives 2 or 3.
| Group | Average trade after costs | Shifted calendars, mean | Calendars beaten |
|---|---|---|---|
| All 50 markets | −0.36% | +0.01% | 16% |
| Stock ETFs (30) | +0.14% | −0.03% | 67% |
| Bond ETFs (8) | −0.04% | −0.09% | 68% |
| Commodities (7) | −0.52% | −0.08% | 15% |
| Crypto (5) | −3.62% | +0.58% | 3% |
- The test used 50 markets picked by a rule written down first: the 30 largest stock ETFs, the 8 largest bond ETFs, 7 commodity funds and the 5 largest coins. Each has its full daily price history (SPY from January 1993) to 18 November 2026. Prices are split adjusted, not dividend adjusted. Costs are 0.05% of the traded value on each side.
- The trade enters at the open of the first trading day on or after an exact aspect. It is long after a conjunction, sextile or trine, and short after a square or opposition. It exits at the open 10 trading days later. There were 144 aspects from January 1993 to November 2026.
- A shifted calendar moves every aspect date by the same random number of days. It keeps the count, the spacing and the order of the aspects, and breaks only their link to the planets. The rules were written down before the first run.
- Aspects did not come with more turning points. 38.9% of aspects had a 10-day high or low within 3 trading days, against 40.6% of random dates. Daily moves were not bigger near an aspect.
- One pattern stood out: stock ETFs rose 2.0% in the 10 days after a sextile, better than 99% of shifted calendars. It was one of 75 comparisons, it leans on the sextile of 27 October 2008, and from 2010 to 2026 it beat only 88%.
- The markets were picked by today's size, which favors winners a little. It does not favor aspect dates over random dates, because both are tested on the same markets.
- Past results do not predict future results.
Load it in TradingView
About two minutes. You do not need to code.
- Open a chart at tradingview.com. A free account is enough.
-
Load the symbol
SPYand set the timeframe to daily (1D). -
Leave dividend adjustment off. The
ADJbutton at the bottom right of the chart must not be highlighted. - Open the Pine Editor tab at the bottom of the screen and delete the text in the editor.
-
Open
mars-jupiter-aspects.pinein a text editor, copy all of it, and paste it into the Pine Editor. - Click Save, then click Add to chart.
The indicator shades the bar of each aspect and labels it with the exact time in UTC. Dashed lines mark the next four aspects ahead of price, and a table at the top right shows the test trade. On SPY daily, the table shows about 142 closed trades, an average trade of about 0.0% after cost, and about 49% winners. spy-check.md in the zip lists the dates to expect.
What is in the zip
mars-jupiter-aspects.pine- The TradingView indicator in Pine Script v6. It marks every Mars-Jupiter aspect from 1990 to 2035 and can test the trade on any chart.
README.md- How to load the indicator, read the marks and change the settings. It lists every source.
spy-check.md- The aspect dates and the test numbers to expect on SPY.
python/- The full test: the aspect dates from NASA's ephemeris, the data download, the test plan, the shifted calendars and the checks.
Run the Python backtest
From the python/ folder, with Python 3.12 or later:
pip install -r requirements.txt
python fetch_data.py data
python run_tests.py .
python posthoc.py .
python benchmarks.py .
python validate.py .
python spy_check.py SPY
How the agent checked its work
- A second ephemeris (Swiss Ephemeris), built a different way, found the same 192 aspects from 1990 to 2035. The largest time gap is 1.5 minutes. The conjunction dates match those published by NASA, EarthSky and Time and Date.
- A second implementation, written separately, makes the same trades on SPY (142), Bitcoin (47) and TLT (99), with the same dates, sides and returns.
- Every trade enters on the first bar on or after its aspect date. Cutting the data at 40 random dates changes no earlier trade, so no trade uses future prices.
- A second agent reviewed the code cold. It found no bug in the results, but two checks that could never fail. The agent made them stricter, added a third check, and ran everything again. No headline number changed.
The aspects are the standard five: conjunction 0°, sextile 60°, square 90°, trine 120° and opposition 180°. The planet positions come from NASA JPL's public DE440s ephemeris, computed with Skyfield. The README lists every source, including the claims from Raymond Merriman, David Williams and Matlock.
The video
My AI Tested Mars-Jupiter Aspects on 50 Markets
The video is not live yet. The link appears here when it is.
The channel on YouTubeDownload the code All free code
This is an experiment in what AI agents can build and verify, not trading advice. The code is free to use, change and share.