Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
similarity metrics applied to GLD & GDX

UPDATE - please ignore the attached backtest (bug) and see the one in the next post.

I've been working on a pattern matching algorithm based on text string compression. I've attached a demonstration, comparing the coded daily prices of GLD & GDX, over a 90-day sliding window. The similarity metrics, CDM & NCD, are defined in the first reference below. The second reference describes the coding scheme.

References:

Ming Li; Xin Chen; Xin Li; Bin Ma; Vitanyi, P.M.B.; , "The similarity metric,"
Information Theory, IEEE Transactions on , vol.50, no.12, pp. 3250- 3264, Dec. 2004.
http://homepages.cwi.nl/~paulv/papers/similarity.pdf

Lin, Jessica, et al. "A symbolic representation of time series, with implications for
streaming algorithms." Proceedings of the 8th ACM SIGMOD workshop on Research issues
in data mining and knowledge discovery. ACM, 2003.
www.cs.ucr.edu/~stelo/papers/DMKD03.pdf

1 response

Bug-free backtest.