OPEN-SOURCE SCRIPT
Granville 8-Rule Engine — v6

Description:
The Granville 8-Rule Engine systematically implements Joseph Granville's eight original trading rules, which provide a comprehensive framework for interpreting price action relative to a moving average to identify genuine trend changes and avoid false signals.
Granville's methodology focuses on the critical relationship between price movement and the direction of the moving average, recognizing that valid trend changes and continuations exhibit specific behavioral patterns while false breakouts and reversals show characteristic divergences.
The indicator evaluates all eight of Granville's rules and assigns a composite score based on their fulfillment:
Bullish Rules:
Rule 1: Price crosses above a rising moving average (+3 points)
Rule 2: Price remains above a rising moving average after testing support (+2 points)
Rule 3: Price remains above a rising moving average after penetrating below it (+1 point)
Rule 4: Moving average changes from declining to rising (+1 point)
Bearish Rules:
Rule 5: Price crosses below a declining moving average (-3 points)
Rule 6: Price remains below a declining moving average after testing resistance (-2 points)
Rule 7: Price remains below a declining moving average after penetrating above it (-1 point)
The indicator incorporates volume confirmation by adding or subtracting additional points when significant volume accompanies the fulfillment of bullish or bearish rules, respectively.
A buy signal is generated when the composite score reaches +4 or higher, indicating multiple bullish rules are simultaneously satisfied. A sell signal is generated when the score reaches -4 or lower, indicating multiple bearish rules are in effect.
This systematic approach filters out many false breakout and whipsaw signals by requiring multiple confirmatory conditions rather than relying on simple moving average crossovers. The scoring mechanism provides a quantitative measure of the strength of the prevailing trend relationship, enabling traders to distinguish between genuine trend development and deceptive price movements that fail to confirm with the moving average direction.
The Granville 8-Rule Engine provides a disciplined, rule-based method for determining whether price movements represent valid trend continuation, genuine trend reversal, or potentially misleading counter-trend activity that is likely to fail. By requiring multiple confirmatory conditions from Granville's established rules, the indicator helps traders avoid premature entries and provides higher-probability signals for participating in sustained trend movements.
The Granville 8-Rule Engine systematically implements Joseph Granville's eight original trading rules, which provide a comprehensive framework for interpreting price action relative to a moving average to identify genuine trend changes and avoid false signals.
Granville's methodology focuses on the critical relationship between price movement and the direction of the moving average, recognizing that valid trend changes and continuations exhibit specific behavioral patterns while false breakouts and reversals show characteristic divergences.
The indicator evaluates all eight of Granville's rules and assigns a composite score based on their fulfillment:
Bullish Rules:
Rule 1: Price crosses above a rising moving average (+3 points)
Rule 2: Price remains above a rising moving average after testing support (+2 points)
Rule 3: Price remains above a rising moving average after penetrating below it (+1 point)
Rule 4: Moving average changes from declining to rising (+1 point)
Bearish Rules:
Rule 5: Price crosses below a declining moving average (-3 points)
Rule 6: Price remains below a declining moving average after testing resistance (-2 points)
Rule 7: Price remains below a declining moving average after penetrating above it (-1 point)
The indicator incorporates volume confirmation by adding or subtracting additional points when significant volume accompanies the fulfillment of bullish or bearish rules, respectively.
A buy signal is generated when the composite score reaches +4 or higher, indicating multiple bullish rules are simultaneously satisfied. A sell signal is generated when the score reaches -4 or lower, indicating multiple bearish rules are in effect.
This systematic approach filters out many false breakout and whipsaw signals by requiring multiple confirmatory conditions rather than relying on simple moving average crossovers. The scoring mechanism provides a quantitative measure of the strength of the prevailing trend relationship, enabling traders to distinguish between genuine trend development and deceptive price movements that fail to confirm with the moving average direction.
The Granville 8-Rule Engine provides a disciplined, rule-based method for determining whether price movements represent valid trend continuation, genuine trend reversal, or potentially misleading counter-trend activity that is likely to fail. By requiring multiple confirmatory conditions from Granville's established rules, the indicator helps traders avoid premature entries and provides higher-probability signals for participating in sustained trend movements.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.