Heikin Ashi Alert V2 by breizh29

396 0 34
Use it with Heikin Ashi Strategy V2
Remove from Favorite Scripts Add to Favorite Scripts
//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])

[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)

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)

Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out