Hey everyone here is something created by ChatGBT 5 for Rob Smith's "The Strat"...with built in confirmations!
Description:
The script you now have is a multi-confirmation Strat trading system that overlays directly on your chart. It takes Rob Smith’s Strat framework (1-2-3 candles, reversals) and layers on multiple confirmations so you’re only seeing signals when a lot of things align.
Here’s the step-by-step logic of what it does:
1. Strat Candlestick Recognition
2. Volume & Accumulation/Distribution (A/D) Check
To filter out weak 2U/2D moves, it checks:
3. Higher-Timeframe Trend Filter
You pick a higher timeframe (default = Weekly).
4. RSI & MACD Momentum Confirmation
Both momentum tools are used:
5. 2-2 Reversals
A 2-2 reversal is when a 2D candle is followed by a 2U (bullish reversal), or a 2U is followed by a 2D (bearish reversal).
6. Divergence Detection
Adds an extra edge by flagging when price and momentum disagree:
7. Channel Support & Resistance
It builds a dynamic price channel (highest high and lowest low over last 50 bars by default).
8. Trade Entry Bubbles (Filtered by Channel Edge)
This is the newest piece we added:
9. Labels for Quick Read
At the top of your chart you’ll see:
In summary:
This script is like a multi-lock system for trades.
Magenta bubble = strong SHORT setup at resistance
Cyan bubble = strong LONG setup at support

Description:
The script you now have is a multi-confirmation Strat trading system that overlays directly on your chart. It takes Rob Smith’s Strat framework (1-2-3 candles, reversals) and layers on multiple confirmations so you’re only seeing signals when a lot of things align.
Here’s the step-by-step logic of what it does:
1. Strat Candlestick Recognition
- Inside bar (1): Current candle’s high is lower than the previous high and low is higher than the previous low.
- Outside bar (3): Current high breaks above previous high and current low breaks below previous low.
- Two up (2U): Candle makes a higher high (trend continuation).
- Two down (2D): Candle makes a lower low (trend continuation).
2. Volume & Accumulation/Distribution (A/D) Check
To filter out weak 2U/2D moves, it checks:
- Volume: Must be greater than the 20-bar average.
- A/D line: Must confirm direction (rising on up moves, falling on down moves).
3. Higher-Timeframe Trend Filter
You pick a higher timeframe (default = Weekly).
- If higher-TF close is above its 50-bar average → uptrend.
- If below → downtrend.
4. RSI & MACD Momentum Confirmation
Both momentum tools are used:
- RSI > 50 → bullish confirmation.
- RSI < 50 → bearish confirmation.
- MACD line > signal line → bullish.
- MACD line < signal line → bearish.
5. 2-2 Reversals
A 2-2 reversal is when a 2D candle is followed by a 2U (bullish reversal), or a 2U is followed by a 2D (bearish reversal).
- Bullish 2-2 Reversal: Two-down candle → Two-up candle + volume confirmation + RSI/MACD bullish + higher-TF uptrend.
- Bearish 2-2 Reversal: Two-up candle → Two-down candle + volume confirmation + RSI/MACD bearish + higher-TF downtrend.
- Cyan: Bullish 2-2 reversal.
- Magenta: Bearish 2-2 reversal.
6. Divergence Detection
Adds an extra edge by flagging when price and momentum disagree:
- Bullish Divergence: Price makes a lower low, but RSI or MACD makes a higher low.
- Bearish Divergence: Price makes a higher high, but RSI or MACD makes a lower high.
7. Channel Support & Resistance
It builds a dynamic price channel (highest high and lowest low over last 50 bars by default).
- Upper channel: Resistance.
- Lower channel: Support.
- Mid channel: Neutral zone.
8. Trade Entry Bubbles (Filtered by Channel Edge)
This is the newest piece we added:
- A LONG bubbleonly appears if:
- Bullish 2-2 reversal
- Volume confirmation
- Higher-TF uptrend
- RSI > 50
- MACD bullish crossover
- AND price is within 2% of channel support
- A SHORT bubbleonly appears if:
- Bearish 2-2 reversal
- Volume confirmation
- Higher-TF downtrend
- RSI < 50
- MACD bearish crossover
- AND price is within 2% of channel resistance
9. Labels for Quick Read
At the top of your chart you’ll see:
- “Confirmed Up (RSI/MACD)” or “Confirmed Down (RSI/MACD)”
- “2-2 Reversal Up/Down (Trend + RSI/MACD)”
- Settings labels like whether Inside/Outside bars are being shown

This script is like a multi-lock system for trades.
- First it finds Strat candles (2s, 1s, 3s).
- Then it confirms them with volume + A/D + higher-TF trend + RSI/MACD.
- Then it ensures you’re only acting near support/resistance channels.
- Finally it gives you a LONG or SHORT bubble only when everything aligns at the edge.


Code:
# Strat 2/1/3 with Volume + A/D + 2-2 Reversal + RSI/MACD + Divergence + Channels + Trade Bubbles
# Fully Integrated Study
# By ChatGPT
declare upper;
# ---------------- Inputs ----------------
input showInside = yes;
input showOutside = yes;
input channelLength = 50;
input showChannel = yes;
input higherTF = AggregationPeriod.WEEK;
input rsiLength = 14;
input macdFastLength = 12;
input macdSlowLength = 26;
input macdSignalLength = 9;
# ---------------- Candlestick Relationships ----------------
def insideBar = high < high[1] and low > low[1];
def twoUp = high > high[1] and low >= low[1];
def twoDown = low < low[1] and high <= high[1];
def outsideBar = high > high[1] and low < low[1];
# ---------------- Volume & A/D ----------------
def vol = volume;
def avgVol = Average(volume, 20);
def ad = TotalSum(((close - low) - (high - close)) / (high - low) * volume);
# ---------------- Higher-Timeframe Trend ----------------
def HTF_close = close(period = higherTF);
def HTF_MA50 = Average(HTF_close, 50);
def HTF_Uptrend = HTF_close > HTF_MA50;
def HTF_Downtrend = HTF_close < HTF_MA50;
# ---------------- RSI ----------------
def rsi = RSI(length = rsiLength);
# ---------------- MACD ----------------
def macdValue = ExpAverage(close, macdFastLength) - ExpAverage(close, macdSlowLength);
def macdSignal = ExpAverage(macdValue, macdSignalLength);
# ---------------- Confirmation ----------------
def volConfirmUp = twoUp and vol > avgVol and ad > ad[1] and rsi > 50 and macdValue > macdSignal;
def volConfirmDown = twoDown and vol > avgVol and ad < ad[1] and rsi < 50 and macdValue < macdSignal;
# ---------------- 2-2 Reversal Detection ----------------
def twoTwoUpReversal = twoDown[1] and twoUp and volConfirmUp and HTF_Uptrend;
def twoTwoDownReversal = twoUp[1] and twoDown and volConfirmDown and HTF_Downtrend;
# ---------------- Divergence Detection ----------------
def bullishRSIDiv = twoTwoUpReversal and low < low[1] and rsi > rsi[1];
def bearishRSIDiv = twoTwoDownReversal and high > high[1] and rsi < rsi[1];
def bullishMACDDiv = twoTwoUpReversal and low < low[1] and macdValue > macdValue[1];
def bearishMACDDiv = twoTwoDownReversal and high > high[1] and macdValue < macdValue[1];
# ---------------- Candle Recoloring ----------------
AssignPriceColor(
if twoTwoUpReversal then if bullishRSIDiv or bullishMACDDiv then Color.CYAN else Color.CYAN
else if twoTwoDownReversal then if bearishRSIDiv or bearishMACDDiv then Color.MAGENTA else Color.MAGENTA
else Color.CURRENT
);
# ---------------- Bubbles for 2s ----------------
AddChartBubble(twoTwoUpReversal, low, "2C-RV", Color.GREEN, no);
AddChartBubble(twoTwoDownReversal, high, "2C-RV", Color.RED, yes);
AddChartBubble(twoUp and !twoTwoUpReversal, low, if volConfirmUp then "2C" else "2", Color.GREEN, no);
AddChartBubble(twoDown and !twoTwoDownReversal, high, if volConfirmDown then "2C" else "2", Color.RED, yes);
# ---------------- Optional Inside / Outside ----------------
AddChartBubble(showInside and insideBar, low, "1", Color.PLUM, no);
AddChartBubble(showOutside and outsideBar, low, "3", Color.BLUE, no);
# ---------------- Channels ----------------
def channelHigh = Highest(high, channelLength);
def channelLow = Lowest(low, channelLength);
def channelMid = (channelHigh + channelLow) / 2;
plot upperChannel = if showChannel then channelHigh else Double.NaN;
plot lowerChannel = if showChannel then channelLow else Double.NaN;
plot midChannel = if showChannel then channelMid else Double.NaN;
upperChannel.SetDefaultColor(Color.YELLOW);
upperChannel.SetStyle(Curve.SHORT_DASH);
upperChannel.SetLineWeight(2);
lowerChannel.SetDefaultColor(Color.YELLOW);
lowerChannel.SetStyle(Curve.SHORT_DASH);
lowerChannel.SetLineWeight(2);
midChannel.SetDefaultColor(Color.GRAY);
midChannel.SetStyle(Curve.LONG_DASH);
midChannel.SetLineWeight(1);
# ---------------- Trade Entry Bubbles ----------------
AddChartBubble(
twoTwoUpReversal and volConfirmUp and HTF_Uptrend and rsi > 50 and macdValue > macdSignal,
low,
"LONG",
Color.GREEN,
no
);
AddChartBubble(
twoTwoDownReversal and volConfirmDown and HTF_Downtrend and rsi < 50 and macdValue < macdSignal,
high,
"SHORT",
Color.RED,
yes
);
# ---------------- Dynamic Labels ----------------
AddLabel(volConfirmUp, "Confirmed Up (RSI/MACD)", Color.CYAN);
AddLabel(volConfirmDown, "Confirmed Down (RSI/MACD)", Color.MAGENTA);
AddLabel(twoTwoUpReversal, "2-2 Reversal Up (Trend + RSI/MACD)", Color.CYAN);
AddLabel(twoTwoDownReversal, "2-2 Reversal Down (Trend + RSI/MACD)", Color.MAGENTA);
# ---------------- Static Study Labels ----------------
AddLabel(yes, "Strat 2/1/3 + Volume + A/D + 2-2 Reversal + RSI/MACD + Divergence + Channels + LONG/SHORT Bubbles", Color.YELLOW);
AddLabel(showInside, "Inside Bars ON", Color.PLUM);
AddLabel(showOutside, "Outside Bars ON", Color.BLUE);
Last edited by a moderator: