Squeeze Indicator Pinescript (With Long Alerts)
Squeeze Indicator Pinescript (With Long Alerts)
plot(basis, color=color.gray)
p1 = plot(upper, color=color.blue)
p2 = plot(lower, color=color.blue)
fill(p1, p2)
useTrueRange = input(true)
mult2 = input(1.5)
ma = ema(src2, length2)
c = color.red
fill(u, l, color=c)
len = input(12, minval=1, title="Length3")
alertcondition(long_cond, "Buy", "upper bollinger band crossed over the upper keltner band, momentum is
positive")
alertcondition(long_cond2, "Buy", "lower bollinger band crossed under the lower keltner band, momentum
is positive")
//@version=4
//bollinger bands
plot(basis, color=color.gray)
p1 = plot(upper, color=color.blue)
p2 = plot(lower, color=color.blue)
fill(p1, p2)
//keltner channel
useTrueRange = input(true)
mult2 = input(1.5)
ma = ema(src2, length2)
c = color.red
fill(u, l, color=c)
//momentum
// BACKTESTING RANGE
// To Date Inputs
//trading conditions
//submit orders
if (long_entry1)
strategy.exit("long exit", "Bollinger-Keltner Crossover", profit = close * 0.4 / syminfo.mintick, loss= close *
0.2 / syminfo.mintick)
//alertcondition(long_cond, "Buy", "upper bollinger band crossed over the upper keltner band, momentum
is positive")
//alertcondition(long_cond2, "Buy", "lower bollinger band crossed under the lower keltner band,
momentum is positive")