TradingView
taylor_o
2021년 12월 10일 오후 9시 38분

level_stats 

VOLATILITY S&P 500TVC

설명

This script tells you the percentage of time an instrument's closing value is above and below a level of your choosing. The background color visually indicates periods where the instrument closed at or above the level (red) and below it (blue). For "stationary-ish" processes, you can get a loose feel for the mean, high, and low values. The historical information conveyed through the background coloring can help you plan derivatives trades. Try with your favorite pairs, commodities, or volatility indices.

Usage: pick a level of interest using the input.

릴리즈 노트

Added a histogram to depict the distribution of closing prices. Prices less than the "level" input are blue, while those above the level are red. This color scheme is also used to color the chart background.

릴리즈 노트

removed some debug code

릴리즈 노트

added mean, median, and stdev

릴리즈 노트

Added a date selection. The statistics and histogram will reflect only the period [ start, end ).

릴리즈 노트

added a horizontal line (light red) to indicate the level

릴리즈 노트

The histogram's width, height, and number of buckets are now adjustable inputs. More buckets will make the histogram somewhat smoother and more detailed, but at the cost of performance. The maximum number of buckets is probably around 80. The width and height units are "percentage of the screen".

I have set the defaults at levels that perform reasonably well.
코멘트
user1928374560XYZ
can we get some way to better see or label the distribution histogram?
taylor_o
@Uni_ve12se, you can make the histogram bigger with the "width" and "height" inputs. regarding labels, unfortunately i can't think of a good way to add these. i will take another look at the code and update you if i find a way.
user1928374560XYZ
@voided, would appreciate that, thank you.
grdnryntrader
Love this, thanks!
Although it doesn't seem to recalculate when the date range is changed, this would be a very handy and important feature if possible.
taylor_o
@grdnryntrader, good suggestion! I added "start" and "end" inputs. the histogram and table will reflect only the period [ start, end ). hope that works for you!
grdnryntrader
@voided, That will do the trick! Merci
더보기