OPEN-SOURCE SCRIPT
Zen CSC Bar Strategy v1

🧠 Zen Consecutive Bar Strategy — Research Tool (Trend + Reversal)
**Description:**
This strategy is designed as a flexible research tool for studying price behavior following consecutive bull or bear bars. It allows users to explore breakout and reversal scenarios with full control over trade entry and filtering logic.
**🔧 Key Features:**
* **Configurable bar sequence**: Detects customizable streaks of consecutive bull or bear bars.
* **Trend or Reversal mode**: Toggle between breakout-style entries or fade/reversal-style setups.
* **MA-based filter**: Optionally restrict trades to occur above or below the 20-period moving average.
* Longs can be limited to above/below MA
* Shorts can be limited to above/below MA
* **Customizable R-multiple targets**: Choose between 0.5R, 1R, 1.5R, or 2R reward targets.
* **Stop loss logic**: Uses syminfo.mintick to offset stops by 1 tick beyond the pattern high/low.
* **Entry logic**: Buy/Sell either on the close of the setup bar or on breakout beyond high/low.
* **Trade direction**: Enable long-only, short-only, or both.
**📊 Research Use Only:**
This is not a ready-to-trade system. It’s intended to help traders test ideas and collect performance stats under different configurations. Use it to:
* Evaluate the failure rate of open spikes
* Study behavior following strong directional bars
* Compare trend-following vs mean-reversion edge across sessions
**❗Disclaimer:**
This script is for educational purposes only. It does not constitute financial advice. Past performance does not guarantee future results.
**Description:**
This strategy is designed as a flexible research tool for studying price behavior following consecutive bull or bear bars. It allows users to explore breakout and reversal scenarios with full control over trade entry and filtering logic.
**🔧 Key Features:**
* **Configurable bar sequence**: Detects customizable streaks of consecutive bull or bear bars.
* **Trend or Reversal mode**: Toggle between breakout-style entries or fade/reversal-style setups.
* **MA-based filter**: Optionally restrict trades to occur above or below the 20-period moving average.
* Longs can be limited to above/below MA
* Shorts can be limited to above/below MA
* **Customizable R-multiple targets**: Choose between 0.5R, 1R, 1.5R, or 2R reward targets.
* **Stop loss logic**: Uses syminfo.mintick to offset stops by 1 tick beyond the pattern high/low.
* **Entry logic**: Buy/Sell either on the close of the setup bar or on breakout beyond high/low.
* **Trade direction**: Enable long-only, short-only, or both.
**📊 Research Use Only:**
This is not a ready-to-trade system. It’s intended to help traders test ideas and collect performance stats under different configurations. Use it to:
* Evaluate the failure rate of open spikes
* Study behavior following strong directional bars
* Compare trend-following vs mean-reversion edge across sessions
**❗Disclaimer:**
This script is for educational purposes only. It does not constitute financial advice. Past performance does not guarantee future results.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。