INVITE-ONLY SCRIPT
Percent Rank Strategy - Level 1

This strategy is based on the Percent Rank math, a statistical measure that evaluates how the current price compares to its historical prices over a specified lookback period.
In simple terms, Percent Rank tells you the percentile position of the current price within a recent window, for example, a value of 80% means the price is higher than 80% of the previous prices in that period, while 20% means it’s lower than 80% of them.
The strategy uses this concept to determine the market regime, whether price is high, low, or neutral relative to its recent range, and acts accordingly:
Bull (green) – when the price percent rank is usually above 50% the price is normally high, and the strategy favors long entries.
Bear (red) – when the price percent rank is usually below 50% the price is normally low, and the strategy favors short entries.
Range (brown) – when the percent rank is in between those 2 conditions, we detect range, and no trades are initiated.
The transition between these regimes depends mainly on 3 key parameters.
The first parameter controls the maximum lookback period for the percent rank array and so the maximum cycle length.
The second controls how much range is detected in bull conditions; it changes the transition from bull to range conditions. The bigger it is, the less bull and the more range.
The third parameter is similar to the second, but for bear conditions. The smaller it is, the less bear and the more range conditions are detected.
The user can configure the strategy to run long-only, short-only, or both directions, depending on the market or preference. In addition to the core regime logic, the strategy includes several risk and trade management controls that are featured in all my strategies.
Four oscillators are also integrated into the logic to detect short-term overbought and oversold conditions. These help the strategy avoid entering or exiting a trade when the price has already extended too far in one direction, improving timing and potentially reducing false entries and exits. When overbought or oversold are detected, a red or green dot appears on the chart.
The script is designed to be flexible across different assets and timeframes. However, to achieve consistent results, it is important to optimize parameters carefully. A recommended workflow is as follows:
Disable the walk-forward option during the optimization phase.
Optimize the first main parameter while keeping others fixed.
Once a satisfactory value is found, move to the second parameter.
Continue the process for subsequent parameters.
Optionally, repeat the full sequence once more to refine the results.
Finally, activate walk-forward analysis and check the out-of-sample results.
This strategy is published as invite-only with hidden source code. Access may be granted upon request for research or evaluation purposes. It is part of a broader collection of technical analysis strategies I have developed, which focus on regime detection and adaptive trading systems.
There are five levels of strategy complexity and performance in my collection. This script represents a Level 1 strategy, designed as a solid foundation and introduction to the framework. More advanced levels progressively add greater complexity, adaptability, and robustness.
When multiple strategies are combined under this same framework, the results become more robust and stable. In particular, combining my suite of technical analysis strategies with my macro strategies and alternative data strategies, such as onchain for cryptocurrencies. It creates a multi-layered system that adapts across regimes, timeframes, and market conditions.
In simple terms, Percent Rank tells you the percentile position of the current price within a recent window, for example, a value of 80% means the price is higher than 80% of the previous prices in that period, while 20% means it’s lower than 80% of them.
The strategy uses this concept to determine the market regime, whether price is high, low, or neutral relative to its recent range, and acts accordingly:
Bull (green) – when the price percent rank is usually above 50% the price is normally high, and the strategy favors long entries.
Bear (red) – when the price percent rank is usually below 50% the price is normally low, and the strategy favors short entries.
Range (brown) – when the percent rank is in between those 2 conditions, we detect range, and no trades are initiated.
The transition between these regimes depends mainly on 3 key parameters.
The first parameter controls the maximum lookback period for the percent rank array and so the maximum cycle length.
The second controls how much range is detected in bull conditions; it changes the transition from bull to range conditions. The bigger it is, the less bull and the more range.
The third parameter is similar to the second, but for bear conditions. The smaller it is, the less bear and the more range conditions are detected.
The user can configure the strategy to run long-only, short-only, or both directions, depending on the market or preference. In addition to the core regime logic, the strategy includes several risk and trade management controls that are featured in all my strategies.
Four oscillators are also integrated into the logic to detect short-term overbought and oversold conditions. These help the strategy avoid entering or exiting a trade when the price has already extended too far in one direction, improving timing and potentially reducing false entries and exits. When overbought or oversold are detected, a red or green dot appears on the chart.
The script is designed to be flexible across different assets and timeframes. However, to achieve consistent results, it is important to optimize parameters carefully. A recommended workflow is as follows:
Disable the walk-forward option during the optimization phase.
Optimize the first main parameter while keeping others fixed.
Once a satisfactory value is found, move to the second parameter.
Continue the process for subsequent parameters.
Optionally, repeat the full sequence once more to refine the results.
Finally, activate walk-forward analysis and check the out-of-sample results.
This strategy is published as invite-only with hidden source code. Access may be granted upon request for research or evaluation purposes. It is part of a broader collection of technical analysis strategies I have developed, which focus on regime detection and adaptive trading systems.
There are five levels of strategy complexity and performance in my collection. This script represents a Level 1 strategy, designed as a solid foundation and introduction to the framework. More advanced levels progressively add greater complexity, adaptability, and robustness.
When multiple strategies are combined under this same framework, the results become more robust and stable. In particular, combining my suite of technical analysis strategies with my macro strategies and alternative data strategies, such as onchain for cryptocurrencies. It creates a multi-layered system that adapts across regimes, timeframes, and market conditions.
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청을 보내고 승인을 받아야 합니다. 일반적으로 결제 후에 승인이 이루어집니다. 자세한 내용은 아래 작성자의 지침을 따르거나 mks17에게 직접 문의하세요.
트레이딩뷰는 스크립트 작성자를 완전히 신뢰하고 스크립트 작동 방식을 이해하지 않는 한 스크립트 비용을 지불하거나 사용하지 않는 것을 권장하지 않습니다. 무료 오픈소스 대체 스크립트는 커뮤니티 스크립트에서 찾을 수 있습니다.
작성자 지시 사항
Contact me privately to know how to test and use this strategy
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
초대 전용 스크립트
이 스크립트는 작성자가 승인한 사용자만 접근할 수 있습니다. 사용하려면 요청을 보내고 승인을 받아야 합니다. 일반적으로 결제 후에 승인이 이루어집니다. 자세한 내용은 아래 작성자의 지침을 따르거나 mks17에게 직접 문의하세요.
트레이딩뷰는 스크립트 작성자를 완전히 신뢰하고 스크립트 작동 방식을 이해하지 않는 한 스크립트 비용을 지불하거나 사용하지 않는 것을 권장하지 않습니다. 무료 오픈소스 대체 스크립트는 커뮤니티 스크립트에서 찾을 수 있습니다.
작성자 지시 사항
Contact me privately to know how to test and use this strategy
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.