PROTECTED SOURCE SCRIPT
Gold Important Smart Signals

Script Overview:
The script generates buy and sell signals for trading the Gold asset (or any asset you apply the script to) based on the following indicators:
Digital Root of Price (a numerology concept applied to the price levels),
Swing High/Low (price action based on relative highs and lows),
SMA (Simple Moving Average) filter.
Explanation of Key Components:
Swing High/Low Calculation:
Swing Highs and Swing Lows are identified by comparing the current price with the nearby price bars (left and right). If the high of a bar is greater than both the left and right prices, it is a swing high, and if the low is lower than both, it is a swing low.
The parameters left = 7 and right = 1 mean that we check 7 bars to the left and 1 bar to the right to confirm whether the current bar is a swing high or low.
Digital Root Filter:
The digital root of a number is the sum of its digits until a single-digit number is obtained. For example, the digital root of 345 would be calculated as 3 + 4 + 5 = 12, then 1 + 2 = 3.
For price levels (like swing highs and lows), the script checks if the digital root is equal to 1, 3, 6, or 9, which are considered "valid" for trade signals in this context. This filter is based on the assumption that these numbers may hold significance in predicting market reversals.
SMA (Simple Moving Average) Filter:
The SMA is calculated over a period defined by the user input (smaPeriod). The default value is 21 periods, but you can change it to any number (e.g., 50, 100).
Buy Signal is confirmed when the price is above the SMA, and a Swing Low signal (from the digital root filter) occurs.
Sell Signal is confirmed when the price is below the SMA, and a Swing High signal (from the digital root filter) occurs.
Final Signal Confirmation:
A Buy Signal occurs when both the digital root of the confirmed swing low and the price being above the SMA are true.
A Sell Signal occurs when both the digital root of the confirmed swing high and the price being below the SMA are true.
Visualization of Signals:
Instead of arrows, the signals are visualized as "BUY" and "SELL" labels on the chart, with red labels for sell signals and green labels for buy signals.
The labels are placed on the bar where the signal occurs, either above or below the price, making it clear when to consider opening a trade.
Optional Features:
Highlighting the 7th Bar Before Swing: This is a visual feature where the script highlights the 7th bar before a swing signal. It helps to visually identify significant price action leading up to a signal.
Plotting the SMA: The script optionally plots the SMA line on the chart, allowing you to visually track the price's relation to the moving average.
How This Script Can Be Used for Trading:
Buy Signals:
The script will mark Buy Signals when:
A Swing Low is confirmed with a valid digital root (1, 3, 6, or 9).
The price is above the SMA (this indicates an uptrend or a stronger market condition).
This is considered a long position signal and might be interpreted as an entry point to buy the asset.
Sell Signals:
The script will mark Sell Signals when:
A Swing High is confirmed with a valid digital root (1, 3, 6, or 9).
The price is below the SMA (indicating a downtrend or weakening market).
This is considered a short position signal and might be interpreted as an entry point to sell the asset.
Risk Management:
The script does not directly offer risk management strategies (like stop losses or take profits). These can be added manually based on the signals provided, or additional rules can be incorporated into the script for automatic risk management.
Testing and Optimization:
Since the script uses the SMA as a trend filter, it is important to test this strategy over different time periods and market conditions to verify how it performs.
The parameters, such as the smaPeriod, can be adjusted through the input field in the script to optimize the performance.
TradingView Rules and Notes:
Backtesting:
TradingView allows users to backtest strategies. This script is more of an indicator that provides visual cues on the chart, so you can manually observe how well the signals would have worked in the past. If you'd like to automate the strategy for backtesting purposes, you can convert this indicator into a strategy by adding buy and sell orders within the script.
Signal Confirmation:
The script requires two conditions for each trade:
The digital root must be one of 1, 3, 6, or 9, and
The price must be on the correct side of the SMA (above for buys, below for sells).
This two-step confirmation helps to filter out false signals and improves the reliability of the strategy.
Trade Execution:
The script provides only visual signals; you will need to execute the trades manually or modify the script into a strategy that can send buy or sell orders directly.
Market Conditions:
The SMA filter helps the script adapt to different market conditions. It avoids buying in downtrends (when the price is below the SMA) and selling in uptrends (when the price is above the SMA).
It's still important to apply proper risk management, as the strategy does not include any stop-loss or take-profit rules.
Final Thoughts:
The script provides a non-repeating signal system that aims to capture swing highs and lows while considering the overall market trend (via the SMA).
By using Buy and Sell labels, this script makes it easy to visualize trade opportunities.
It would be most effective when used in combination with a larger trading strategy that incorporates risk management and possibly other indicators.
The script generates buy and sell signals for trading the Gold asset (or any asset you apply the script to) based on the following indicators:
Digital Root of Price (a numerology concept applied to the price levels),
Swing High/Low (price action based on relative highs and lows),
SMA (Simple Moving Average) filter.
Explanation of Key Components:
Swing High/Low Calculation:
Swing Highs and Swing Lows are identified by comparing the current price with the nearby price bars (left and right). If the high of a bar is greater than both the left and right prices, it is a swing high, and if the low is lower than both, it is a swing low.
The parameters left = 7 and right = 1 mean that we check 7 bars to the left and 1 bar to the right to confirm whether the current bar is a swing high or low.
Digital Root Filter:
The digital root of a number is the sum of its digits until a single-digit number is obtained. For example, the digital root of 345 would be calculated as 3 + 4 + 5 = 12, then 1 + 2 = 3.
For price levels (like swing highs and lows), the script checks if the digital root is equal to 1, 3, 6, or 9, which are considered "valid" for trade signals in this context. This filter is based on the assumption that these numbers may hold significance in predicting market reversals.
SMA (Simple Moving Average) Filter:
The SMA is calculated over a period defined by the user input (smaPeriod). The default value is 21 periods, but you can change it to any number (e.g., 50, 100).
Buy Signal is confirmed when the price is above the SMA, and a Swing Low signal (from the digital root filter) occurs.
Sell Signal is confirmed when the price is below the SMA, and a Swing High signal (from the digital root filter) occurs.
Final Signal Confirmation:
A Buy Signal occurs when both the digital root of the confirmed swing low and the price being above the SMA are true.
A Sell Signal occurs when both the digital root of the confirmed swing high and the price being below the SMA are true.
Visualization of Signals:
Instead of arrows, the signals are visualized as "BUY" and "SELL" labels on the chart, with red labels for sell signals and green labels for buy signals.
The labels are placed on the bar where the signal occurs, either above or below the price, making it clear when to consider opening a trade.
Optional Features:
Highlighting the 7th Bar Before Swing: This is a visual feature where the script highlights the 7th bar before a swing signal. It helps to visually identify significant price action leading up to a signal.
Plotting the SMA: The script optionally plots the SMA line on the chart, allowing you to visually track the price's relation to the moving average.
How This Script Can Be Used for Trading:
Buy Signals:
The script will mark Buy Signals when:
A Swing Low is confirmed with a valid digital root (1, 3, 6, or 9).
The price is above the SMA (this indicates an uptrend or a stronger market condition).
This is considered a long position signal and might be interpreted as an entry point to buy the asset.
Sell Signals:
The script will mark Sell Signals when:
A Swing High is confirmed with a valid digital root (1, 3, 6, or 9).
The price is below the SMA (indicating a downtrend or weakening market).
This is considered a short position signal and might be interpreted as an entry point to sell the asset.
Risk Management:
The script does not directly offer risk management strategies (like stop losses or take profits). These can be added manually based on the signals provided, or additional rules can be incorporated into the script for automatic risk management.
Testing and Optimization:
Since the script uses the SMA as a trend filter, it is important to test this strategy over different time periods and market conditions to verify how it performs.
The parameters, such as the smaPeriod, can be adjusted through the input field in the script to optimize the performance.
TradingView Rules and Notes:
Backtesting:
TradingView allows users to backtest strategies. This script is more of an indicator that provides visual cues on the chart, so you can manually observe how well the signals would have worked in the past. If you'd like to automate the strategy for backtesting purposes, you can convert this indicator into a strategy by adding buy and sell orders within the script.
Signal Confirmation:
The script requires two conditions for each trade:
The digital root must be one of 1, 3, 6, or 9, and
The price must be on the correct side of the SMA (above for buys, below for sells).
This two-step confirmation helps to filter out false signals and improves the reliability of the strategy.
Trade Execution:
The script provides only visual signals; you will need to execute the trades manually or modify the script into a strategy that can send buy or sell orders directly.
Market Conditions:
The SMA filter helps the script adapt to different market conditions. It avoids buying in downtrends (when the price is below the SMA) and selling in uptrends (when the price is above the SMA).
It's still important to apply proper risk management, as the strategy does not include any stop-loss or take-profit rules.
Final Thoughts:
The script provides a non-repeating signal system that aims to capture swing highs and lows while considering the overall market trend (via the SMA).
By using Buy and Sell labels, this script makes it easy to visualize trade opportunities.
It would be most effective when used in combination with a larger trading strategy that incorporates risk management and possibly other indicators.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip dilindungi
Skrip ini diterbitkan sebagai sumber tertutup. Akan tetapi, anda boleh menggunakannya dengan percuma dan tanpa had – ketahui lebih lanjut di sini.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.