TradingView
twingall
14 août 2022 12:43

Williams % Range overlay mini plot 

E-mini S&P 500 FuturesCME

Description

Plots Williams Percent Range over bought/oversold indicator as a small overlay in top right corner.
De-clutter chart when all you're interested in is the real-time W%R to 'give permission' to enter a trade.
i.e. to remove the Williams %R lower pane from the above chart completely.

~~User Inputs~~
~W%R length
~Number of bars to show (default is last 6 bars)
~Plot offset (horizontal position of the plot; can be negative)
~Line color and thickness
~Show/hide plot title

~~tips~~
~in line 26, edit the multiplier (3*), to compress/expand the vertical size of the plot

Notes de version

Added multi-timeframe support: Choose two higher timeframes to plot adjacent to the current timeframe plot

Notes de version

fixed spacing issue

Notes de version

option to show HTF or only show single plot (current timeframe)

Notes de version

cleaned up formatting options to allow for minimalist view

Notes de version

-Added Filter conditions for Overbought/Oversold: 1 timeframe, 2 timeframes or all 3 timeframes in agreement. Highlight candle bodies and/or background when this occurs.
-Added -80 and -20 reference lines

(note: bgcolor and barcolor are the only options for highlighting, since label, plotchar, plotshape all mess up the scaling of the miniplot)

Demo of Filter condition: triple timeframe agreement Overbought W%R

Notes de version

-update chart

Notes de version

-update comments

Notes de version

-update chart
Commentaires
twingall
something like this added:
if WPR >= -80 l=label.new(bar_index,high, "",xloc=xloc.bar_index, style=label.style_xcross, textcolor=color.red, size = size.small, textalign=text.align_left) label.delete(l[1])

.. but adding more drawings in this way messes up the scale/position of the mini plots..
..could write as seperate indicator; or could try using: alertcondition(condition, title, message)
twingall
@twingall, correction: label.delete(l "squarebracket" 1 "squarebracket" )
(annoyingly this comment text editor deletes anything placed in square brackets)
EmanuelAlho
Hello, fantastic work, thank you!!
Its possible to update it, for as soon willy goes overB or overS prints a cross under the candle, i tried to do with but without success, to hard for my head :D
It would be great!! Thanks anyway.
Cheers.
twingall
@EmanuelAlho, updated to highlight candle when OB/OS(single, double or triple agreement conditions available). Cross or labels won't work (scaling issues) so used bgColor and/or candle body color
EmanuelAlho
@twingall, great, thank you! it's great with the background color too.
ty.
Plus