
I made a custom indicator using empirical cumulative distribution function
I use it with split_sequences (Dr. Brownlee’s function) to create moving windows of size 20, then apply ECDF to each window and take the last value (i.e. a rolling ECDF) and reconstruct the original dates
I think it detects market tops and bottoms accurately
https://gist.github.com/thistleknot/05c6dd68aca1e20a9586c08c0f564ba6