# Probability Trend Indicator

Updated
Understanding the Indicator:

The indicator calculates the probabilities of upward and downward trends based on the percentage change in price over a specified lookback period.
It displays these probabilities in a table and plots a histogram to represent the difference between the probabilities.
The colors of the histogram bars indicate the trend direction and whether the trend is increasing or decreasing.

Setting the Lookback Period:

The indicator allows you to specify the lookback period, which determines the number of bars to consider for calculating the probabilities.
By default, the lookback period is set to 50 bars. However, you can adjust it based on your trading preferences and the timeframe you're analyzing.

Analyzing the Probabilities:

The indicator calculates the probabilities of upward and downward trends and displays them in a table on the chart.
The probabilities are presented as percentages, representing the likelihood of each type of trend occurring.
You can use these probabilities to gain insights into the potential market direction and assess the strength of the prevailing trend.

Interpreting the Histogram:

The histogram is plotted based on the difference between the probabilities of upward and downward trends, known as the oscillator value.
The histogram bars are colored to provide visual cues about the trend direction and whether the trend is gaining or losing strength.
Green bars indicate upward trends, and red bars indicate downward trends.
Lighter shades of green or red suggest increasing trends, while darker shades suggest decreasing trends.

The indicator serves as a tool for assessing the probabilities of trends and can be used alongside other technical analysis methods.
You can consider the probabilities, the histogram pattern, and the overall market context to make informed trading decisions.
It's important to remember that no indicator or tool can guarantee future market movements, so prudent risk management and additional analysis are essential.
Release Notes:
Improve calculation using @jdehorty kernel functions rational quadratic

Suggestion for a lookback period values

1 minute: 1440 Period
3 minutes: 480 Period
5 minutes: 288 Period
15 minutes: 96 Period
30 minutes: 48 Period
45 minutes: 32 Period
1 hour: 24 Period
2 hours: 12 Period
3 hours: 8 Period
4 hours: 6 Period

The rationale behind these calculations is that you need to calculate the probability within a 24-hour timeframe. Past data no longer matters, and you must act based on the current market situation to predict the future.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer