PROFITBLUE
vip

Here you go


EMA 🌦️indicator
If you need help, check comments
-Copy everything below-
study("Double Top/Bottom + EMA Cloud", overlay=true)
// User inputs for double top/bottom
leftBars = input(8, "Left Bars", minval=1)
rightBars = input(5, "Right Bars", minval=1)
topTolerance = input(0.01, "Top Tolerance %", step=0.01)
bottomTolerance = input(0.02, "Bottom Tolerance %", step=0.01)
// Function to detect double top/bottom
doubleTopBottom() =_
isTop = false
isBottom = false
if i-leftBars _= 0 and i+rightBars _= bar_index
topDiff = abs(high[i] - high[0]) / high[0]
bottomDiff = abs(low[i] - low[0]) / low[0]
if topDiff _= topTolerance and high[i-leftBars] _ high[0] and high[i+rightBars] _ high[0]
isTop := true
if bottomDiff _= bottomTolerance and low[i-leftBars] _ low[0] and low[i+rightBars] _ low[0]
isBottom := true
[isTop, isBottom]
// Detect double top/bottom
[top, bottom] = doubleTopBottom()
// Plot signals for double top/bottom
plotshape(top, style=shape.triangledown, location=location.abovebar, color=#f19260)
plotshape(bottom, style=shape.triangleup, location=location.belowbar, color=#3179f5)
// Calculate EMAs for EMA cloud
ema8 = ema(close, 8)
ema18 = ema(close, 18)
ema28 = ema(close, 28)
// Plot EMAs for EMA cloud
p1 = plot(ema8, color=#5a6569, transp=88)
p2 = plot(ema18, color=#5d6a6b, transp=88)
p3 = plot(ema28, color=#5a6569, transp=88)
// Fill area between EMAs for EMA cloud
fill(p1, p2, color=ema8_ema18 ? #296ecf : # f57c00, transp=84)
fill(p2, p3, color=ema18_ema28 ? #296ecf : # f57c00, transp=84)
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Share
Comment
0/400
No comments
Trade Crypto Anywhere Anytime
qrCode
Scan to download Gate app
Community
English
  • 简体中文
  • English
  • Tiếng Việt
  • 繁體中文
  • Español
  • Русский
  • Français (Afrique)
  • Português (Portugal)
  • Bahasa Indonesia
  • 日本語
  • بالعربية
  • Українська
  • Português (Brasil)