OPEN-SOURCE SCRIPT
Markov Swing States v2 - Full Table

The indicator should be read as a probability dashboard by states, not as a classic "buy/sell" signal.
It does 3 things:
-classifies each day into a technical state;
-counts the history of how it has moved from one state to another;
-shows you if the current state has a favorable probability for bullish continuation.
S3 Breakout occurs when:
-price closes above the maximum of the last 20 days;
-volume is above the average volume;
-price is above EMA 9;
-EMA 9 is above EMA 21.
This is the most important state for aggressive entry.
S4 Bull Trend occurs when:
-price is above EMA 9;
-EMA 9 > EMA 21;
-price is above SMA 50;
-RSI is above 55.
This is the state of an already confirmed bullish trend. It is not necessarily the best entry, but it is a good state for maintaining the position.
S5 Healthy Pullback occurs when:
-price retests EMA 9 or EMA 21;
-closes above EMA;
-EMA 9 > EMA 21;
-price stays above SMA 50;
-RSI stays above 50.
This is the healthy pullback condition. It is not bearish. It means the price is cooling down after a rally.
S6 Distribution occurs when:
-price loses EMA 21;
-MACD histogram deteriorates.
This is the risk condition.
The table is the most important part.
Samples = This is the sample size.
P -> Bull = Shows the probability that the next day will be S4 Bull Trend.
P -> Pullback = Shows the probability that the stock will stay or enter a healthy pullback.
P -> Dist = Shows the probability of distribution. For long entries, you want this value to be small.
It does 3 things:
-classifies each day into a technical state;
-counts the history of how it has moved from one state to another;
-shows you if the current state has a favorable probability for bullish continuation.
S3 Breakout occurs when:
-price closes above the maximum of the last 20 days;
-volume is above the average volume;
-price is above EMA 9;
-EMA 9 is above EMA 21.
This is the most important state for aggressive entry.
S4 Bull Trend occurs when:
-price is above EMA 9;
-EMA 9 > EMA 21;
-price is above SMA 50;
-RSI is above 55.
This is the state of an already confirmed bullish trend. It is not necessarily the best entry, but it is a good state for maintaining the position.
S5 Healthy Pullback occurs when:
-price retests EMA 9 or EMA 21;
-closes above EMA;
-EMA 9 > EMA 21;
-price stays above SMA 50;
-RSI stays above 50.
This is the healthy pullback condition. It is not bearish. It means the price is cooling down after a rally.
S6 Distribution occurs when:
-price loses EMA 21;
-MACD histogram deteriorates.
This is the risk condition.
The table is the most important part.
Samples = This is the sample size.
P -> Bull = Shows the probability that the next day will be S4 Bull Trend.
P -> Pullback = Shows the probability that the stock will stay or enter a healthy pullback.
P -> Dist = Shows the probability of distribution. For long entries, you want this value to be small.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.