LazyBear

Indicator: Ulcer Index

1136 5 70
Ulcer Index (UI) is a method for measuring investment risk that addresses the real concerns of investors, unlike the widely used standard deviation of return ( SD             ). It is a measure of the depth and duration of drawdowns in prices from earlier highs. In other words, it is a measure of volatility, but only volatility in the downward direction, i.e. the amount of drawdown or retracement occurring over a period.

The greater a drawdown in value, and the longer it takes to recover to earlier highs, the higher the UI. It measures the "severity" of drawdowns.

More info: http://en.wikipedia.org/wiki/Ulcer_index
Remove from Favorite Scripts Add to Favorite Scripts
// @author LazyBear
// Ulcer Index 
// @credits http://www.tangotools.com/ui/ui.htm

study(title = "Ulcer Index [LazyBear]", shorttitle="UlcerIndex_LB")
length=input(10)
cutoff=input(5)
hcl=highest(close,length)
r=100.0*((close-hcl)/hcl)
ui=sqrt(sum(pow(r,2), length)/length)
sl=plot(ui, color=ui>cutoff ? red : aqua)
hline(cutoff, color=red)
bl=plot(cutoff)
fill(sl,bl,color=silver)

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

IV is probably the best to benchmark. Ulcer is one of the best volatility price indicators out there for measuring... attempting to find perfect Overbought/Oversold Volatility Indicator(s).
snapshot
+2 Reply
QuantitativeExhaustion PRO QuantitativeExhaustion
2 years ago
How do you combine two (or more) lengths for an average?

Want to get a Ulcer indicator to look like RSI
+2 Reply
LazyBear PRO QuantitativeExhaustion
2 years ago
Code:
http://pastebin.com/kKEeEr9V

Allows 2 lengths and 2 cutoffs to be configured.

Sample:
snapshot
+2 Reply
ChartArt
2 years ago
LazyBear created a custom version of the Ulcer Index for me with background color alerts when the trend direction changes, based on my input.

http://pastebin.com/Cenrft3z

Thanks, LazyBear!
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