LazyBear

Color coded UO

2940 5 85
Small modification to stock UO code to highlight lows / highs. This helps to see the trend easily. The length to check for high/low is configurable (lengthSlope), I am yet to find the optimal setting but 30 looks nice so far.
Remove from Favorite Scripts Add to Favorite Scripts
//
// @author LazyBear
// @credits This is derived from the stock UO code at TV
// 
study(title="Ultimate Oscillator Bars [LazyBear]", shorttitle="UO_BARS [LazyBear]")
length7 = input(7, minval=1), length14 = input(14, minval=1), length28 = input(28, minval=1)
lengthSlope = input(1)
average(bp, tr_, length) => sum(bp, length) / sum(tr_, length)
high_ = max(high, close[1])
low_ = min(low, close[1])
bp = close - low_
tr_ = high_ - low_
avg7 = average(bp, tr_, length7)
avg14 = average(bp, tr_, length14)
avg28 = average(bp, tr_, length28)
out = 100 * (4*avg7 + 2*avg14 + avg28)/7
plot(out, color=red, title="UO")
bgcolor(falling(out, lengthSlope) ? red : (rising(out, lengthSlope) ? green : blue), transp=50)
List of my free indicators: http://bit.ly/1LQaPK8
List of my indicators at Appstore: http://blog.tradingview.com/?p=970

RyanT
2 years ago
works well
Reply
MONEYMENOW PRO
9 months ago
how does this work. I mean how to use this Indicator.
+5 Reply
ner MONEYMENOW
2 months ago
how to use the indicator
Reply
MONEYMENOW PRO
9 months ago
Thanks got it.. I am not a coder but looking at all the codes some day I might become a pseudocoder...
Reply
vinod1704
9 months ago
Does This Works On amibroker
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