Just did my first trade: EU long
Beautiful/Brilliant system!
(Code here includes the Keltner Channels)
Beautiful/Brilliant system!
(Code here includes the Keltner Channels)
Inserted Code
//@version=3
study("M1Scalping",overlay=true,title="M1Scalping using BB", shorttitle="M1Scalping")
//Calculate BB, default stddev set to 1
length = input(25, minval=1, title="Length"), mult = input(2.0, minval=0.001, maxval=50, title="MultFactor")
source = close
midBB = sma(source, length)
dev = mult * stdev(source, length)
upperBB = midBB + dev
lowerBB = midBB - dev
c0=midBB[0]>midBB[1]?green:midBB[0]<midBB[1]?red:yellow
p0 = plot(midBB, color=c0, linewidth=1, style=cross,title="Middle BB")
p1 = plot(upperBB, color=blue, linewidth=3,title="Upper BB")
p2 = plot(lowerBB, color=blue, linewidth=3,title="Lower BB")
fill(p1, p2, color = yellow)
// plot smoothed MA
MA1len = input(120, minval=1, title="Smoothed MA1 Length")
MA1src = input(high, title="Smoothed MA1 Source")
MA2len = input(120, minval=1, title="Smoothed MA2 Length")
MA2src = input(close,title="Smoothed MA2 Source")
smma1 = 0.0
smma1 := na(smma1[1]) ? sma(MA1src, MA1len) : (smma1[1] * (MA1len - 1) + MA1src) / MA1len
MA1c01=smma1>smma1[1]?green:smma1<smma1[1]?red:yellow
plotsmma1=plot(smma1, color=MA1c01)
smma2 = 0.0
smma2 := na(smma2[1]) ? sma(MA2src, MA2len) : (smma2[1] * (MA2len -1) + MA2src) / MA2len
MA2c02=smma2>smma2[1]?green:smma2<smma2[1]?red:yellow
plotsmma2=plot(smma2, color=MA2c02)
fill(plotsmma1,plotsmma2,color=MA2c02)
// Plot Keltner Channels
KCuseTrueRange = input(true,title="KC True Range")
KClength = input(30, minval=1,title="Keltner Length")
KCmult = input(1.5, title="Keltner Multiplier")
KCma = sma(source, length)
KCrange = KCuseTrueRange ? tr : high - low
KCrangema = sma(KCrange, KClength)
KCupper = KCma + KCrangema * KCmult
KClower = KCma - KCrangema * KCmult
plot(KCupper, color=purple,linewidth=1,title="Upper KC")
plot(KClower, color=purple,linewidth=1,title="Lower KC")
// define bull or bear based on BB crossing
bull = crossunder(low,lowerBB) and close>max(smma1,smma2)
bear = crossover(high,upperBB) and close<min(smma1,smma2)
// Plot
plotshape(bull,"Buy",shape.labelup,location.belowbar,green,text="Long",transp=50,textcolor=black)
plotshape(bear,"Sell",shape.labeldown,location.abovebar,red,text="Short",transp=50,textcolor=black)
// End of script M1Scalping 2