OPEN-SOURCE SCRIPT
Open Close MA's 📈📉

⸻
📈 Open Close MA’s
This indicator helps you see the relationship between the market’s open and close prices by tracking them with Moving Averages (MA’s).
4 different Moving Averages can be selected: EMA (Exponential), SMA (Simple), HMA (Hull), and SMMA (Smoothed).
For those who aren’t sure which Moving Average is “right for them”… here’s a basic breakdown:
- Smoothed is the slowest (trendy)
- Simple is less slow
- Exponential reacts faster
- Hull is fast, yet smooth, and can be predictive
Keep in mind, the Length of any Moving Average is essential to the timeframe and strategy you are running.
Visually, this is what the indicator does:
• One line follows the average of closing prices of each candle.
• Another line follows the average of opening prices of each candle.
• When the close average is above the open average → the market is leaning bullish ⬆️.
• When the close average is below the open average → the market is leaning bearish ⬇️.
The indicator makes this easy to see by coloring the area between the two lines green (bullish) or orange (bearish). You can also turn on optional buy/sell markers whenever the two lines cross.
NOTE: Depending on the Base Timeframe field, the two lines crossing can occur in rapid succession, and should not (in and of itself) be considered a reason to enter a trade Long or Short.
⸻
Customization
• Choose between EMA, SMA, HMA, or SMMA.
• Adjust colors and transparency for bullish/bearish zones.
• Optional signal markers show crossover points.
• Base Timeframe is in minutes (default 5m), increase/decrease to match your timeframe for the most responsive Open/Close Moving Averages along those candles. For longer term trend information, increase beyond your timeframe (example: 30m setting on a 5m chart).
⸻
[Technical Breakdown]
• Close MA (c) and Open MA (o) are calculated separately using selected MA type.
• Dynamic length (len_i) scales based on base timeframe input (default 5m), so the smoothing adapts intelligently across different chart timeframes.
• Bull/Bear bias = c > o. The fill between the two lines switches colors accordingly.
• SMMA is implemented as a recursive calculation (similar to TradingView’s RMA, but explicitly coded here).
• Buy/Sell markers are triggered on ta.crossover(c, o) and ta.crossunder(c, o).
⸻ End of Line 📉 ———
📈 Open Close MA’s
This indicator helps you see the relationship between the market’s open and close prices by tracking them with Moving Averages (MA’s).
4 different Moving Averages can be selected: EMA (Exponential), SMA (Simple), HMA (Hull), and SMMA (Smoothed).
For those who aren’t sure which Moving Average is “right for them”… here’s a basic breakdown:
- Smoothed is the slowest (trendy)
- Simple is less slow
- Exponential reacts faster
- Hull is fast, yet smooth, and can be predictive
Keep in mind, the Length of any Moving Average is essential to the timeframe and strategy you are running.
Visually, this is what the indicator does:
• One line follows the average of closing prices of each candle.
• Another line follows the average of opening prices of each candle.
• When the close average is above the open average → the market is leaning bullish ⬆️.
• When the close average is below the open average → the market is leaning bearish ⬇️.
The indicator makes this easy to see by coloring the area between the two lines green (bullish) or orange (bearish). You can also turn on optional buy/sell markers whenever the two lines cross.
NOTE: Depending on the Base Timeframe field, the two lines crossing can occur in rapid succession, and should not (in and of itself) be considered a reason to enter a trade Long or Short.
⸻
Customization
• Choose between EMA, SMA, HMA, or SMMA.
• Adjust colors and transparency for bullish/bearish zones.
• Optional signal markers show crossover points.
• Base Timeframe is in minutes (default 5m), increase/decrease to match your timeframe for the most responsive Open/Close Moving Averages along those candles. For longer term trend information, increase beyond your timeframe (example: 30m setting on a 5m chart).
⸻
[Technical Breakdown]
• Close MA (c) and Open MA (o) are calculated separately using selected MA type.
• Dynamic length (len_i) scales based on base timeframe input (default 5m), so the smoothing adapts intelligently across different chart timeframes.
• Bull/Bear bias = c > o. The fill between the two lines switches colors accordingly.
• SMMA is implemented as a recursive calculation (similar to TradingView’s RMA, but explicitly coded here).
• Buy/Sell markers are triggered on ta.crossover(c, o) and ta.crossunder(c, o).
⸻ End of Line 📉 ———
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。