fskrypt

Heikin Ashi Double EMA Strategy [Krypt]

Based on "Heikin Ashi Strategy v2" by breizh29. Adds stop loss and optional log-transform
Keluarkan daripada Skrip Pilihan Tambah kepada Skrip Pilihan
Love this script! Anyone know how to set up alerts with this script?
Balas
walshie124 flowcandy
@flowcandy, //@version=2
// Based on Heikin Ashi Strategy v2 by breizh29

//strategy("Heikin Ashi Strategy ", shorttitle="HA Strategy ", overlay=true)
study("Heikin Ashi Strategy ", shorttitle="HA Strategy ", overlay=true)

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")
logtransform = input(false, "Log Transform")
stoploss = input(true, "Stop Loss")
showplots = input(true, "Show Plots")

ha_t = heikinashi(tickerid)
ha_close = security(ha_t, res, logtransform ? log(close) : close)
mha_close = security(ha_t, res1, logtransform ? log(close) : close)

fma = ema(mha_close, fama)
sma = ema(ha_close, sloma)

plot(showplots ? (logtransform ? exp(fma) : fma) : na, title="MA", color=#0094ff, linewidth=2, style=line)
plot(showplots ? (logtransform ? exp(sma) : sma) : na, title="SMA", color=#ff6a00, linewidth=2, style=line)

golong = crossover(fma, sma)
goshort = crossunder(fma, sma)

//strategy.entry("Buy", strategy.long, when=golong, stop=(stoploss ? high+syminfo.mintick : na))
//strategy.entry("Sell", strategy.short, when=goshort, stop=(stoploss ? low-syminfo.mintick : na))

plotchar(golong, char = "L", color = green)
plotchar(goshort, char = "S", color = red)

alertcondition(golong, "long", "long")
alertcondition(goshort, "short", "short")
Balas
@fskrypt you able to add an alert condition to the code?
+2 Balas
Does this repaint or not? Can it be used to trade safely?
+4 Balas
What does log-tranform do for this script?
Balas
Why does it repaint trades???
Balas
fskrypt PanPrezesJohny
@PanPrezesJohny, Try turning off stop loss in Settings.
Balas
MrMister88 fskrypt
@fskrypt, the step is calculated every 180min, so it juses the average of the 180 mins, if you have 5 min chart, it uses 36 candels. try with smaller step should be better. 5 min chart max step of 15 min.
+7 Balas
It will repaint (and it does), since it uses a bigger timeframe to get data from.
+4 Balas
@fr0zn, the atep is final after the period in that case 180 min, the step is the average of 180 min, try smaller step, like 15 at 5 min chart, the calculation is then based of just 3, 5 min candels
+3 Balas
Laman Utama Penyaring Saham Penyaring Forex Penyaring Kripto Kalendar Ekonomi Rancangan Bagaimana ia berfungsi Ciri-ciri Carta Harga Rujuk rakan Peraturan Dalaman Pusat Bantuan Laman web dan Penyelesaian Broker Widget Penyelesaian Pencartaan Perpustakaan Pencartaan yang Ringan Blog & Berita Twitter
Profil Tetapan Profil Akaun dan Pengebilan Rujuk rakan Tiket Sokongan Saya Pusat Bantuan Idea yang diterbitkan Pengikut Mengikut Mesej Peribadi Sembang Daftar Keluar