OPEN-SOURCE SCRIPT

Cumulative Distribution of a Dataset [SS]

Actualizado
This is the Cumulative Distribution of a Dataset indicator that also calculates the Kurtosis and Skewness for a selected dataset and determines the normality and distribution type.

What it does, in pragmatic terms?

In the most simplest terms, it calculates the cumulative distribution function (or CDF) of user-defined dataset.

The cumulative distribution function (CDF) is a concept used in statistics and probability to describe how the probability of a random variable taking on a certain value or less is distributed across the entire range of possible values. In simpler terms, you can conceptualize the CDF as this:

Imagine you have a list of data, such as test scores of students in a class. The CDF helps you answer questions like, "What's the probability that a randomly chosen student scored 80 or less on the test?"

Or in our case, say we are in a strong up or downtrend on a stock. The CDF can help us answer questions like "Based on this current xyz trend, what is the probability that a ticker will fall above X price or below Y price".

Within the indicator, you can manually assess a price of interest. Let's say, for NVDA, we want to know the probability NVDA goes above or below $450. We can enter $450 into the indicator and get this result:

imagen

Other functions:

  • Kurtosis and Skewness Functions:


In addition to calculating and plotting the CDF, we can also plot the kurtosis & Skewness.

imagen

This can help you look for outlier periods where the distribution of your dataset changed. It can potentially alert you to when a stock is behaving abnormally and when it is more stable and evenly distributed.

  • Tests of normality


The indicator will use the kurtosis and skewness to determine the normality of the dataset. The indicator is programmed to recognize up to 7 different distribution types and alert you to them and the implications they have in your overall assessment.

e.g. #1 AMC during short squeeze:

imagen

e.g. #2: BA during the COVID crash:

imagen

  • Plotting the standardized Z-Score of the Distribution Dataset


You can also standardize the dataset by converting it into Z-Score format:

imagen

  • Plot the raw, CDF results


imagen

Two values are plotting, the green and the red. The green represents the probability of a ticker going higher than the current value. The red represents the probability of a ticker going lower than the current value.

Limitations

There are some limitations of the indicator which I think are important to point out. They are:

  • The indicator cannot tell you timelines, it can only tell you the general probability that data within the dataset will fall above or below a certain value.


The indicator cannot take into account projected periods of consolidation. It is possible a ticker can remain in a consolidation phase for a very long time. This would have the effect of stabilizing the probability in one direction (if there was a lot of downside room, it can normalize the data out so that the extent of the downside probability is mitigated). Thus, its important to use judgement and other methods to assess the likelihood that a stock will pullback or continue up, based on the overall probability.

  • The indicator is only looking at an individual dataset.


Using this indicator, you have to omit a large amount of data and look at solely a confined dataset. In a way, this actually improves the accuracy, but can also be misleading, depending on the size and strength of the dataset being chosen. It is important to balance your choice of dataset time with such things as:


a) The strength of the uptrend or downtrend.
b) The length of the uptrend or downtrend.
c) The overall performance of the stock leading into the dataset time period


And that is the indicator in a nutshell.

Hopefully you find it helpful and interesting. Feel free to leave questions, comments and suggestions below.

Safe trades everyone and take care!
Notas de prensa
Had to update the table as there was a problem on certain distribution assessments with the two data tables overlapping. Final product:

imagen
Notas de prensa
Quick little re-fix
statistics

Script de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


For real-time updates and premium indicators, consider joining my group at: patreon.com/steversteves
También en:

Exención de responsabilidad