TradingView
orssonlack
27 אוג׳ 2020 09:25

4 EMA Crossover w/alerts 

Bitcoin / TetherUSBinance

תיאור

4 EMA crossover visualized (buy/sell) w/ alerts.

Personally I use 8, 13, 21 & 55 for LTF's and 21, 55, 100 & 200 for HTF's
תגובות
robertttme
Hi there , after crosses and comes back to 8ema after how many candles gets the alert , 1 , 2 ,3 on ema ?
danzomon
Thanks! Thats awsome! Is there a way I can make the alerts to appear on my screen or even filter for them?
orssonlack
@danzomon, I don't understand what you mean by filter them. But if by "appear on my screen" you mean you'll get a notification when an alarm is triggered, you have that option when setting up the alarm (show pop up/notify on app etc.
jadabug86
What would you suggest using to filter out the whipsaws on this system?
TheHammer369
Something is depreciated and unable to see the alert plots
syrinxflunki
cheers sir
orssonlack
@syrinxflunki, My pleasure Sir
meytifodal
//@version=4
study("4 EMA Crossover" , overlay=true)

len1 = input(8, minval=1, title="MA1")
len2 = input(13, minval=1, title="MA2")
len3 = input(21, minval=1, title="MA3")
len4 = input(55, minval=1, title="MA4")

ma1 = ema(close, len1)
ma2 = ema(close, len2)
ma3 = ema(close, len3)
ma4 = ema(close, len4)

plot(ma1, title="MA1", color=color.blue)
plot(ma2, title="MA2", color=color.red)
plot(ma3, title="MA3", color=color.green)
plot(ma4, title="MA4", color=color.orange)

longCond = bool(na)
shortCond = bool(na)
longCond := ma1 > ma4 and ma2 > ma4 and ma3 > ma4
shortCond := ma1 < ma4 and ma2 < ma4 and ma3 < ma4

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

plotshape(longCondition, title="Buy Signal", text="B", textcolor=color.white, style=shape.labelup, size=size.tiny, location=location.belowbar, color=color.green, transp=0)
plotshape(shortCondition, title="Short Signal", text="S", textcolor=color.white, style=shape.labeldown, size=size.tiny, location=location.abovebar, color=color.red, transp=0)

alertcondition(longCondition, title='EMA Cross UP', message='EMA Cross UP')
alertcondition(shortCondition, title='EMA Cross DOWN', message='EMA Cross DOWN')
mathieuprend
I am unable to see the alerts on the chart? They are enabled under the settings.

Update: I removed the indicator and added it back and the alerts appeared.
yudel2000
THANK YOU! Perfect indicator. I wish there was an option to change the EMA to SMA on any or all of the 4 EMAs! But still perfect! Using 4 EMAS make more sense anyways.
עוד