I got good results on some TF and some pairs
if you find a good set file I'll make a MT4 version
Code: Select all
//@version=5
strategy('EZ CRYPTO$ mod IonOne', overlay=true)
emaFastPeriod = input.int(5)
emaSlowPeriod = input.int(30)
ATRPeriod = input.int(6)
ATRMul = input.float(0.01)
per1 = input.int(140)
per2 = input.int(2)
bb1 = input.int(7)
bb2 = input.int(1)
emaFast = ta.ema(close, emaFastPeriod)
emaSlow = ta.ema(close, emaSlowPeriod)
emaDiff = emaFast - emaSlow
emaBull = emaDiff > ATRMul * ta.atr(ATRPeriod)
emaBear = emaDiff < -ATRMul * ta.atr(ATRPeriod)
val = ta.linreg(close - math.avg(math.avg(ta.highest(high, per1), ta.lowest(low, per1)), ta.sma(close, per1)), per1, 0)
mom_green = val > nz(val[bb1])
mom_red = val < nz(val[bb1])
val1 = ta.linreg(close - math.avg(math.avg(ta.highest(high, per2), ta.lowest(low, per2)), ta.sma(close, per2)), per2, 0)
mom_green1 = val1 > nz(val1[bb2])
mom_red1 = val1 < nz(val1[bb2])
var isLong = false
buy_bull = emaBull and mom_green and mom_red1
sell_bear = emaBear and mom_red and mom_green1
isBuy = not isLong and buy_bull
isSell = isLong and sell_bear
isLong := isBuy ? true : isSell ? false : isLong
plotshape(isBuy, text='Buy', color=color.new(color.green, 0), textcolor=color.new(color.white, 0), style=shape.labelup, size=size.normal, location=location.belowbar)
plotshape(isSell, text='Sell', color=color.new(color.red, 0), textcolor=color.new(color.white, 0), style=shape.labeldown, size=size.normal, location=location.abovebar)
if (isBuy)
strategy.entry("long", strategy.long, qty=1000)
if (isSell)
strategy.entry("short", strategy.short, qty=1000)