OPEN-SOURCE SCRIPT

king

94
//version=5
indicator("BTC_QQQ_Crown_Indicator", overlay=true)

// 1. MACD Numbers (8, 16, 11)
[m_line, s_line, hist] = ta.macd(close, 8, 16, 11)

// 2. Engulfing Candle Logic
bull = close[1] < open[1] and open < close[1] and close > open[1]
bear = close[1] > open[1] and open > close[1] and close < open[1]

// 3. Crown Signal Condition
crownBuy = bull and hist > hist[1]
crownSell = bear and hist < hist[1]

// 4. Drawing Crowns on Chart
plotshape(crownBuy, title="Buy_Crown", style=shape.labelup, location=location.belowbar, color=color.yellow, size=size.normal, text="👑\nBUY", textcolor=color.black)
plotshape(crownSell, title="Sell_Crown", style=shape.labeldown, location=location.abovebar, color=color.red, size=size.normal, text="👑\nSELL", textcolor=color.white)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.