LazyBear

LBR Paintbars [LazyBear]



Added coloring of LB bars above/below Keltner Channel (as suggested by user @20813 below in the comments).

Updated code: pastebin.com/AhVQ1FBn.

See comments section below for a sample chart. Copy the code from the pastebin above and update your local copy (TV doesn't allow me to update an already published code -- yet!).

Added features:
- Switch ON/OFF KC
- Mark LB bars above/below KC

----------------------------------------------------------------------

The LBR PaintBars indicator changes the colour of the price bars based on the trend direction (derived from price & volatility bands). This is mostly used as a confirmation indicator.

For the Pine coders: I suggest trying stdev() in lieu of atr()...some wild combinations can be derived from this simple idea :)

Indicator supports the following options:
- Switching on/off volatility bands
- Switching on/off LBR colors (lime/maroon).
- Color non-LBR bars (blue).

Thanks @mseaworthy for pinging me with this idea.

Complete list of my indicators:
-----------------------------
docs.google.com...ByMEvm5MLo/edit?usp=sharin...

List of my free indicators: bit.ly/1LQaPK8
List of my indicators at Appstore: blog.tradingview.com/?p=970
Script open-source

Dans le véritable esprit de TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par le règlement. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser ce script sur un graphique ?
//
// @author LazyBear 
// List of all my indicators: 
// https://docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
//
study("LBR PaintBars [LazyBear]", overlay=true, shorttitle="LBRBARS_LB")
lbperiod = input (16, title="HL Length")
atrperiod = input(9, title="ATR Length")
mult = input (2.5, minval=0, title="ATR Multiplier")
bcf = input(true, title="Color LBR Bars?")
mnlb=input(false, title="Color non LBR Bars?" )
svb=input(false, title="Show Volatility Bands?")
aatr = mult * sma(atr(atrperiod), atrperiod) 
b1 = lowest(low, lbperiod) + aatr 
b2 = highest(high, lbperiod) - aatr 
uvf =  (close > b1 and close > b2)
lvf = (close < b1 and close < b2 )
uv = plot(svb?b2:na, style=line, linewidth=3, color=red, title="UpperBand")
lv = plot(svb?b1:na, style=line, linewidth=3, color=green, title="LowBand")
bc = (bcf ? uvf ? lime : lvf ? maroon : mnlb?blue:na : (not (uvf or lvf) and mnlb ? blue : na ) )
barcolor(bc)