You are on page 1of 6

You can use this script in Tradingview site.

//1) CCI MTF

//This indicator will draw the following

//CCI-8 on 5 minutes

//CCI-34 on 5 minutes

//CCI-34 on 30 minutes interval on 5 minutes

//2) Strength Candle Detection

//This is put a * over any strength candle

//3) EMA

//This will plot EMA 5, EMA 21 and EMA 55

//4) Panchang Time

//Includes Pre-open and 4 timeslots

//5) ORB Logic

//ORBH and ORBL are plotted

//6) Fibonacci Levels

//Levels 0.618, 1 and 1.618 are plotted

//7) Highest High and Lowest Low Strength Candles detected with CCI > 100 and CCI< -100 and
indicated bye CCI_BO_B and CCI_BO_S

//8) Parabolic SAR to identify reversals

study("NimblrTA", shorttitle="NimblrTA",overlay=true)

len = input(8, title="Length", type=integer)

len2 = input(34, title="Length", type=integer)

src = input(close, title="Source", type=source)

show5m = input(true, title="show 5m", type=bool)

show30m = input(true, title="show 30m", type=bool)

cci34_5m = cci(src,len2)

cci8_5m = security(ticker,"5",cci(src,len))

cci34_30m = security(ticker,"30",cci(src,len2))
mode = input(title='Mode (1:timeframe, 2:session):', type=integer, minval=1, maxval=2, defval=1)

tf = input(title='Timeframe for open range:', type=string, defval='15', confirm=false)

tf2 = input(title='Timeframe for range capture:', type=string, defval='D', confirm=false)

sess = input(title='Session for mode 2:', type=string, defval='0915-1530')

f_is_new_day(_mode) => _mode == 1 ? change(time(tf2))!=0 : _mode == 2 ? change(time(tf2, sess))!


=0 : false

ND_open = f_is_new_day(mode) ? security(tickerid, tf, open) : ND_open[1]

ND_high = f_is_new_day(mode) ? security(tickerid, tf, high) : ND_high[1]

ND_low = f_is_new_day(mode) ? security(tickerid, tf, low) : ND_low[1]

ND_stretch = na(ND_stretch[1]) ? 0 : f_is_new_day(mode) ? (ND_stretch[1]*9 + security(tickerid, tf,


(high-open)>=(open-low)?high-open:open-low)) / 10 : ND_stretch[1]

filter_high = f_is_new_day(mode) ? na : ND_high

filter_low = f_is_new_day(mode) ? na : ND_low

filter_high_stretch = f_is_new_day(mode) ? na : ND_high+ND_stretch

filter_low_stretch = f_is_new_day(mode) ? na : ND_low-ND_stretch

fh = plot(title='ORBH', series=filter_high, style=circles, linewidth=2, color=#00ffff,transp=0 )

fl = plot(title='ORBL', series=filter_low, style=circles, linewidth=2, color=#ff9800,transp=0)

//Detect BH>50%CH Candle

// Input variable for maximum candlestick body size in relation to high low candlestick range

MaxBodySize = input(defval = 50,type = float, title = "Minimal Body Size (%)")

// If you want to draw a shape in the middle of candlestick body then this variable is needed

// Use with plotshape and location = location.absolute

MidCandleBody = (open + close) /2


// Create candlestick low high range comparison variable

LowHighRange = ((high - low) / 100) * MaxBodySize

// Avoid negative total Candlestick body size

CandleBodySize = iff(close >= open, close - open, open - close)

// Evaluation to determine drawing points

DrawPoint = iff(CandleBodySize>LowHighRange, MidCandleBody,na)

BOCandle_B=iff( close>open and DrawPoint==MidCandleBody and close>filter_high and


high>filter_high, 1, 0)

//Sell condition

BOCandle_S=iff( close<open and DrawPoint==MidCandleBody and close<filter_low and


low<filter_low, 1, 0)

// Plot drawing points

plotchar(DrawPoint,char = '*', color = #c0c0c0, location = location.abovebar, transp = 0,size =


size.tiny)

//Plot 5 21 55 EMA

ema5 = ema(close, 5)

ema21 = ema(close, 21)

ema55 = ema(close, 55)

plot(ema5, color = #ff9800, title="EMA5",transp=0,linewidth=2)

plot(ema21, color = #00bcd4, title="EMA21",transp=0,linewidth=2)

plot(ema55, color = #4caf50, title="EMA55",transp=0,linewidth=2)

//Panchang Time

timeinrange(res, sess) => time(res, sess) != 0

premarket = orange

regular = #aeb6bf

regularslot2 = #5f6a6a
regularslot3 = #aeb6bf

regularslot4 = #5f6a6a

regularslot5 = #aeb6bf

postmarket = #aeb6bf

notrading = na

sessioncolor = timeinrange("5", "0915-0930") ? premarket : timeinrange("5", "0915-0930") ?


regular : timeinrange("5", "0931-1019") ? regularslot2 : timeinrange("5", "1020-1125") ? regularslot3
: timeinrange("5", "1126-1316") ? regularslot4 : timeinrange("5", "1317-1433")? regularslot5 :
timeinrange("5", "1434-1530")? postmarket : notrading

bgcolor(sessioncolor, transp=90)

//Bar count after Pre-Open

//barcount=barssince(timeinrange("5", "0915-0930"))

//plot(barcount,title="Barcount")

//Plot Fibo levels based on ORBH and ORBL

//Display Fibo for Bull

plot(filter_high+(filter_high-filter_low)*1,title="fibo_b_1", color=green, style=circles, linewidth=1)

plot(filter_high+(filter_high-filter_low)*0.618,title="fibo_b_0_618", color=green, style=circles,


linewidth=1)

plot(filter_high+(filter_high-filter_low)*1.618,title="fibo_b_1_618", color=green, style=circles,


linewidth=1)

//Display Fibo for Bull

//Display Fibo for Bear

plot(filter_low-(filter_high-filter_low)*1,title="fibo_s_1", color=red, style=circles, linewidth=1)

plot(filter_low-(filter_high-filter_low)*0.618,title="fibo_s_0_618", color=red, style=circles,


linewidth=1)

plot(filter_low-(filter_high-filter_low)*1.618,title="fibo_s_1_618", color=red, style=circles,


linewidth=1)

//Display Fibo for Bear

newHigh = (high == highest(high, 21))


newLow = (low == lowest(low, 21))

HighestHigh=newHigh*BOCandle_B

plot(HighestHigh,title="HighestHigh")

//Sell Condition

LowestLow=newLow*BOCandle_S

plot(LowestLow,title="LowestLow")

CCI_BO_B=iff( BOCandle_B*HighestHigh==1 and cci34_30m>100, 1, 0)

plot(CCI_BO_B,title="CCI_BO_B")

//Sell Condition

CCI_BO_S=iff( BOCandle_S*LowestLow==1 and cci34_30m<-100, 1, 0)

plot(CCI_BO_S,title="CCI_BO_S")

start = input(0.01, minval=0, maxval=0.2, title="Start")

increment = input(0.01, minval=0, maxval=0.2, title="Step Setting (Sensitivity)" )

maximum = input(0.2, minval=1, maxval=0.2, title="Maximum Step (Sensitivity)")

sus = input(true, "Show Up Trending Parabolic Sar")

sds = input(true, "Show Down Trending Parabolic Sar")

//Parabolic SAR for NimblrTA

startCalc = start

incrementCalc = increment

maximumCalc = maximum

sarUp = sar(startCalc, incrementCalc, maximumCalc)

sarDown = sar(startCalc, incrementCalc, maximumCalc)


plot(sus and sarUp ? sarUp : na, title="Up Trending SAR", style=circles,
linewidth=1,color=#fff9c4,transp=0)

plot(sds and sarDown ? sarDown : na, title="Up Trending SAR", style=circles,


linewidth=1,color=#fff9c4,transp=0)

You might also like