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
إزالة من البرامج النصية المفضلة أضف إلى البرامج النصية المفضلة
//@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)



Hello,
may you please precise how the "ongoing" fma is calculated?
Let's assume the n-1 period of 180 minutes is ended. We are entering in the new period of 180, which consists of 12 periods of 15 minutes. Plotting the fma on 15 minutes timeframe, I do see it is calculated "ongoing", but I do not understand what "close" and "previus EMA" values it is considering (EMA formula = * (2 / n+1) + previous EMA.)
Thanks,
Aldo
رد
Hello. Please tell me what settings need to be changed so that the strategy does not repaint the signals?
رد
Your script shows buy and sell signals at different places, depending upon whether you use Heinkin Ashi or Candles. Should it not give signals at the same place ??
+7 رد
Your script shows buy and sell signals at different places, depending upon whether you use Heinkin Ashi or Candles. Should it not give signals at the same place ??
رد
There is a bug in this strategy. This strategy is trading by looking at the future closing price.
Example : 24 Mar 16' 22:15, fma is 1.1169. But, fma has a higher value when calculated from open, high, low, close in the past 3 hours.
(this calculation of this strategy includes 25 Mar 16' 00:45)

But you can still get profits.
+2 رد
Any way we can create a robot in MT4 for this strategy and settings? Would love to run this on multiple currency pairs to see how it pans out even if it re-paints the losses are frequent but they are small but the gains are pretty big.
+7 رد
It repaints it's useless like the blue sky strategy useless
+7 رد
Which timeframe will this work? Should I change anything?
+6 رد
Great strategy!

Any idea how to create an alert for it?

Thanks!
+13 رد
Hi, very good trading system. Have you this trading system to MT5? Thank's.
+3 رد
الصفحة الرئيسية منصة الأسهم منصًة العملات منصّة العملات الرقمية جدول الأعمال الاقتصادي كيف نعمل مميزات الرسم البياني أسعار العضوية قوانين الموقع المشرفون حلول الموقع الإلكتروني والوسيط الأدوات حلول الرسوم البيانية احصل على المساعدة طلب الخصائص المدوّنة والأخبار الأسئلة الأكثر شيوعًا معرفة تويتر
الملف الشخصي إعدادات الصفحة الشخصية الحساب وإعداد الفواتير احصل على المساعدة أفكاري المنشورة المتابعين تتابع رسالة خاصة المحادثة تسجيل الخروج