PROTECTED SOURCE SCRIPT
Blue Dot Pullback with Bollinger Bonus

Key FeaturesCore Blue Dot Condition:ATH Pulse: Checks if the highest high in the lookback period (default: 60 bars) is within 1% of the all-time high (over 5000 bars), using recentHigh >= allTimeHigh * 0.99.
Pullback: Price must be below the recent high (close < recentHigh[1]) but above a 10-period SMA (close > sma10) to ensure a bullish context.
Stochastic Crossover: Stochastic %K must cross above 20 (ta.crossover(k, stochOverSold)).
When these conditions are met, a blue dot is plotted below the bar.
Purple Dot Condition (Bollinger Band Bonus):Includes all blue dot conditions plus the price being within 2% of the lower Bollinger Band (close <= lowerBB * bbProximity).
When met, a purple dot is plotted instead of a blue dot to highlight the stronger signal.
Plotting Logic:Blue dots are plotted only when blueDotCondition is true and purpleDotCondition is false to avoid overlap.
Purple dots are plotted when purpleDotCondition is true (includes Bollinger Band proximity).
Alerts:Added separate alertcondition calls for blue and purple dots, allowing you to set up notifications in TradingView for each signal type.
Visualization:Stochastic %K and %D are plotted in a separate pane for reference, along with the oversold line (20).
You can disable the Stochastic plot by setting display=display.none in the plot functions.
Why This Should WorkCore Setup Alignment: The blue dot condition focuses on the core requirements (ATH, pullback, Stochastic crossover), which should produce signals similar to or more frequently than the ChatGPT script, as it omits the Bollinger Band requirement unless the purple dot condition is met.
Bollinger Band Bonus: The purple dot incorporates the Bollinger Band proximity check (bbNear), matching the ChatGPT script’s additional filter, ensuring purple dots appear when the price is near the lower Bollinger Band.
Flexible ATH Detection: Using recentHigh >= allTimeHigh * 0.99 makes the ATH condition less strict, increasing the likelihood of signals compared to my original script.
How to UseAdd to TradingView:Open the Pine Editor in TradingView.
Copy and paste the script.
Click "Add to Chart" to apply it.
Interpret Dots:Blue Dot: Indicates a stock near an ATH, in a pullback (above 10-period SMA), with a Stochastic crossover above 20. This is the core Dr. Wish setup.
Purple Dot: Same as blue dot but with the price also within 2% of the lower Bollinger Band, suggesting a stronger pullback signal.
Test and Compare:Apply the script to the same stock and timeframe where the ChatGPT script showed blue dots (e.g., NVDA or TSLA on a daily chart).
Check if blue dots appear at similar points and if purple dots appear when the price is near the lower Bollinger Band.
Adjust lookbackATH (e.g., 60 to 100) or bbProximity (e.g., 1.02 to 1.05) if signals are too rare or frequent.
Set Alerts:Use TradingView’s alert feature to create notifications for “Blue Dot Alert” or “Purple Dot Alert” when signals occur.
TroubleshootingIf you’re still not seeing blue or purple dots:Check the Chart: Ensure the stock has recently hit an ATH and pulled back. Test on volatile stocks like NVDA, TSLA, or AAPL on daily or weekly timeframes.
Timeframe Sensitivity: The script may produce fewer signals on lower timeframes (e.g., 1-hour) due to fewer ATH occurrences. Try a daily or weekly chart.
Parameter Tuning: Increase bbProximity (e.g., to 1.05) to allow purple dots for prices slightly further from the lower Bollinger Band, or increase lookbackATH to capture more ATHs.
Compare with ChatGPT Script: Run both scripts on the same chart to identify where signals differ. Share the ticker, timeframe, or a screenshot if you need help debugging specific cases.
Additional NotesThe 10-period SMA in the pullback condition (isPullback) is a simple bullish context filter. You can replace it with another condition (e.g., 20-period SMA or trend filter) if preferred.
The Bollinger Band parameters (bbLength=20, bbMult=2.0) are standard but can be adjusted to match your trading style.
The script uses a 5000-bar lookback for allTimeHigh to approximate a true ATH. If your chart has limited historical data, reduce this value (e.g., to 1000).
Pullback: Price must be below the recent high (close < recentHigh[1]) but above a 10-period SMA (close > sma10) to ensure a bullish context.
Stochastic Crossover: Stochastic %K must cross above 20 (ta.crossover(k, stochOverSold)).
When these conditions are met, a blue dot is plotted below the bar.
Purple Dot Condition (Bollinger Band Bonus):Includes all blue dot conditions plus the price being within 2% of the lower Bollinger Band (close <= lowerBB * bbProximity).
When met, a purple dot is plotted instead of a blue dot to highlight the stronger signal.
Plotting Logic:Blue dots are plotted only when blueDotCondition is true and purpleDotCondition is false to avoid overlap.
Purple dots are plotted when purpleDotCondition is true (includes Bollinger Band proximity).
Alerts:Added separate alertcondition calls for blue and purple dots, allowing you to set up notifications in TradingView for each signal type.
Visualization:Stochastic %K and %D are plotted in a separate pane for reference, along with the oversold line (20).
You can disable the Stochastic plot by setting display=display.none in the plot functions.
Why This Should WorkCore Setup Alignment: The blue dot condition focuses on the core requirements (ATH, pullback, Stochastic crossover), which should produce signals similar to or more frequently than the ChatGPT script, as it omits the Bollinger Band requirement unless the purple dot condition is met.
Bollinger Band Bonus: The purple dot incorporates the Bollinger Band proximity check (bbNear), matching the ChatGPT script’s additional filter, ensuring purple dots appear when the price is near the lower Bollinger Band.
Flexible ATH Detection: Using recentHigh >= allTimeHigh * 0.99 makes the ATH condition less strict, increasing the likelihood of signals compared to my original script.
How to UseAdd to TradingView:Open the Pine Editor in TradingView.
Copy and paste the script.
Click "Add to Chart" to apply it.
Interpret Dots:Blue Dot: Indicates a stock near an ATH, in a pullback (above 10-period SMA), with a Stochastic crossover above 20. This is the core Dr. Wish setup.
Purple Dot: Same as blue dot but with the price also within 2% of the lower Bollinger Band, suggesting a stronger pullback signal.
Test and Compare:Apply the script to the same stock and timeframe where the ChatGPT script showed blue dots (e.g., NVDA or TSLA on a daily chart).
Check if blue dots appear at similar points and if purple dots appear when the price is near the lower Bollinger Band.
Adjust lookbackATH (e.g., 60 to 100) or bbProximity (e.g., 1.02 to 1.05) if signals are too rare or frequent.
Set Alerts:Use TradingView’s alert feature to create notifications for “Blue Dot Alert” or “Purple Dot Alert” when signals occur.
TroubleshootingIf you’re still not seeing blue or purple dots:Check the Chart: Ensure the stock has recently hit an ATH and pulled back. Test on volatile stocks like NVDA, TSLA, or AAPL on daily or weekly timeframes.
Timeframe Sensitivity: The script may produce fewer signals on lower timeframes (e.g., 1-hour) due to fewer ATH occurrences. Try a daily or weekly chart.
Parameter Tuning: Increase bbProximity (e.g., to 1.05) to allow purple dots for prices slightly further from the lower Bollinger Band, or increase lookbackATH to capture more ATHs.
Compare with ChatGPT Script: Run both scripts on the same chart to identify where signals differ. Share the ticker, timeframe, or a screenshot if you need help debugging specific cases.
Additional NotesThe 10-period SMA in the pullback condition (isPullback) is a simple bullish context filter. You can replace it with another condition (e.g., 20-period SMA or trend filter) if preferred.
The Bollinger Band parameters (bbLength=20, bbMult=2.0) are standard but can be adjusted to match your trading style.
The script uses a 5000-bar lookback for allTimeHigh to approximate a true ATH. If your chart has limited historical data, reduce this value (e.g., to 1000).
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.
Script protetto
Questo script è pubblicato come codice protetto. Tuttavia, è possibile utilizzarlo liberamente e senza alcuna limitazione – per saperne di più clicca qui.
Declinazione di responsabilità
Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.