breizh29

Heikin Ashi Alert V2 by breizh29

546 2 53
Use it with Heikin Ashi Strategy V2
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
//Heikin Ashi Alert V2 by breizh29
//To use with Heikin Ashi Strategy  V2
//Inputs must be the same as Heikin Ashi Strategy

study(title="Heikin Ashi Alert V2 by breizh29", shorttitle="HA Alert V2",overlay=false)
res = input(title="Heikin Ashi Candle Time Frame", type=resolution, defval="60")
hshift = input(1,title="Heikin Ashi Candle Time Frame Shift")
res1 = input(title="Heikin Ashi EMA Time Frame", type=resolution, defval="180")
mhshift = input(0,title="Heikin Ashi EMA Time Frame Shift")
fama = input(1,"Heikin Ashi EMA Period")
test = input(1,"Heikin Ashi EMA Shift")
sloma = input(30,"Slow EMA Period")
slomas = input(1,"Slow EMA Shift")
macdf = input(false,title="With MACD filter")
res2 = input(title="MACD Time Frame", type=resolution, defval="15")
macds = input(1,title="MACD Shift")


//Heikin Ashi Open/Close Price
ha_t = heikinashi(tickerid)
ha_open = security(ha_t, res, open[hshift])
ha_close = security(ha_t, res, close[hshift])
mha_close = security(ha_t, res1, close[mhshift])

//macd
[macdLine, signalLine, histLine] = macd(close, 12, 26, 9)
macdl = security(ha_t,res2,macdLine[macds])
macdsl= security(ha_t,res2,signalLine[macds])

//Moving Average
fma = ema(mha_close[test],fama)
sma = ema(ha_close[slomas],sloma)


//Alert
up = crossover(fma,sma) and (macdl > macdsl or macdf == false ) ? 1:0
down = crossunder(fma,sma) and (macdl < macdsl or macdf == false ) ? -1:0
plot(up,"Go Long",color=lime,linewidth=4,style=histogram)
plot(down,"Go Short",color=red,linewidth=4,style=histogram)



How do I implement this alert for your V2 strategy? Thanks,
Reply
repaints
Reply
United States
United Kingdom
India
Deutschland
France
España
Italia
Polska
Türkiye
Россия
Brasil
Indonesia
Malaysia
Việt Nam
日本
한국
简体
繁體
Home Stock Screener Forex Signal Finder Cryptocurrency Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators Website & Broker Solutions Widgets Stock Charting Library Feature Request Blog & News FAQ Help & Wiki Twitter
Profile Profile Settings Account and Billing My Support Tickets Priority Support Contact Support Ideas Published Followers Following Private Messages Chat Sign Out