Those settings work decently on the 4Hour and Daily TF, I dont think its overall good enough to work as a standalone... has potential though.ionone wrote: Tue Jul 19, 2022 9:20 pm guys I've got a request.
I found some Trading VIew indicator that looks good.
I extracted variables that were fixed and made them modifiable, and made a strategy (with backtest)
there are a lot of variables now.
If you find a setting that works, please post it here and i'll make a MT4 version
or even better if someone has that automatic optimizer that finds the best settings automatically that would be awesome
thanks
Jeff
Code: Select all
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © // 19muratdinc82@gmail.com strategy(title = "swing trade d", shorttitle="swing trade D", overlay=true,initial_capital = 1000, default_qty_value = 100, default_qty_type = strategy.percent_of_equity) //@version=5 //indicator("Swing Trade [D]",overlay=true) lr1=input(3,"linreg 1 Lenght") lr2=input(13,"linreg 1 Lenght") lrMA1=input(2,"linreg MA 1 Lenght") lrMA2=input(2,"linreg MA 1 Lenght") MA3=input(2,"linreg MA 1 Lenght") rsi1a=input(14,"RSI1") sto1=input(14,"Stoch1") stoMA1=input(3,"Stoch MA 1") EMA1=input(3,"EMA 1") EMA2=input(26,"EMA 2") EMA3=input(26,"EMA 3") EMA4=input(12,"EMA 4") EMA5=input(12,"EMA 5") EMA6=input(12,"EMA 6") EMA7=input(12,"EMA 7") CCI1=input(20,"CCI1 length") CCI1thr=input(50,"CCI1 threshold") rsi2a=input(7,"RSI2a") rsi2b=input(14,"RSI2b") rsi3a=input(6,"RSI3a") rsiThr3a=input(6,"RSI Threshold 3a") a=ta.ema(ta.linreg(close,lr1,0),lrMA1) b=ta.ema(ta.linreg(close,lr2,0),lrMA2) c=ta.ema(a-b,MA3) rsi1 = ta.rsi(close, rsi1a) vk = ta.ema(ta.stoch(rsi1, rsi1, rsi1, sto1), stoMA1) vd = ta.ema(vk, EMA1) m1 = ta.ema(close,EMA2) m2 = ta.ema(m1,EMA3) m3 = ((2 * m1) - m2 ) m4 = ta.ema(close,EMA4) m5 = ta.ema(m4,EMA4) m6 = ((2 * m4) - m5) m8 = (m6 - m3) m7 = ta.ema(m8, EMA6) m9 = ta.ema(m7, EMA7) m10 = ((2 * m7) - m9) m11 = (m8 - m10) deml=ta.crossover(m11,0) dems=ta.crossunder(m11,0) ml=ta.crossover(vk,vd) ms=ta.crossunder(vk,vd) pl=ta.crossover(c,0) ps=ta.crossunder(c,0) longso=(ml and pl and deml) and ta.cci(close,CCI1)>=-CCI1thr shortso=(ms and ps and dems) and ta.cci(close,CCI1)<=CCI1thr long11=((longso or (ml[1] and pl and deml) or (ml and pl[1] and deml) or (ml and pl and deml[1]))) and ta.rsi(close,rsi2a)>ta.rsi(close,rsi2b) short11=((shortso or (ms[1] and ps and dems) or (ms and ps[1] and dems) or (ms and ps and dems[1]))) and ta.rsi(close,rsi2a)<ta.rsi(close,rsi2b) kf = 0.0 kf := nz(kf[1]) + math.pow(((math.sum(math.abs(close - close[1]), 5) != 0 ? math.abs(close - close[5]) / math.sum(math.abs(close - close[1]), 5): 0)) * (0.6015) + 0.0645, 2) * (close - nz(kf[1])) kfh = 0.0 kfh := nz(kfh[1]) + math.pow(((math.sum(math.abs(high - high[1]), 5) != 0 ? math.abs(high - high[5]) / math.sum(math.abs(high - high[1]), 5): 0)) * (0.6015) + 0.0645, 2) * (high - nz(kfh[1])) kfl = 0.0 kfl := nz(kfl[1]) + math.pow(((math.sum(math.abs(low - low[1]), 5) != 0 ? math.abs(low - low[5]) / math.sum(math.abs(low - low[1]), 5): 0)) * (0.6015) + 0.0645, 2) * (low - nz(kfl[1])) rsist=input(3,"Rsi Lenght") rsil1st=input(5,"Rsi Lower Band 1 ") rsil2st=input(10,"Rsi Lower Band 2") rsil3st=input(15,"Rsi Lower Band 3") rsio1st=input(85,"Rsi Over Band 1") rsio2st=input(90,"Rsi Over Band 2") rsio3st=input(95,"Rsi Over Band 3") rsilongv1st=ta.crossover(ta.rsi(low , rsist),rsil1st) rsilongv2st= ta.crossover(ta.rsi(low , rsist),rsil2st) rsilongv3st= ta.crossover(ta.rsi(low , rsist),rsil3st) rsishortv1st=ta.crossunder(ta.rsi(high , rsist),rsio1st) rsishortv2st=ta.crossunder(ta.rsi(high , rsist),rsio2st) rsishortv3st=ta.crossunder(ta.rsi(high , rsist),rsio3st) rsilongst=( ta.crossover(ta.rsi(close,rsi3a),rsiThr3a) or rsilongv1st or rsilongv1st[1] or rsilongv2st or rsilongv2st[1] or rsilongv3st or rsilongv3st[1] ) and (close > open[1] and close[1] < open[1]) rsishortst=(rsishortv1st or rsishortv1st[1] or rsishortv2st or rsishortv2st[1] or rsishortv3st or rsishortv3st[1] ) and ( close < open[1] and close[1] > open[1]) acl=(3*math.sum(ta.highest(high,21),3)/3+kfh)/4 bcl=(3*math.sum(ta.lowest(low,21),3)/3+kfl)/4 abcl=(acl+bcl+8*kf)/10 plot(abcl,color=abcl>abcl[1]?color.green:color.red,linewidth=2) xcl=plot(acl,color=color.red,transp=100) ycl=plot(bcl,color=color.green,transp=100) zcl=plot((2*acl+bcl)/3,color=color.gray,transp=100) tcl=plot((acl+2*bcl)/3,color=color.gray,transp=100) z1cl=plot((4*acl+bcl)/5,color=color.gray,transp=100) t1cl=plot((acl+4*bcl)/5,color=color.gray,transp=100) fill(xcl,zcl,color=#FF00CC,transp=95) fill(ycl,tcl,color=#00FFCC,transp=95) fill(zcl,tcl,color=#669999,transp=100) fill(xcl,z1cl,color=#FF0033,transp=90) fill(ycl,t1cl,color=#00FF00,transp=90) plotshape(rsilongst or long11, title = "BUY", text = 'B', style = shape.labelup, location = location.belowbar, color= color.green, textcolor = color.white, size = size.tiny) plotshape(rsishortst or short11, title = "SELL", text = 'S', style = shape.labeldown, location = location.abovebar, color= color.red, textcolor = color.white, size = size.tiny) strategy.entry("long",strategy.long, when = rsilongst or long11) //strategy.exit("exit","long",when = SHORT) strategy.entry("short",strategy.short, when = rsishortst or short11) //strategy.exit("exit","short",LONG)
Tested on 28Forex Pairs.