TradingView
a.tesla2018
25 mag 2020 17:33

Statistical Histogram with configurable bins and Data Window 

Euro Fx/U.S. DollarFXCM

Descrizione

Creates a Histogram for Statistical Analysis of any source.

Input Parameters:

Sample Source: Select your source here, can be any numerical source.
Sample Period: Sample size for Mean and Standard Deviation Calculations.
Enable Cumulative Mode: Will attempt to calculate the bin for every sample in the entire dataset.
Window Period: Used only in Window Mode (Enable Cumulative Mode unchecked), Calculates the bin for the past Window Period sample size.
Bin Label Spacing: Adjust horizontal spacing of Bin Labels below the histogram for easier viewing.
Center Bin: Selects the center Bin, usually set to (0 - Bin Width) < Sample <= 0 standard deviations or (z_score)
Bin Width: Selects the Bin Width in standard deviations.

How you can use it:

View characteristics of dataset such as unimodal/bimodal and skewness to determine preferred statistical analysis.

Additional Reference:


Credits:
Thanks goes out to https://www.tradingview.com/u/e2e4mfck/, for cleaning up some of the code and https://www.tradingview.com/u/alexgrover/ for the original idea.

Usage Tips:
When adjusting the bin parameters, center bin and bin width, verify that the total sum of the bins (Sum Frequency in the Data Window) is close to the Total Samples. If your Sum Frequency is drastically lower it means you need to adjust your center bin and/or bin width to capture more of the data available.
Commenti
PineCoders
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
allanster
Very impressive and the appearance looks great, great work!
e2e4mfck
Great script! Kudos!
a.tesla2018
Thank you all for the kind words. Hope you can find some use for this script.
Duyck
Beautyfully done!!!

Gr, JD.
babytalk
I have been wanting something like this for quite a while. Thank you so much for your sharing!
a.tesla2018
@babytalk, Yeah I wished for the same :)
kurtsmock
This is awesome man. Not sure how I'd use it, but it's still prety cool.
a.tesla2018
@kurtsmock, hook up atr or tr to the input and see what it looks like for your instrument/time frame and could use that to influence the size of your stops/targets for example.
kurtsmock
@a.tesla2018, Sweet deal man. I'll start there.
Altro