LazyBear

Insync Index [LazyBear]

BB Support + Histo mode
-------------------------------
Code: http://pastebin.com/4QKdCEs7

Show enclosing BB
snapshot

Show Insync as Histo:
snapshot


v02 - Configurable levels
---------------------------------

Small update to allow configuring the 95/75/25/5 levels.

Latest source code: http://pastebin.com/fZ4PmemR

v01 - orginal description
---------------------------------

Insync Index , by Norm North, is a consensus indicator. It uses RSI , MACD , MFI             , DPO, ROC, Stoch , CCI and %B to calculate a composite signal. Basically, this index shows that when a majority of underlying indicators is in sync, a turning point is near.

There are couple of ways to use this indicator.
- Buy when crossing up 5, sell when crossing down 95.
- Market is typically bullish when index is above 50, bearish when below 50. This can be a great confirmation signal for price action + trend lines.

Also, since this is typical oscillator, look for divergences between price and index .

Levels 75/25 are early warning levels. Note that, index > 75 (and less than 95) should be considered very bullish and index below 25 (but above 5) as very bearish . Levels 95/5 are equivalent to traditional OB/OS levels.

The various values of the underlying components can be tuned via options page. I have also provided an option to color bars based on the index value.

More info: The Insync Index by Norm North, TASC Jan 1995
https://drive.google.com/file/d/0Bx48Du_2aPFnaERoOXNjcnFONlk/view?usp=sharing

List of my free indicators: http://bit.ly/1LQaPK8
List of my app-store indicators: http://blog.tradingview.com/?p=970
(Support doc: http://bit.ly/lazybeardoc)
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear 
// List of all my indicators: http://bit.ly/1LQaPK8
// 
study(title = "Insync Index [LazyBear]", shorttitle="II_LB")
src=close
div = input(10000, title="EMO Divisor", minval=1)
emoLength = input(14, minval=1, title="EMO length")
fastLength = input(12, minval=1, title="MACD Fast EMA Length")
slowLength=input(26,minval=1, title="MACD Slow EMA Length")
signalLength=input(9,minval=1, title="MACD Signal Length")
mfiLength = input(20, minval=1, title="MFI Length")

calc_emo() => sma(div * change(hl2) * (high - low) / volume, emoLength)
calc_macd(source) =>
    fastMA = ema(source, fastLength)
    slowMA = ema(source, slowLength)
    fastMA - slowMA

calc_mfi(length) => 
    src = hlc3
    upper = sum(volume * (change(src) <= 0 ? 0 : src), length)
    lower = sum(volume * (change(src) >= 0 ? 0 : src), length)
    mf = rsi(upper, lower)
    mf

calc_dpo(period_) =>  
    isCentered = false
    barsback = period_/2 + 1
    ma = sma(close, period_)
    dpo = isCentered ? close[barsback] - ma : close - ma[barsback]
    dpo

calc_roc(source, length) =>
    roc = 100 * (source - source[length])/source[length]
    roc

calc_stochD(length, smoothD, smoothK) =>
    k = sma(stoch(close, high, low, length), smoothK)
    d = sma(k, smoothD)
    d

calc_stochK(length, smoothD, smoothK) =>
    k = sma(stoch(close, high, low, length), smoothK)
    //d = sma(k, smoothD)
    k

lengthBB=input(20, title="BB Length"), multBB=input(2.0, title="BB Multiplier")    
lengthCCI=input(14, title="CCI Length")
dpoLength=input(18, title="DPO Length")
lengthROC=input(10, title="ROC Length")
lengthRSI=input(14, title="RSI Length")
lengthStoch=input(14, title="Stoch Length"),lengthD=input(3, title="Stoch D Length"), lengthK=input(1, title="Stoch K Length")
lengthSMA=input(10, title="MA Length")

bolinslb=sma( src,lengthBB ) - multBB * ( stdev( src,lengthBB ) )
bolinsub=sma( src,lengthBB ) + multBB * ( stdev( src,lengthBB ) )
bolins2= (src- bolinslb ) / ( bolinsub - bolinslb )
bolinsll=( bolins2 < 0.05 ? -5 : ( bolins2 > 0.95 ? 5 : 0 ) )
cciins= ( cci(src, lengthCCI) > 100 ? 5 :  ( cci(src, lengthCCI ) < -100 ? -5 : 0 ) )
emvins2= calc_emo() - sma( calc_emo(),lengthSMA)
emvinsb= ( emvins2 < 0 ? ( sma( calc_emo() ,lengthSMA ) < 0 ? -5 : 0 ) : 0 )
emvinss= ( emvins2 > 0 ? ( sma( calc_emo() ,lengthSMA ) > 0 ? 5  : 0 ) : 0 )
macdins2= calc_macd( src) - sma( calc_macd( src) ,lengthSMA )
macdinsb= ( macdins2 < 0 ? ( sma( calc_macd( src),lengthSMA ) < 0 ? -5 : 0 ) : 0 )
macdinss=( macdins2 > 0 ? ( sma( calc_macd( src),lengthSMA) > 0 ? 5 : 0 ) : 0 )
mfiins=( calc_mfi( mfiLength ) > 80 ? 5 : ( calc_mfi( mfiLength ) < 20 ? -5 : 0 ) )
pdoins2=calc_dpo( dpoLength ) - sma( calc_dpo( dpoLength ),lengthSMA )
pdoinsb=( pdoins2 < 0 ? ( sma( calc_dpo( dpoLength ),lengthSMA) < 0 ? -5 : 0 ) :0 )
pdoinss=( pdoins2 > 0 ? ( sma( calc_dpo( dpoLength ),lengthSMA) > 0 ? 5 : 0 ) :0 )
rocins2=calc_roc( src,lengthROC  ) - sma( calc_roc( src,lengthROC ),lengthSMA  )
rocinsb=( rocins2 < 0 ? ( sma( calc_roc( src,lengthROC ),lengthSMA  ) < 0 ? -5 : 0 ) : 0 )
rocinss = ( rocins2 > 0 ? ( sma( calc_roc( src,lengthROC ),lengthSMA ) > 0 ? 5 : 0 ) : 0 )
rsiins= ( rsi(src, lengthRSI ) > 70 ? 5  : ( rsi(src, lengthRSI )  < 30 ? -5 : 0 ) )

stopdins=( calc_stochD(lengthStoch,lengthD,lengthK ) > 80 ? 5 : ( calc_stochD(lengthStoch,lengthD, lengthK ) < 20 ? -5 : 0 ) )
stopkins=( calc_stochK(lengthStoch,lengthD,lengthK) > 80 ? 5 : ( calc_stochK(lengthStoch,lengthD, lengthK ) < 20 ? -5 : 0 ) )

iidx = 50 + cciins + bolinsll + rsiins + stopkins + stopdins + mfiins + emvinsb + emvinss + rocinss + rocinsb + nz(pdoinss[10]) + nz(pdoinsb [10]) + macdinss + macdinsb
ml=plot(50, color=gray, title="Line50")
ll=plot(5, color= green, title="Line5")
ul=plot(95, color = red, title="Line95")

plot(25, color= green, style=3, title="Line25")
plot(75, color = red, style=3, title="Line75")

fill(ml, ll, color=red)
fill(ml, ul, color=green)

il=plot(iidx, color=maroon, linewidth=2, title="InsyncIndex")
fill(ml,il,black)

bc = iidx >= 50 ? (iidx >= 95 ? #336600 : iidx >= 75 ? #33CC00 : #00FF00) : 
    (iidx <= 5 ? #990000 : iidx <= 25? #CC3300 :  #CC9900)

ebc = input(false, title="Enable Barcolors")
barcolor(ebc?bc:na)
List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

Is this the holy grail ?
Reply
LazyBear PRO MagnusTradingGroup
2 years ago
close :)
+2 Reply
johnrfraser
2 years ago
Hi Lazybear. The horizontal dotted s&l lines in the price chart...are they your own manual ones? The indicator doesn't do that?
+1 Reply
johnrfraser johnrfraser
2 years ago
* buy/sell lines
Reply
LazyBear PRO johnrfraser
2 years ago
They are support/resistance lines and are drawn automatically by a different indicator - RSI S/R Levels (details: http://blog.tradingview.com/?p=970).
+1 Reply
johnrfraser LazyBear
2 years ago
Thanks a lot Lazybear. This is very cool.
So it is proprietary and therefore needs to be bought?
Does the subscription include other proprietary indicators?
What distinguishes the free ones from the coveted 'for sale' ones?
+1 Reply
johnrfraser LazyBear
2 years ago
Sorry, just saw link up the top.
Is there a possible trial period?
Do you need a Pro account to run these mtf indicators?
Reply
LazyBear PRO johnrfraser
2 years ago
You do not need PRO for using these indicators.

Currently there is no provision to do "trial" for appstore indicators (one of the features we have requested to TV).

BTW, the documentation for these indicators are @ http://bit.ly/lazybeardoc That should give a good idea about the indicators/features included.
+1 Reply
accidentje
2 years ago
Thanks again!
Reply
LazyBear PRO accidentje
2 years ago
yw :)
Reply
TonyCampbell
2 years ago
Thank you LazyBear ! Would it be possible to allow the thresholds to be user defined? 95/5 is a little restrictive for me; I might prefer 90/10 for OB/OS.
Tried to change the code, but didn't work for me......
Thanks for your ideas!
+1 Reply
LazyBear PRO TonyCampbell
2 years ago
Hi Tony

Here's the updated source code: http://pastebin.com/fZ4PmemR

This allows configuring Line95/75/25/5.

Thanks
Reply
TonyCampbell LazyBear
2 years ago
Hello LazyBear

I get some kind of error message when I try to paste this into PineScript that says "mis-matched characters."

Thanks for your help.
Reply
LazyBear PRO TonyCampbell
2 years ago
Try copy/pasting from the RAW section (if u scroll down on that pastebin link, u will see a text box with the contents. That is the RAW section).
Reply
rubenthin PRO
2 years ago
Hi LazyBear.
I've been studying the InsyncIndex and trialing it now.
Trying to keep indictors to a minimum, I've had to forfeit my previous favourite, your MFI in Bolinger band.
Do you think you can do InsyncIndex in a Bolinger band in the same way?
Reply
LazyBear PRO rubenthin
2 years ago
Here you go:
Src: http://pastebin.com/QthKHEZa

snapshot
Reply
rubenthin PRO LazyBear
2 years ago
You rock LazyBear! Thanks so much :-)
Enough freebies, time for me to buy your sr levels :-)
Actually, could we use InsyncIndex with your multi timeframe panes?
Thanks so much for helping.
Reply
LazyBear PRO rubenthin
2 years ago
YW.

Yes, MTF Panes or S/R lines will fit in with any strategy (or indicators). Feel free to PM me if you have any questions.
Reply
andreas73
2 years ago
Hi, my indi is only shown as a line, how can I get your version as histo?

Reply
LazyBear PRO andreas73
2 years ago
Here's an updated source that can be shown as Histo: http://pastebin.com/4QKdCEs7

Sample chart:
snapshot
Reply
andreas73 LazyBear
2 years ago
Thank you , is working
Reply
Behi
10 months ago
Is it working with currency pair?
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out