MarcoValente

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
開源腳本

秉持真正的TradingView精神,該腳本的作者將其開源發佈,因此交易者可以理解和驗證它。為作者加油!您可以免費使用它,但是在發佈中重複使用此程式碼受網站規則的約束。您可以把它加入到常用以在圖表上使用它。

想在圖表上使用此腳本?
//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
midBB=(upperBB+lowerBB)/2
//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
plotarrow(codiff,colorup=green,transp=40)
plotarrow(codiff2*-1,colordown=orange,transp=40)
//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)), 
            lengthKC,0)

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
datast=adx<=20
plotshape(dataup,style=shape.triangleup,location=location.abovebar,color=green)
plotshape(datadw,style=shape.triangledown,location=location.belowbar,color=maroon)
plotshape(datast,style=shape.diamond,color=red)

評論

hey Marco im trying this with indices like es and i see entry points are late.how can i adjust it?i mean i see green arrow almost on time but blue line couple candles later shows up.
thank you
+51 回覆
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
+18 回覆
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
+42 回覆
Spaydz garrettmac
@garrettmac, agreed curious where buy sell is... also wondering if it repaint?
+1 回覆
haq797 garrettmac
回覆
Hi. For what trade platform is this script?
+14 回覆
I don t know too, I use it on this site as support for trading. Sorry
+17 回覆
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
+62 回覆
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
+7 回覆
Double_R_86 Stevn4639
@Stevn4639, Still working well? I've been searching for a good short term BTC indicator. Have you tested on any other crypto? Thanks! =)
回覆