Intraday TS ,BB + Buy/Sell +Squeeze Mom.+ adx-dmi

Intraday 5+ min indicator/strategy. Mix of indicator as BB, Ema , Roc , adx /dmi with buy and TP/SL point. All in 1 indicator easy to use . Just look the color chnge and the shape add the the bars
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
//Created By Marco 25 03 2016
// Intraday 5 min
study(title="Intraday TS ,BB + Buy/Sell +Squeeze Mom.+ adx-dmi", shorttitle="Intraday (5 min+) Strategy", overlay=true)
bblenght = input(46, minval=1, title="Bollinger Bars Lenght")
bbstdev = input(0.35, minval=0.1,step=0.05, title="Bollinger Bars Standard Deviation")
tp =input(0.0,defval=0.0,step=0.1,title ="percentuale take profitto")

//Calculate BB 55 0.2
source = close
basis = sma(source, bblenght)
dev = bbstdev * stdev(source, bblenght)
upperBB = basis + dev
lowerBB = basis - dev
//is over the top?
isOverBBTop = low > upperBB ? true : false
isUnderBBBottom = high < lowerBB ? true : false
newisOverBBTop = isOverBBTop != isOverBBTop[1]
newisUnderBBBottom = isUnderBBBottom != isUnderBBBottom[1]
//receive high and low range
high_range = valuewhen(newisOverBBTop,high,0)
low_range = valuewhen(newisUnderBBBottom,low,0)

bblow = valuewhen(newisOverBBTop,(lowerBB/0.00005) *  0.00005,0)
bbhigh = valuewhen(newisUnderBBBottom,(((upperBB*1000)/5)+5) * 5/1000,0)

//take it only if over the BB limit
buy_limit_entry = isOverBBTop ? high_range==high_range[1] ? high_range+0.001: na : na
sell_limit_entry = isUnderBBBottom ? low_range==low_range[1] ? low_range-0.001: na : na

take_profit_buy=  isOverBBTop ? high_range==high_range[1] ? (buy_limit_entry + buy_limit_entry-bblow)+(buy_limit_entry + buy_limit_entry-bblow)*tp/500 : na : na 
take_profit_sell= isUnderBBBottom ? low_range==low_range[1] ?(sell_limit_entry -(bbhigh-sell_limit_entry))-(sell_limit_entry-(bbhigh-sell_limit_entry))*tp/500 : na : na

take_profit2_buy=  isOverBBTop ? high_range==high_range[1] ? buy_limit_entry + 2*(buy_limit_entry-bblow)+(buy_limit_entry + 2*(buy_limit_entry-bblow))*tp/500 : na : na 
take_profit2_sell= isUnderBBBottom ? low_range==low_range[1] ? sell_limit_entry - 2*(bbhigh-sell_limit_entry)-(sell_limit_entry - 2*(bbhigh-sell_limit_entry))*tp/500 : na : na

stop_loss_buy = isOverBBTop ? high_range==high_range[1] ? bblow : na : na 
stop_loss_sell = isUnderBBBottom ? low_range==low_range[1] ? bbhigh : na : na

highlightHigh = isOverBBTop ? lime : aqua
highlightLow  = isUnderBBBottom ? lime : aqua

colorLineUp = buy_limit_entry ? blue : blue
colorLineDown = sell_limit_entry ? red : red

colorBuyTP = close>=take_profit_buy ? lime : fuchsia
colorSellTP = close<=take_profit_sell ? lime : fuchsia
colorBuyTP2 = close>=take_profit2_buy ? lime : fuchsia
colorSellTP2 = close<=take_profit2_sell ? lime : fuchsia

barcolor((high >= lowerBB and low <= upperBB) ? aqua : na)
barcolor((high < sell_limit_entry and low > take_profit_sell) ? orange : na)
barcolor((low > buy_limit_entry and high < take_profit_buy) ? orange : na)
barcolor(high >= take_profit_buy and not(na(buy_limit_entry)==1) ? fuchsia : low <= take_profit_sell and not(na(sell_limit_entry)==1) ? fuchsia : na)
//plot Statements
bbup=plot(upperBB, title="BB Upper Band", style=linebr, linewidth=2, color=highlightHigh)
bbdo=plot(lowerBB, title="BB Bottom Band", style=linebr, linewidth=2, color=highlightLow)
plot( buy_limit_entry, title="Buy Entry", style=linebr, linewidth=2, color=colorLineUp, transp=80)
plot( sell_limit_entry, title="Short Entry", style=linebr, linewidth=2, color=colorLineDown, transp=80)
plot( stop_loss_buy, title="Buy Stop", style=circles, linewidth=2, color=maroon, transp=0)
plot( stop_loss_sell, title="Short Stop", style=circles, linewidth=2, color=maroon, transp=20)
plot( take_profit_buy, title="Buy TP 1:1", style=circles, linewidth=2, color=colorBuyTP, transp=20)
plot( take_profit_sell, title="Short TP 1:1", style=circles, linewidth=2, color=colorSellTP, transp=20)
plot( take_profit2_buy, title="Buy TP2 1:2", style=circles, linewidth=2, color=colorBuyTP2, transp=20)
plot( take_profit2_sell, title="Short TP2 1:2", style=circles, linewidth=2, color=colorSellTP2, transp=20)
fill(bbup, bbdo, color=aqua, transp=87)

////study("plotarrow example", overlay=true)
compra= isOverBBTop ? high_range==high_range[1] ? high_range+0.001: 1: 0
vendi = isUnderBBBottom ? low_range==low_range[1] ? low_range-0.001: 1 : 0
codiff = compra ==1 ? compra: 0
codiff2 = vendi ==1 ? vendi :0
//Squeeze Mom

length = input(20, title="BB Length")
mult = input(2.0,title="BB MultFactor")
lengthKC=input(20, title="KC Length")
multKC = input(1.5, title="KC MultFactor")

useTrueRange = input(true, title="Use TrueRange (KC)", type=bool)

basis1 = sma(source, length)
dev1 = mult * stdev(source, length)
upperBB1 = basis1 + dev1
lowerBB1 = basis1 - dev1

// Calculate KC
ma = sma(source, lengthKC)
range = useTrueRange ? tr : (high - low)
rangema = sma(range, lengthKC)
upperKC = ma + rangema * multKC
lowerKC = ma - rangema * multKC

sqzOn  = (lowerBB1 > lowerKC) and (upperBB1 < upperKC)
sqzOff = (lowerBB1 < lowerKC) and (upperBB1 > upperKC)
noSqz  = (sqzOn == false) and (sqzOff == false)

val = linreg(source  -  avg(avg(highest(high, lengthKC), lowest(low, lengthKC)),sma(close,lengthKC)), 

bcolor = iff( val > 0, 
            iff( val > nz(val[1]), lime, green),
            iff( val < nz(val[1]), red, maroon))
scolor = noSqz ? blue : sqzOn ? black : gray 
plot(midBB, color=bcolor, style=linebr, linewidth=3)
plot(midBB, color=scolor, style=cross, linewidth=2)

//study(title="Directional Movement Index", shorttitle="DMI")
len = input(14, minval=1, title="DI Length")
lensig = input(14, title="ADX Smoothing", minval=1, maxval=50)
up = change(high)
down = -change(low)
trur = rma(tr, len)
plus = fixnan(100 * rma(up > down and up > 0 ? up : 0, len) / trur)
minus = fixnan(100 * rma(down > up and down > 0 ? down : 0, len) / trur)
sum = plus + minus 
adx = 100 * rma(abs(plus - minus) / (sum == 0 ? 1 : sum), lensig)

//study(title="plotshape example 1", overlay=true)
dataup= plus >= minus and adx>=29
datadw=minus>=plus and adx>=29


hey Marco im trying this with indices like es and i see entry points are can i adjust it?i mean i see green arrow almost on time but blue line couple candles later shows up.
thank you
+31 Reply
You have this sling slide based on sma , small triangle on top of the bar indicates the direction of trend and its intensity (DMI and ADX), TP and SL based on volatility but you can change it from format. The line between the slide streem has a true range Squeeze indicator (small cross black and gray) , and the line itself is a trend indicator and change color from green to red. from format easy to change length , factor and all parameter. I used this conf. on 5 to 15 frame on Oil and share with hight vol
+12 Reply
garrettmac MarcoValente
@MarcoValente, can you clarity what the colors indicate. Looks useful but way too much information and hear if there’s not documentation it’s hard to absorb
+29 Reply
Spaydz garrettmac
@garrettmac, agreed curious where buy sell is... also wondering if it repaint?
Hi. For what trade platform is this script?
+9 Reply
I don t know too, I use it on this site as support for trading. Sorry
+16 Reply
AamirKhan MarcoValente
@MarcoValente, Can you please explain how exactly it works? There is too much information, if you explain all the indicators and how to enter the trade, that will be great
+51 Reply
this indicator works great on bitcoin 1 minute chart no matter the conditions. it will fire the buy signal on the downtrend without fail if you are patient and can wait for it. it is the bottom bounce candle with the wick that has a green frame around it. any time i see that candle show up it works- just have to wait for it
+5 Reply
Marco, I came across this recently and it took me a while to understand it. Now that I have a feel for it I am so impressed with your work. This is brilliant, basically a trading system in one indicator. Thanks so much!
+2 Reply
MurrayStonks TraderMax_11
@TraderMax_11, Any TL;DR on how the heck this indicator works? I'm not even going to pretend to understand half the symbols.
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out