Percentile Rank Market FilterA simple script to filter bull and bear markets by using percentile rank filter. Using market regimes to filter by bull/bear/sideways markets helps to understand how your strategy will
behave in various market regimes and allows you to avoid unprofitable regimes and only trade in profitable ones.
The idea of market regime filtering is used in the most successful technical algorithmic trading strategies, as one should always design a trading strategy with a particular market in mind according to trading legend, Larry Connors
Feel free to use this script in your strategies to improve your profits and lower drawdowns.
Sunil
Historical Volatility Percentile FilterThis indicator provides a simple market regime filter for Historical Volatility. Depending on the strategy that you are using, it is useful to know how your strategy will perform at different
ranges of volatility, as this can greatly impact your performance. For instance, some of my long-only mean reversion strategies will only take trades where the volatility percentile is not extremely high, as this can often indicate fundamental changes in the security or the start of a big market correction. Some strategies may work better when volatility is higher
Feel free to use the following code along with your strategies to help improve performance and reduce the volatility of your gains in the long term.