breizh29

Heikin Ashi Strategy V2

This is my second Version of Heikin Ashi Strategy.

Changes:
-Different Time Frame for Fast EMA and Slow EMA
-MACD Filter with own Time Frame

You can tweak around with settings , but defaults gives good results in Forex,Stocks and Index.

I also made an Alert Script
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
//Heikin Ashi Strategy  V2 by breizh29

strategy("Heikin Ashi Strategy  V2",shorttitle="HAS V2",overlay=true,default_qty_value=1000,initial_capital=100000,currency=currency.EUR)
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)
plot(fma,title="MA",color=lime,linewidth=2,style=line)
plot(sma,title="SMA",color=red,linewidth=2,style=line)


//Strategy
golong =  crossover(fma,sma) and (macdl > macdsl or macdf == false )
goshort =   crossunder(fma,sma) and (macdl < macdsl or macdf == false )

strategy.entry("Buy",strategy.long,when = golong)
strategy.entry("Sell",strategy.short,when = goshort)



Great strategy!

Any idea how to create an alert for it?

Thanks!
Reply
Hi, very good trading system. Have you this trading system to MT5? Thank's.
Reply
It repaints....the big issue with Trading view strategies
+4 Reply
Your strategy is good. Does this strategy repaint signals? I tried some strategies in Public library but they are all repainting signals. After sometimes the signal disappears. Kindly let me know.
Reply
Yes, it repaints
Reply
CPTRADER breizh29
How to trade if it repaints?
+2 Reply
zelibobla CPTRADER
Noway to do this. Just a toy for those who don't trade.
Reply
can you suggest us settings for daily trading ?
Reply
I 'm actually testing this settings : 1h , 1 , 3h , 0 , 1 , 1 , 60 , MACD Filter off , 15 , 1 on a 15mn Chart
You must use it on a low spread Symbole for better profit. i'm testing it on EURUSD with 2 pips spread.
Works fine so far but a lot of false signals. For less false signals you can turn MACD Filter on , the profit factor will go down but is still nice (between 4 and 8) and you will also catch the big moves later.
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