alessm65617

Within Standard Deviation Bounds Probability

alessm65617 Telah dikemas kini   
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.
Nota Keluaran:
added Probability of up/down crossings within the last period.
Nota Keluaran:
Changed display order to match the Mean and Standard Devialtion Lines indicator
Nota Keluaran:
added probability of closing above the mean
added horizontal line at 50%
Nota Keluaran:
change some colors and added the probability to close below the current price as a red line.
Nota Keluaran:
added horizontal lines at 5% and 95%
Nota Keluaran:
updated the math. This indicator is a work in progress so be careful when you use it.
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?