OPEN-SOURCE SCRIPT
Actualizado Price Scenarios - The Quant Science

GENERAL OVERVIEW
Price Scenarios - The Quant Science is a quantitative statistical indicator that provides a forecast probability about future prices moving using the mathematical-statistical formula of statistical probability and expected value.
https://www.tradingview.com/x/OelfF4iR/
HOW TO USE
The indicator displays arrow-shaped signals that represent the probable future price movement calculated by the indicator, including the current percentage probability. Additionally, the candlesticks are colored based on the predicted direction to facilitate visual analysis. By default, green is used for bullish movements and red for bearish movements. The trader can set the analysis period (default value is 200) and the percentage threshold of probability to consider (default value is greater than 0.50 or 50%) through the user interface.
https://www.tradingview.com/x/Xw6iQecO/
USER INTERFACE
Lenght analysis: with this features you can handle the length of the dataset to be used for estimating statistical probabilities.
https://www.tradingview.com/x/PBUbP0O3/
Expected value: with this feature you can handle the threshold of the expected value to filter, only probabilities greater than this threshold will be considered by the model. By default, it is set to 0.50, which is equivalent to 50%.
https://www.tradingview.com/x/XjAUkspn/
Design Settings: modify the colors of your indicator with just a few clicks by managing this function.
https://www.tradingview.com/x/WAQySPHn/
We recommend disabling 'Wick' and 'Border' from the settings panel for a smoother and more efficient user experience.
https://www.tradingview.com/x/ZvTAJ1vC/
Price Scenarios - The Quant Science is a quantitative statistical indicator that provides a forecast probability about future prices moving using the mathematical-statistical formula of statistical probability and expected value.
https://www.tradingview.com/x/OelfF4iR/
HOW TO USE
The indicator displays arrow-shaped signals that represent the probable future price movement calculated by the indicator, including the current percentage probability. Additionally, the candlesticks are colored based on the predicted direction to facilitate visual analysis. By default, green is used for bullish movements and red for bearish movements. The trader can set the analysis period (default value is 200) and the percentage threshold of probability to consider (default value is greater than 0.50 or 50%) through the user interface.
https://www.tradingview.com/x/Xw6iQecO/
USER INTERFACE
Lenght analysis: with this features you can handle the length of the dataset to be used for estimating statistical probabilities.
https://www.tradingview.com/x/PBUbP0O3/
Expected value: with this feature you can handle the threshold of the expected value to filter, only probabilities greater than this threshold will be considered by the model. By default, it is set to 0.50, which is equivalent to 50%.
https://www.tradingview.com/x/XjAUkspn/
Design Settings: modify the colors of your indicator with just a few clicks by managing this function.
https://www.tradingview.com/x/WAQySPHn/
We recommend disabling 'Wick' and 'Border' from the settings panel for a smoother and more efficient user experience.
https://www.tradingview.com/x/ZvTAJ1vC/
Notas de prensa
- Pine Script 6 updated
Description Update | 2026
Advanced quantitative indicator that provides a statistical perspective by estimating, in real time, the probability of a price direction based on recent historical price movements.
The formula uses a relative frequency probability-based approach applied to recent historical data. Calculates the percentage of times the market has risen or fallen within the selected analysis period.
🧠 Logic
1. The Count
The script scans the last N candles (where N is the length, e.g., 100) and checks the price movement from one bar to the next:
up_count: --> counts how many times the price has increased compared to the previous bar
down_count: --> counts how many times the price has decreased compared to the previous bar
⬇️
2. Percentage Calculation
Once the total number of positive or negative movements in the period has been obtained, the value is divided by the total number of bars examined.
⬇️
The result is a decimal number between 0 and 1 (e.g., 0.58), which is then multiplied by 100 to be displayed as a percentage on the screen (e.g., 58%).
🔷 Statistical Analysis of Probability
- Examines a historical data set based on the most recent candles (defined by the “Length analysis” parameter, set to 100 bars)
- For each candle, checks if the price has risen or fallen compared to the previous bar
- Calculate two percentages: the probability that the price will rise and the probability that it will fall, based solely on recent historical data
🔷 Threshold Filter
Compare the calculated probabilities with a minimum threshold (Expected Value, set by default to 0.5, or 50%). The “Up” or “Down” scenario is triggered only if the percentage exceeds this threshold.
🔷 Clean Chart and Visual Design
- Candlestick: Automatically colors the body of the candlesticks green or red when the corresponding scenario occurs
- Directional Arrows: Draws arrows above or below the bars
- Dynamic labels: Prints the exact rounded percentage (e.g., 58%). By adding an offset, the labels no longer overlap the candlesticks but maintain a perfect, proportional distance
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Symbiosis XGBoost is a Python XGBoost model natively built to run on Pine Script.
🔷 XGBoost: symbiosis.thequantscience.com
🔷 Access: patreon.com/c/xgboost_symbiosis
🔷 The Quant Science: thequantscience.com
🔷 XGBoost: symbiosis.thequantscience.com
🔷 Access: patreon.com/c/xgboost_symbiosis
🔷 The Quant Science: thequantscience.com
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Symbiosis XGBoost is a Python XGBoost model natively built to run on Pine Script.
🔷 XGBoost: symbiosis.thequantscience.com
🔷 Access: patreon.com/c/xgboost_symbiosis
🔷 The Quant Science: thequantscience.com
🔷 XGBoost: symbiosis.thequantscience.com
🔷 Access: patreon.com/c/xgboost_symbiosis
🔷 The Quant Science: thequantscience.com
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.