offset = 2 // How many bars to the left to set the right side of the speedometer radius = 10 // Radius in bars of the semi circle y_axis = 0.00 // Where to place the y axis y_scale = 100 // Y axis scaling. 100 by default will size the semicircle to fit with for example RSI or any other oscillator with a 0..100 range
var float pi = 2 * asin(1) // Required variables needed for calculations
x_axis = array.new_int(radius * 2, 0) for i = offset to offset + 2 * radius - 1 array.set(x_axis, i - offset, time)
metric = rsi(src, len) // RSI is already 0..100 so no modification needed.
// Draw the needle and title using the metric f_draw_needle(metric, x_center, radius, y_axis, y_scale, color.blue, 1) f_draw_title_label(25, x_center, y_axis, y_scale, color.blue, color.black, "TRENDMETER")
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.