OPEN-SOURCE SCRIPT
CRAZY RAY RAY - Dashboard 1-5-15-1D + SMC + Clock + Candles PRO

Calculates across 4 timeframes: 1m, 5m, 15m, and 1D:
Trend with EMAs 15/30/200.
RSI (strength >50 buy, <50 sell).
MACD (crossover in favor or against).
For each timeframe it shows:
TREND → BULLISH / BEARISH / NEUTRAL.
ACTION → BUY / SELL / WAIT.
If all 4 timeframes align:
MODE = BULLISH BUY
MODE = BEARISH SELL
Filters and displays on the HUD if buys or sells are blocked by SMC context (BLOCKED BUY / BLOCKED SELL).
Also draws 2 simple moving averages on the chart:
SMA 20 white (you can use it as a micro-trend).
SMA 200 red (macro trend and institutional reference).
2. Real-Time Clock + Trading Hours
Calculates the real time for:
New York / Miami
London
Tokyo
using current time and real time zone.
Also calculates GMT time to know which session is dominant.
Marks your trading hours:
LONDON 3:00–5:30 (London time) → goodLondon
NY OPEN 8:30–10:00 (NY time) → goodNYOpen
ASIA 20:00–23:00 (Tokyo) → goodAsiaScalp
Displays a message on the HUD:
LONDON 3:00–5:30 (1–2 TRADES)
NY OPEN 8:30–10:00 (1 TRADE)
ASIA 20–23 (SCALP)
NO TRADE ROLL / DEAD / LATE
ONLY A+ SETUPS (when not in strong trading hours).
3. Institutional Power (volume + ATR + session)
Filter that evaluates whether the moment is institutional or retail:
Checks:
If you are in a strong trading session (London / NY). If the volume is above the average × multiplier.
If the ATR is above the average × multiplier.
If it passes the filters → INST ON, otherwise → RETAIL ZONE.
Used internally to block buys/sells and for the HUD.
4. Micro-signal “NO RETRACEMENT” on 1m (BUY SR / SELL SR)
On the 1-minute timeframe, it detects a very aggressive entry:
Clean trend (15/30/200 EMAs aligned).
Price crosses the 200 EMA.
MACD turns in favor.
Marks on the candle:
BUY SR (buys without retracement below the EMA200).
SELL SR (sales without retracement above the EMA200).
This state is also reflected in the HUD as the “SR” row.
5. SMC Block: HH/HL/LH/LL + BMS + ChoCH + Fibo + Zones
This is the SMC brain of the script:
Detects swings with pivots:
Paints HH, HL, LH, LL (if you activate showHHLL).
Marks BOS (break of structure).
Marks BMS and ChoCH (with strong or weak filter using ATR, volume, MACD, gaps).
Draws:
Internal Fibo of the last range (38–50–61).
Fibo entry zone 38–78% as a green discount/premium box.
Institutional mitigation zones (simple OB type green/red boxes).
Current range with dotted yellow lines.
Calculates logic for:
antiStupidBuy: blocks purchases when the context is very bearish (LL–LL–LH, bearish ChoCH, premium, EQH, etc.).
antiStupidSell: symmetrical for sales.
From this comes:
allowBuyInst
allowSellInst
buyBlockerOn / sellBlockerOn
buyTrapDetected (BUY SR signal but context blocks it → BUY TRAP).
All this feeds the HUD and institutional alerts.
6. PRO Candles (candlestick + smart color)
Candlestick pattern system:
Detects:
Hammer, Inverted Hammer. Doji.
Strong bullish/bearish candle.
Bullish/bearish engulfing.
Uses a trend EMA to determine if the pattern is with or against the trend.
Colors the candles according to the pattern (if you enable useColorCandles).
Defines texts:
patternText (pattern name).
biasText (reversal, momentum, indecision).
Updates the HUD with the current pattern (“CANDLE: Engulf Bull”, etc.).
7. Institutional PRO Combo + Reversals
Connects everything:
fullBuySetup:
allowBuyInst TRUE (SMC + Fibo + mitigation OK).
Institutional candles in favor (engulfing, hammer, etc.).
MultiTF aligned (1m, 5m in favor, 15/1D not strongly against).
Strong session (London or NY).
No blockages.
fullSellSetup: the same for sales.
Marks on the chart:
BUY PRO, SELL PRO.
BUY REV LL → reversal from a LL, at Fibo discount, with an institutional candle and above EMA200.
SELL REV HH → reversal from HH, at Fibo premium, with an institutional candle and below EMA200.
And generates alerts for all of this.
8. Dynamic Main HUD
On barstate.islast, updates the HUD:
Changes “BUY / SELL” to:
BUY BLOCK / SELL BLOCK when the context blocks that direction.
Writes:
Current candle pattern.
Time message.
Global status:
BUY TRAP ❌, BUY REV LL ✅, SELL REV HH ✅, BUY PRO ✅, SELL PRO ✅,
BUY BLOCK, SELL BLOCK, BUY/SELL OK.
9. Bull/Bear 12C HUD (Small right HUD)
12-confirmation bull/bear engine:
Calculates:
Sweep, 5th leg, mitigation, HL/LH, strong BOS.
Volume pattern (high-low-high).
ATR rising.
MACD crossover.
Liquidity.
Fear & Greed (SMA50).
Gap/imbalance. Bull/Bear 180 weak.
Count how many are ON:
bullScore /12
bearScore /12
Define a regime:
INSTITUTIONAL → many confirmations + rvol + ATR.
NORMAL
RETAIL
Show on right HUD:
List 1 to 12 with green/red dots BULL / BEAR.
Summary: “Regime: INSTITUTIONAL / NORMAL / RETAIL”.
10. Liquidity HUD XAU SCALP
Calculates RVOL, normalized ATR, spread vs ATR, current range vs average range.
Generates score and classifies:
LOW / MED / HIGH / INS.
Only moves up one level if you are in London/NY session (depending on sessions)
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.