🎉 #Gate xStocks Trading Share# Posting Event Is Ongoing!
📝 Share your trading experience on Gate Square to unlock $1,000 rewards!
🎁 5 top Square creators * $100 Futures Voucher
🎉 Share your post on X – Top 10 posts by views * extra $50
How to Participate:
1️⃣ Follow Gate_Square
2️⃣ Make an original post (at least 20 words) with #Gate xStocks Trading Share#
3️⃣ If you share on Twitter, submit post link here: https://www.gate.com/questionnaire/6854
Note: You may submit the form multiple times. More posts, higher chances to win!
📅 End at: July 9, 16:00 UTC
Show off your trading on Gate Squ
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)