Trading strategy: Sinewave Market Cycles


Engineer Dr. John Ehlers is an analyst who has a done a lot of research into market cycles. He is one of the first developers of a computerized trading system, called MESA. Dr. Ehlers elaborated on his theories in the 2006 book "Cybernetic analysis for Stocks and Futures". He shares the code of some of his interesting indicators. Author and trader Claus Grube has translated these into algorithms for NanoTrader Full.

One way of analyzing the market is to detect the cycle in which the market is periodically moving. Most of the times there are multiple cycles which overlap. It is difficult to detect these cycles so Ehlers concentrates on the market's main cycle. His favorite indicator is called Sinewave cyber. It calculates the "Dominant Cycle". Sinewave detects a kind of sinus waves in which the market runs up and down. There are no parameters to adjust in Sinewave. Its outcome will be different, however, depending on the time period used. Author Clause Grube works with a time aggregation of half a day (28x15') on the Eurostoxx 50 market index.

Suitable for : Any market index (FTSE, CAC, DAX ...)
Instruments : Futures and CFDs
Trading type : Swing trading
Trading tempo : 3-4 Trades per week
The strategy : Video
Using NanoTrader Full : Manual or fully automated

The strategy in detail

Ehlers' Sinewave oscillates between -1 and +1. Signals are generated by a "predecessor" (the result of calculations is a sinus of a specific angle and the trigger is a sinus of this angle but 45 degrees earlier). It is interesting to note that both Sinewaves have been designed to not cross in trending times. Therefore we do not need a trend filter to avoid non-valid signals.

Ehlers has made use of the Hilbert transformation for markets. Ehlers assumes that the market moves in cycles most of the times. Exceptions are trend times. There is a dominant cycle, which can be detected. This cycle is calculated by Sinewave. The velocity and frequency of this cycle can change frequently. Sinewave's specialty, however, is to immediately adapt to velocity and frequency changes.


When to open a position?

When the Sinewaves cross a new position is opened and the existing position is closed. A long position is converted into a short position. A short position is converted into a long position. As a consequence there is always an open position.

Trading strategy: Sinewave Market Cycles

In this screenshot of the Eurostoxx 50 market index the Sinewave crosses indicate the market cycles quite nicely. The Sinewave is set on a half day aggregation (28x15' i.e. 1/2 day).

Trading strategy: Sinewave Market Cycles

In this screenshot, which has exactly the same settings as the previous screenshot, it is clear that it is also possible to have one or two cycle changes within a day.


When to close a position?

As explained above, when the Sinewaves cross a new position is opened and the existing position is closed.



The Sinewave market cycles strategy developed by Dr John Ehlers gives variable results. The results go from astonishing to bad. It is not a robust strategy but given the sometimes spectacular results it is worthy of further study and improvement. Author Claus Grube did just that and added a trend filter as well as profit targets and stop loss criteria.

Trading strategy: Sinewave Market Cycles

Grube's results of a 10-year data study of the 15-minute Eurostoxx 50 index can be seen in this screenshot.  The filter is a MACD combination (11 and 66 periods EMA, 89 quarters of an hour aggregation). The profit target is 10 times the ATR (calculated on 280 x 15’ aggregation).

It appears the strategy works well in times of a strong market decline. At the time of transition from bullish to bearish in 2007 draw downs are large. With the filter in place the strategy only generates a signal every two weeks. Positions remain open for several days. The hit ratio is around 70%.

Attention. When applying Grube’s strategy to other market indices, his filters and aggregations would require substantial modification.

Practical implementation

In NanoTrader Full follow these steps:

  • Choose the instrument you wish to trade.
  • Open a chart with the template study "WHS Sinewave".
  • Semi-automated trading? Simply activate the TradeGuard+AutoOrder or the AutoOrder function.