OPEN-SOURCE SCRIPT
Post 9/21 EMA Cross — Paint X Bars v2.0

# **Post 9/21 EMA Cross — Time Blocks & Session Colors**
This indicator highlights candles after a **9/21 EMA crossover**, but with extra controls that let you focus only on the sessions and time windows that matter to you.
---
## 🔑 What It Does
1. **EMA Cross Trigger**
* Bullish trigger: 9 EMA crosses above 21 EMA.
* Bearish trigger: 9 EMA crosses below 21 EMA.
2. **Bar Painting**
* After a valid cross, the indicator paints a set number of bars (you choose how many).
* You can require the **2nd bar to confirm momentum** (“displacement” filter) so weak signals are ignored.
3. **Time Block Control**
* Define up to **four custom time blocks** (like `08:00–09:30` or `12:00–13:00`).
* Painting only occurs inside those blocks if you enable the filter.
4. **Session-Aware Colors**
* Use one set of bullish/bearish colors for **regular hours**, another set for **pre-market**, and another for **post-market**.
* That way you can instantly see *when* the signal occurred.
---
## 🎨 Visuals
* Candles recolored in your chosen bull/bear colors.
* Optional EMA lines plotted on the chart for reference.
* Different colors for RTH, pre-market, and post-market activity.
---
## ⚙️ Inputs
* **EMA lengths (fast & slow)**
* **Number of bars to paint after a cross**
* **Displacement filter (loose or strict)**
* **Show/hide EMA lines**
* **Up to four custom time blocks** (on/off toggles + start/end times)
* **Bull/bear colors for RTH, Pre, Post**
---
## 📈 Why Use It
* **Clarity** – Only shows cross signals in the hours you actually trade.
* **Focus** – Different colors remind you at a glance whether the move was in pre-market, RTH, or post-market.
* **Discipline** – The optional 2nd-bar displacement filter prevents false starts by requiring real momentum.
---
## 🚨 Practical Use
* Treat the painted window as a **momentum phase**: enter on confirmation, manage risk while bars are painted, and stand aside once painting ends.
* Restrict painting to time blocks that match your personal trading routine (e.g., open drive 09:30–10:00, or late-day momentum 15:00–16:00).
* Use session colors to keep pre/post-market action separate from regular session strategies.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。