soulytion.de souly's coding-for-trading solutions Sat, 15 Feb 2020 23:41:58 +0000 en-US hourly 1 https://wordpress.org/?v=4.9.4 Update on S&P and 26 month cycle, 7 year cycle and Bradley /archives/209 /archives/209#respond Tue, 20 Feb 2018 19:22:18 +0000 /?p=209 This is a follow-up to the cycle analysis posted a month ago. There we saw that the 26 month and 7 year cycle have been the dominant cycles of the S&P 500.

The chart below zooms in and shows the S&P 500 for the last two years (white) and the 26 month cycle (blue), the 7 year cycle (orange), and the inverted standard Bradley (red).

The 7 year cycle, which worked almost perfectly in the last few year, shows a multi-month top right now.

The 26 month cycle is in the middle of its weakest phase of the cycle, until April.

The Bradley had it’s most significant extreme of the winter half year exactly at the time of the high of the S&P.

 

Screen Shot 2018-02-19 at 5.58.49 PM

 

 

 

]]>
/archives/209/feed 0
Heliocentric Bradley vs Gold and Bonds /archives/200 /archives/200#respond Mon, 22 Jan 2018 04:07:50 +0000 /?p=200 The Bradley Siderograph ([PI] Bralkey) can be applied to a variety of markets – sometimes with amazing results. In this article you can see the geocentric Bradley with default settings, projected on a Gold (@GC) and Bonds (@TY) charts. The Bradley is red and the market price is white. The overlap for the last 4 years – in particular for Gold – is mind blowing: important turning points and the market direction were predicted with an astonishing precision (note that the red plot was defined 70 years ago).

For 2018 the geocentric Bradley predicts an up-move until the mid of the year, followed by an extended down-move.

Here are the charts:

Gold future (@GC continuous contract)

Screen Shot 2018-01-21 at 3.07.31 PM

US-Bonds (10 years, @TY continuous contract)

Screen Shot 2018-01-21 at 3.24.58 PM

]]>
/archives/200/feed 0
Cycle Analysis S&P500 /archives/159 /archives/159#respond Tue, 16 Jan 2018 06:18:43 +0000 /?p=159 In this article, I study long term cycles and cyclic behavior of the US stock market. The aim of the study is identification of dominant and practically useful cycles. In particular, I’m interested in cyclic behavior that is projected to appear in the next 6-12 months.

Therefore, in the first part of this article I apply offline math and Python scripting to identify important cycles. In the second part I use my [PI] cycle analyzer indicator in Tradestation to assess the quality of the identified cycles in context of real recent market data.

The underlying data for this study is the S&P 500 (SPX) since 1960. The following chart shows the logarithmic SPX over that time span.

log_reg

The chart also shows the regression line (blue) over the entire period. This regression line is the long term average trend (LTAT). The market price (naturally) oscillates above and below that LTAT. The oscillation for the last 65 years is isolated and shown in the following plot:

sfit

Now, relative to the LTAT, we can see that the market was expensive at the end of the 1960s and in 2000, and it was cheap at the early 1980s and around 2010.
While a long time prediction based on this limited amount of data is not very meaningful, let’s try it anyway. In fact the data bluntly indicates the presence of a 30 year (+-) cycle, with highs in 1970 and 2000 and lows in 1980 and 2010. I’ve added such a manual fit as (green) sine curve to the plot. I also added a mathematical (curve fitted) fit, which is closer to a 38 year cycle.

The conclusions from this first exercise are:
1. For really long time analysis we need way more data (duh)
2. From the data we see, we can derive a 30-40 year cycle which now in 2018 is closer to the bottom than to the top
3. By no means we can consider the current market prices as overly expensive – because we are merely at the center of the LTAT
4. If the cycle is true and fully unfolds, we can expect the SPX at least to double (rather triple) in the next 10 years

At this point our approximation is composed of the LTAT and the 30 year cycle – which is pretty coarse and not really useful for a 6-12 month window. To refine the approximation and find smaller cycles we can repeat the curve fitting by:
1. Get the difference between approximation and actual market price
2. Find a wave form that matches the difference as good as possible
3. Apply the difference composition
And start over again – up to a point of demising return.

As a first example, a composed approximation of a 38 year, 15 year and 7 year cycle, is shown as the green line in the chart below:

fit123

While the incremental fitting is mathematically interesting, its practical value seems to be limited. Firstly, the identified cycles change too rapidly with minor changes in equations or signal (because we calculate with errors of errors of errors). And second, while in average the approximation looks close to the actual market, in detail the derivations are significant. For example for the last two years the approximation indicated a down move which clearly was not seen in the actual market behavior.

So instead of having a composed signal, I rather want to study the cycles individually. The previous manual steps already pointed towards 7, 15, 38 years. But are those cycles really more dominant than others? And are there other, better matching cycles? To answer this question, I performed a spectral analysis of the (de-trended logarithm) underlying data. The result is a plot that shows the determined significance for each frequency. I already converted it to an annual period in the following plot.

cycles_anno

The dominant cycles are:

  • 2.16 years (26 months)
  • 3.6 years (43 months)
  • (exactly) 7.0 years
  • 9.8 years
  • 14.1 years
  • 31.1 years

 

The interesting (and surprising) results are:

  • No (obvious) political cycles (4, 5, 8 years), also no significance for the saisonal 12 month cycle.
  • No (obvious) planetary cycles (though the 2.16a cycle is very close to the 2.14 years of synodic Mars)
  • The results are close to Tessaleno C. Devezas study on the historical GDP growth rates. Devezas identified the frequency peaks: 7.5, 15, 32 and 52 years.

 

Back to the charts

In the following I study the six identified six cycles on real recent market data. The goal is to see how the cycles worked out recently and what they predict for the near future.

I apply my [PI] Cycle Analyzer, which computes a the average price behavior for a given cycle length. I put the cyclic signal on top of the market data to get a quick visual assessment whether or not the market really picked up the cycle. The shown cycles are de-trended (i.e. it does not show the overall market up-trend) and are vertically stretched (i.e. it does not reflect actual prices). The cycles are intended to show relative market strength and weakness, originating from the cycle. Please also note that no single cycle is going to drive the market on its own.

 

2.16 year cycle

The following chart shows the last 5 years of the SPX and the 26 month cycle.  Even though the market was in a permanent up move, we see that all major correction in that time span are in sync with the down moves of the 26 month cycle (highlighted blue circles). While the pattern has diverged a bit in fall last year, the cycle is in sync with the steep up-move since October. For the next three months the cycle shows relative weakness, with a first low in Spring and a second low at the end of the year.

Screen Shot 2018-01-13 at 9.03.05 PM

7 year cycle

The 7 year cycle, as shown in the chart below for the last 40 years, has a remarkable quality in timing market strength and weakness. It’s tops were in sync with the 2000 and 2007 market tops. The latest top was in sync with the 2014/16 market consolidation. The 7 year cycle is the only cycle that correctly showed strength for all 2017. For 2018 it shows a smaller consolidation similar to 2011 or 2004 – which might result in a 12-18 months sideways movement . The next significant top is in 2021.

Screen Shot 2018-01-10 at 12.40.34 PM

14.1 year cycle

The 14 year cycle combines alternating 6 and 8 year cycles. The cycle finished it’s 8 year sub-cycle with a low at the end of 2016 – and shows an up-move since then. The cycle shows a correction in the second half of 2018 – but the top of the cycle (not in the chart) is expected for 2021.

Screen Shot 2018-01-10 at 12.51.01 PM

31.1 year cycle

The 31 year cycle as shown in the next chart is not really useful  in the selected settings. Since it only went through two iterations, it mostly mirrors the training data. Recently, the 31 year cycle correctly anticipated the 2014/16 consolidation and the continuous upmove since then. Notable is that later this year we get to the cycle position of the 1987 crash.

Screen Shot 2018-01-10 at 12.56.14 PM

3.6 and 9.8 year cycles.

The 3.6 cycle is in an up-move since 2017 and is going to top early 2019. The 9.8 year cycle made its top in 2017 and is descending until 2023, while a first acceleration of the down-move finishes at the end of 2018. Overall the two cycles do not match very well, which was already indicated in the relative weakness in the spectral analysis.

Screen Shot 2018-01-10 at 12.36.38 PM Screen Shot 2018-01-10 at 12.47.50 PM

 

Conclusions

The market seems to be in the middle of a boom that is going to last another 10 to 15 years. That is why, even the overlapping declines in multiple smaller cycles (as in 2014-2016) is nothing more than a small dent – and overlapping ascents of multiple cycles (as in 2017) are overly powerful. 2018 shows consolidations in the recent high quality cycles (26 months, 7 years) with correlating lows in spring and in late fall of 2018. However, the overall up-trend shouldn’t be challenged before 2021.

As conclusion, my best guess for 2018 (and solely based on the cycles discussed in this article) is a path similar to 2011: consolidation in Spring, then sideways over Summer and a sell-off in Fall.

]]>
/archives/159/feed 0
Restart 2018 /archives/155 /archives/155#respond Thu, 11 Jan 2018 18:21:15 +0000 /?p=155 This page has been inactive for a while. I am sorry. I was pretty busy with my research position and just had little time for trading, research about trading, programming, or even writing about trading. But I am back – and soon new content will follow. My article about trading cycles should appear in the next few days. I also plan to go through my previous articles and see how my ideas and suggestions of the past worked out in the last few years.

So stay tuned

]]>
/archives/155/feed 0
Commitment of Traders: Sell signal in my new COT indicator /archives/115 /archives/115#respond Sun, 10 Mar 2013 00:44:00 +0000 /archives/115 Last year I already wrote about the Commitment of Traders (COT) reports and how they can be applied to improve trading results. I showed that for the S&P500 the Large traders are the ones to watch – because in this market they have the tendency to jump on the train right at the very end of a trend.

Now, I put my knowledge about COT in one indicator that gives a clear objective indication what the COT data means. With the build-in COT data delivered by Tradestion this is a very convenient way of making sense of the data. The results so far is shown in the following chart. The most interesting indication is shown in the bottom window. The windows above just show intermediate values and tell where the final result comes from.

sn_cot_1303.png

The indicator takes the net value of the COT postions of small and large contracts for the S&P500, analyzes the relative positions of large and commercial traders, as well as the momentum of the positions- and reports in form of a simple signal ranging from -4 (strong sell) to +4 (strong buy).

Yesterday’s COT update brought the first signal this year. Large traders entered the market this week heavily, resulting in a -2 reading in the indicator. This is the strongest sell signal since September last year.

Combining it with planetary (retrograde! Mercury and conj. Venus in trine/square to Jupiter/Saturn) and cycle information (weak the next four weeks) this is a signal one maybe should not ignore. However, dynamic in the stock markets is good, volume does not show weakness, I do not see weakness or divergencies anywhere, and there is future expiration in few days – makes it a bold move to short now.

]]>
/archives/115/feed 0
Mid-November Low in S&P500 /archives/112 /archives/112#respond Fri, 30 Nov 2012 17:19:13 +0000 /archives/112 The following charts show how the planetary idicators could help to time the exit of the short position we entered at the quadruple ingress early October.

mars_turn.png

The S&P500 (chart of the index) went  down to the Mars ephemeris line and bounced back the very day Mars had its ingress to Capricorn. Additionally we had a small peak in the Bradley indicator. Reason enough to take this low seriously – even though this time we had no peak in PI Aspects.

This also happened on an important absolute Square-of-Nine prive level as shown in the following chart.

esz12-sq9.png

I will discuss the Square of Nine indicators for price and time in more detail soon as they are a valuable addition to the planetary indicators.

]]>
/archives/112/feed 0
Book recommendation: Timing Solutions for Swing Traders /archives/109 /archives/109#respond Fri, 26 Oct 2012 02:55:11 +0000 /archives/109 In this book Robert Lee and Peter Tryde show how financial astrology can be embedded in solid trading approaches without drifting into pseudo-scientific esoteric. It does not come up with some magic that tells you the price of a market in six months – no it helps to make good decision in the markets with standard indicators, supported by timing information derived from the planets. If you follow my work then you know that this is what the planetary indicators are made for. So I am very glad to see some charts with the PI indicators inside.

If you are looking how to apply the PI package in a solid way, go ahead and get the book. It doesn’t cost a fortune and definitely is worth the money.

It has been published by WILEY and you can find it on AMAZON as hardcover and ebook.

]]>
/archives/109/feed 0
S&P: Time for a Turn? /archives/108 /archives/108#respond Sat, 06 Oct 2012 04:24:24 +0000 /archives/108 A simple approach to use astro indicators is to wait for situations when several indicators deliver important signals at the same time – and then speculate for something important to happen.

Often this ‘something’ is a turn in the markets. But one not forget about the option of a market breaking free.

As shown in the chart below, some very importnat astro indicators delivering signals: first there are six active important inter-planet aspects; second, there are four planets having an ingress (that is changing signs), and third, Jupiter is turning retrograde. This all happens while the S&P500 price is in a cluster of planetary epheremis lines (direct projection modulo 180).

spx_121005.png

This means we have a lot of firepower for important action in the market. With the Saturn line just ahead and slightly below the September high, the S&P looks quite vulnerable. This is supported by cycle analysis which indicates weakness throughout October – maybe I write more about it in the future. However, if the market breaks through the roof it’s easy to recognize and to react accordingly.

]]>
/archives/108/feed 0
Indication of Planetary Returns in Tradestation /archives/104 /archives/104#respond Mon, 24 Sep 2012 22:47:47 +0000 /archives/104 The theory of Planetary Returns follows the notion that important situations in the life of a company, a country or a person repeat with a period that is determined by the time a planet needs to travel around the Sun or (virtually) the Earth. That means, when a planet is back at the same position it had when a pivotal event took place, we can expect a similarly important event again.

In the simplest case, it relates to the Earth traveling around the Sun for what it needs exactly one year. In this case the Planetary return corresponds to a birthday of a company or person – but also signals for seasonal rules like ‘Sell in May’.

Planetary Returns are not only valid for the Earth/Sun cycle but also (and in particular) for the outer planets. But indeed, such non-yearly planetary cycles are not as easy to observe…

Actually, it is with the [PI] Planet Filter indicator as it is part of the standard package of PlanetaryIndiactors for Tradestation.  [PI] Planet Filter  highlights dates of full planetary return to a given date or just fractions (180 degrees or 90 degrees or less) of a complete cycle.

In the following I discuss two ways how to use this function:

Forward projection from a given point in history:

Here it is the basic notion that whenever a planet comes back to the position it had on a specific pivotal event, chances increase an event with similar importance may happen.

Starting points can be:

  • important highs or lows in the market
  • date of first listing of the stock
  • date of formation of the organization

To see the planetary returns for such dates in Tradestation, just add the indicator [PI] Planet filter, select the planet, and n the parameter relativeToDate set the date of the pivotal starting point.

The following example chart shows the planetary returns of Mars starting with the high in the S&P500 in the year 2000. It is observable that the S&P soared into each return since then. Even more interesting, most important highs in the market since then took place exactly on a Mars return to the 2000 peak.

mars_planetary_return.png

Backward from today (or any other date)

The second way of application for the Planetary returns is to go backward from a given date. The idea here is to highlight where in history the selected planet had the same position in the sky as it has today or on any other chosen date. If the highlighted dates coincide with important points in the market it gives some indication that the selected date can be an important point of similar quality.

The following example shows two instances of the [PI] Planet Filter going backward from October 1st this year. The blue lines show the preceding Earth returns, the yellow lines show the 90 degrees Jupiter returns. The lines coincide with several important points (mostly highs, but also lows) in the S&P in near history. This implies that chances for a market turn around this time are above average.

jupearth_plreturns.png

I hope the examples could help to set up and use charts for planetary returns. If you have questions or maybe even better examples just contact me or leave a comment.

]]>
/archives/104/feed 0
Paintbar Study Showing when a Planet is in a Certain Sign /archives/102 /archives/102#respond Fri, 04 May 2012 20:47:30 +0000 /archives/102 I got the request to code a paintbar study that would paint the bars while a planet was in a certain sign. Say like when Mars is in Taurus?
And here it is: It highlights the bar for which a planet (you can set) is in a certain sign. The example chart highlights Mars in Taurus.

paintbar.png

You can download the indicator from

[PI] PLANET SIGNS.ELD

This paintbar study works when the planetary indicator package is installed.

It is compiled for TradeStation 9. If ou use an earlier version I can convert it. Please let me know then.

And of course other great ideas for thing that could be done with the planetary indicator library are highly appreciated.

]]>
/archives/102/feed 0