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提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。