OPEN-SOURCE SCRIPT
已更新 Cross PB

This Pine Script v6 indicator identifies potential trend changes using crossovers of two moving averages (fast and slow), enhanced by a candlestick body confirmation mechanism. It provides two distinct signal types for refined entry/exit points.
Key Features:
Dual Signal System Based on Candle Close:
Alert 1 (Buy/Sell): Triggers after a bullish crossover (fast MA crosses above slow MA) AND a bearish candle (close < open) closes below the fast MA. The inverse applies for a sell signal (bearish crossover + bullish candle + close above fast MA).
Alert 2 (Buy/Sell): Similar to Alert 1, but the candle close condition is checked relative to the slow MA, providing a broader price zone validation.
Moving Average Flexibility: Allows independent selection of length, price source (close, hl2, hlc3, etc.), and type (SMA, EMA, WMA, HMA, ALMA, TMA, TSMA, KAMA, AMA, etc.) for all three moving averages.
Alert Control: Independently enable or disable alerts for buy/sell signals of type 1 and type 2.
Visualization: Plots all three moving averages on the chart for visual tracking of their interactions.
Usage:
The indicator aims to capture the start of trends. The logic of using a bearish candle to confirm a bullish signal (and vice-versa) might represent a dynamic of rejection or consolidation immediately after the crossover before a new trend effectively begins. This can help filter out standard false moving average crossover signals.
Key Features:
Dual Signal System Based on Candle Close:
Alert 1 (Buy/Sell): Triggers after a bullish crossover (fast MA crosses above slow MA) AND a bearish candle (close < open) closes below the fast MA. The inverse applies for a sell signal (bearish crossover + bullish candle + close above fast MA).
Alert 2 (Buy/Sell): Similar to Alert 1, but the candle close condition is checked relative to the slow MA, providing a broader price zone validation.
Moving Average Flexibility: Allows independent selection of length, price source (close, hl2, hlc3, etc.), and type (SMA, EMA, WMA, HMA, ALMA, TMA, TSMA, KAMA, AMA, etc.) for all three moving averages.
Alert Control: Independently enable or disable alerts for buy/sell signals of type 1 and type 2.
Visualization: Plots all three moving averages on the chart for visual tracking of their interactions.
Usage:
The indicator aims to capture the start of trends. The logic of using a bearish candle to confirm a bullish signal (and vice-versa) might represent a dynamic of rejection or consolidation immediately after the crossover before a new trend effectively begins. This can help filter out standard false moving average crossover signals.
版本注释
Cross PB - Moving Average Crossover Indicator with Candlestick ConfirmationThis Pine Script v6 indicator identifies potential trend reversal or continuation signals based on the most recent crossover of two moving averages (fast and slow), validated by the subsequent candlestick body position.
Key Features:
Last Crossover Logic: The indicator continuously tracks the type (bullish or bearish) and timing of the most recent crossover between the fast and slow moving averages.
Candlestick Confirmation: A signal is triggered only when a new candle meets specific criteria after the last crossover event.
BUY Signal: Generated if the last crossover was bullish (fast MA crossed above slow MA) AND a subsequent candle is bearish (close < open) AND its close is below either the fast MA or the slow MA.
SELL Signal: Generated if the last crossover was bearish (fast MA crossed below slow MA) AND a subsequent candle is bullish (close > open) AND its close is above either the fast MA or the slow MA.
Flexible Moving Averages: Allows independent selection of length, price source (close, hl2, hlc3, etc.), and type (SMA, EMA, WMA, HMA, ALMA, TMA, TSMA, KAMA, AMA, etc.) for all three moving averages (the third is plotted as a reference line).
Configurable Alerts: Separate options to enable/disable the BUY and SELL alerts.
Visualization: Plots all three moving averages on the chart for visual reference.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。