Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (frutza, Quad, AndrewAMD), 385 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Cycles and spectral analysis #449343
03/16/15 06:42
03/16/15 06:42
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I had meant to start this thread last week, but my wife and I were busy having our first child. laugh

GPEngine made a very interesting post about the ephemeral and fickle nature of market cycles detected by Zorro's Spectrum function. He found that dominant cycles detected over a large period of time are not necessarily replicated in shorter time spans within the whole series, and that dominant cycles reported by the Spectrum function tend to be biased towards whatever was the strongest cycle (that is, greatest amplitude) rather than that which was the most consistent.
(Please correct me if I am misunderstanding your research, GPEngine).

To me, this suggests a couple of approaches:

1. A tweak to the design of Zorro's Spectrum function, or the addition of a new function altogether that can report the most persistent cycles, rather than the strongest in terms of amplitude. jcl, is this possible?

2. Another approach is analogous to the 'parameterless' strategy that is retrained at regular intervals. If you wanted to use the most tradable cycles in your strategy, you could periodically run the Spectrum function across some recent price history and observe the strongest peaks. Then, using a cycle period detection function (such as DominantPeriod or Ehlers' Autocorrelation periodogram), it would be possible to identify the onset of a cycle with a period that was tradeable in the recent past. Assuming* that the cycle remains significant in the short term, this could be a trading opportunity.

*This assumption may or may not be all that reliable. However, I do think that it would be more reliable if we could use the Spectrum function (or other similar method) to identify the consistent cycles, as well as those with the amplitude peaks.

Using a bandpass or roofing filter to capture a relatively small range of potentially tradeable cycles (say, 15-30 bars for simplicity), we see that for the most part, we can identify some excellent trading opportunities and some very poor trading opportunities. I have found it impossible to construct a strategy that exploits cycles by simply using such a filter. The difficulties as I see them are:

1. Sometimes the trend swamps the cycle. For example in a downtrend, even if you got in at the bottom of a cycle and out at the top, if the downtrend is strong enough you still lose.

2. Sometimes the range of the bars is so wide that you get a similar problem to that described in (1). Ehlers talks about this in terms of the 'signal to noise ratio'.

3. Sometimes it is possible to identify a cycle and enter in a timely manner, but the cycle's amplitude means that it is not tradeable.

If we knew which cycles were recently both persistent and of high enough amplitude, we could potentially use that knowledge as a trade filter to overcome (3).

I realise that there are a number of assumptions in the above, and that some of them may be quite tenuous. I think it would be worth pursuing this avenue of investigation though, since we only need a small edge to make money, and the theory seems to stack up (in my mind anyway).

Re: Cycles and spectral analysis [Re: boatman] #449361
03/16/15 16:06
03/16/15 16:06
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Detecting cycles has the same basic problem as many other trade algorithms. Using a short time period, you can detect cycles fast, but are then not safe against false cycles by random effects. If you sample over a long period, you can better distinguish real market cycles, but they may be over when you start exploiting them.

We will however implement a new spectrum function where you can set up the sample period, so you have at least control over that.

Re: Cycles and spectral analysis [Re: jcl] #449479
03/21/15 14:49
03/21/15 14:49
Joined: Sep 2013
Posts: 504
California
G
GPEngine Offline
User
GPEngine  Offline
User
G

Joined: Sep 2013
Posts: 504
California
Your understanding is correct.

Let's fast-forward and say you get the discovery and detection tools you want. And then you discover that there is a persistent cycle for some wide-enough period which can be detected reliably. And there is enough time remaining to take advantage of it before it disappears.
How do you take advantage of it?
  • Sell at the peaks of a smoothed BandPass(Price, C, 0.5) and buy at the valleys?
  • Synthesize the cycle independently from the series, using sin(Phase)?

Last edited by GPEngine; 03/21/15 15:56.
Re: Cycles and spectral analysis [Re: GPEngine] #449492
03/22/15 09:10
03/22/15 09:10
Joined: Apr 2014
Posts: 482
Sydney, Australia
B
boatman Offline OP
Senior Member
boatman  Offline OP
Senior Member
B

Joined: Apr 2014
Posts: 482
Sydney, Australia
I would use a multi-pronged approach and test the two approaches you mentioned as well as Ehlers' roofing filter tuned to the cycle period. Ehlers recommends a signal line for triggering trades which is simply the indicator crossing itself delayed by one or two bars.

I would also test Ehlers' adaptive RSI and Stochastic tuned to the detected cycle.

It seems to me that these approaches give some very good signals and some very bad ones. But knowing a little more than we currently do about tradeable cycles, I think we could filter at least some of these bad signals. Whether that is enough to make such a system profitable is another question entirely.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1