TradingView
MarcoValente
Mar 25, 2016 6:45 PM

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

Crude Oil (WTI)FXCM

Description

Update version with legend on data window and new colors on the squeeze mom idicator
Comments
Dunk7
Would like more info on how to use this strategy.
Help please
David
djjluis2017
@Dunk7, how to used this?
snbalar
How to use this strategy????
satyasinghsks20
Yes
ashwin12345
How to use this system ?
maher201010
good
arad001049
//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",
pratik7590
Chill guys it won't work, too many fake signals
ninjadave_uk
Great strategy, just one thing there seems to be a bug with the way its drawing the SL line for shorts in forex pairs, its a lot higher than the upper bb line so the tp lines are really far down. Thx for your work!
How to use this strat is in the comments section of the previous version, it has the same name but without 'update' in the title
More