OPEN-SOURCE SCRIPT

Within Standard Deviation Bounds Probability

업데이트됨
This indicator calculates the probability of the closing price remaining within the upper and lower bounds defined by the mean and standard deviation of historical percent changes. It also plots the probability line and a horizontal line at 68%, which would be the expected probability for a normal distribution. It is designed to be used with my other indicator "Mean and Standard Deviation Lines.

Inputs:

period (Days): This defines the number of bars used to calculate the mean and standard deviation.

Calculations:

Percent change: Calculates the daily percentage change between closing prices.
Mean and standard deviation: Calculates the mean and standard deviation of the percent changes over the specified period.
Bounds: Calculates the upper and lower bounds by adding/subtracting the standard deviation from the mean, multiplied by the closing price.
Crossover tracking: Iterates through bars and counts crosses above and below the bounds.
Probability calculation: Calculates the total crossover probability as a percentage of the period.
Plotting: Plots the probability line and the horizontal line at 68%.

Limitations:

Assumes a normal distribution of price changes, which may not be accurate in real markets.

Overall:

This indicator provides a way to visualize the probability of the price staying within calculated bounds based on historical volatility. However, it's important to be aware of its limitations and interpret the results within the context of your trading strategy and risk management.
릴리즈 노트
added Probability of up/down crossings within the last period.
릴리즈 노트
Changed display order to match the Mean and Standard Devialtion Lines indicator
릴리즈 노트
added probability of closing above the mean
added horizontal line at 50%
릴리즈 노트
change some colors and added the probability to close below the current price as a red line.
릴리즈 노트
added horizontal lines at 5% and 95%
릴리즈 노트
updated the math. This indicator is a work in progress so be careful when you use it.
릴리즈 노트
added probability of the mean to occur with the bar range in purple and changed the default period to 100.
릴리즈 노트
copyright notice and cleanup.
릴리즈 노트
Cleaned things up to be consistent with the title of the script. The script calculates the probability the close will remain within the bounds shown in mean and standard deviation lines script within the specified period.
릴리즈 노트
Updated the script to use built-in functions to calculation sample statistics.
Added separate variables to calculate sample mean and standard deviation.
Added a variable to control probability calculation window.
릴리즈 노트
updated the license to Creative Commons BY-NC-ND 4.0
statistics

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?


또한 다음에서도:

면책사항