OPEN-SOURCE SCRIPT

Cumulative Distribution of a Dataset [SS]

Telah dikemas kini
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:

syot kilat

Other functions:

  • Kurtosis and Skewness Functions:


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

syot kilat

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:

syot kilat

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

syot kilat

  • Plotting the standardized Z-Score of the Distribution Dataset


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

syot kilat

  • Plot the raw, CDF results


syot kilat

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!
Nota Keluaran
Had to update the table as there was a problem on certain distribution assessments with the two data tables overlapping. Final product:

syot kilat
Nota Keluaran
Quick little re-fix
statistics

Skrip sumber terbuka

Dalam semangat sebenar TradingView, penulis telah menerbitkan kod Pine ini sebagai sumber terbuka supaya pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara percuma, tetapi penggunaan semula kod dalam penerbitan ini adalah dikawal oleh Peraturan dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Ingin menggunakan skrip ini pada carta?


For real-time updates and premium indicators, consider joining my group at: patreon.com/steversteves
Juga pada:

Penafian