Spécifications
Hi
Need this Pine Script Indicator converted to MT5 Expert Advisor
Functions
1/Open and Close trade on opposite signal
2/ Need the Indicators and Arrows displayed on the Chart
3/Have a setting to automatically increase lot size on the next trade, if previous trade was a losing trade.
4/No repaint as the Tradeview Indicator does repaint sometimes
5/If a Trade is closed manually the EA will open a trade on the next signal.
6/If after closing a Trade manually and then I set a Stop Order in the direction of the current Signal and the Stop Order is Triggered the EA will take over and close the Trade on the next opposite signal.
7/If after closing a Trade manually and then re-open a Trade Manually in the direction of the Signal the EA will take over and close the Trade on the next opposite signal.
See the Indicator on a Chart on TradeView - Click - "Make it mine"
https://www.youtube.com/watch?v=5yKroPKDL-g
Link to Trade View in YouTube Description.
Skype and TeamViewer
to verbally confirm conditions if helpful
Code
Here is code free to use for anyone by coder
//@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)
Thanks