Danny_Stone SnR Enhanced [by Danny Shih]This technical indicator shows the accuracy of the support and pressure positions. The accuracy of the technical indicators will continue to be improved in the future. Please continue to pay attention to my updates. If you feel it is good to use or have any questions, you can ask me. Thank you!
這個技術指標是提供支撐與壓力位置的精確顯示,之後還會繼續完善技術指標的準確性,請繼續關注我的更新,若覺得不錯使用或有什麽問題都可以提出詢問,感謝!
Forecasting
KOLBASKA AIKOLBASKA AI VANGA
regression channel
Pivot Levels
FIBA
Price Movement Prediction
TNX DIONIS
Global M2 Money Supply Top20 + Offset & WaveThe M2 Top20 is a global aggregation of the M2 money supply from the 20 largest economies in the world , providing a comprehensive view of the total liquidity in the global financial system. It is expressed in trillions of USD.
This script calculates and visualizes the M2 Money Supply of the Top 20 Global Economies, adjusted to various timeframes (4H, 1D, 1W, 1M) with customizable offset adjustments (in days) from -1000 days to +1000 days. This indicator includes data from the Americas, Europe, Africa, and the Asia Middle East , offering a diverse and balanced representation of major economic regions. The M2 of each country has been converted to USD.
Additionally, the user can set a minimum and maximum offset to create a wave around the main offset and expand the comparison.
Combining these options, this indicator enables users to visualize a range of the global money supply, making it useful for market analysis, economic forecasting, and understanding macroeconomic trends. This indicator is particularly valuable for traders and analysts interested in understanding the dynamics of global monetary systems and their potential impact on financial markets.
Key Features:
Global M2 Money Supply calculation from the Top 20 Economies.
Adjustable Offset: Adjust the offset to align the indicator with the best bar. Adjustment in days, usable on different timeframes (1D, 1W, 4H, 1M).
Wave Projection: Displays a "probability cloud"—a smoothed area that shows the probable path of Bitcoin, derived from shifts in global liquidity.
Min/Max Offset Adjustments: Customizable offsets allow you to determine the range of future windows, helping to shape the wave and better identify liquidity-driven turning points.
Use Cases:
Economic Forecasting: Identify trends in global money supply and their potential market impact (e.g., historically leads Bitcoin price by +/- 78 days to +/-108 days).
Market Analysis: Track the growth or contraction of money supply across key economies.
Macro-Economic Analysis: Understand the relationship between monetary policies and market performance.
How to use:
Add the indicator to your chart.
Set the timeframe to 1D to customize the offset.
Set the Offset (in days).
Set the Offset Range Minimum and Maximum.
Show/Hide the Range Wave
.
Use offset = 0 to have the indicator align directly with the current data, without any shift, providing a baseline for comparison with the most recent market conditions.
Countries included in the M2 Top20:
China (CN), Japan (JP), South Korea (KR), Hong Kong (HK), Taiwan (TW), India (IN), Saudi Arabia (SA), Thailand (TH), Vietnam (VN), United Arab Emirates (AE), Malawi (MW) – Africa, United States (US), Canada (CA), Brazil (BR), Mexico (MX), Eurozone (EU), United Kingdom (GB), Russia (RU), Poland (PL), Switzerland (CH).
These countries were selected from the ranking of the World Economy Indicator of Trading View .
Dow Trend clean MTF - Anticipated SignalsThis is MTF Dow theory arrows... you have the chart timeframe plus 4 other timeframe options. The issue is if you are on a low time frame for example on 1min then you can not see into the future.... a problem we all can relate to ;) I'm working on it. So there will be a delay in a 1 hr dow signal until all the 1hr criteria are met. I have added 2 "sets" of arrows. The 2nd set attempts to anticipate what the longer timeframe signal will be based on aggregate bars. So they may not always be correct. It's an experiment. Enjoy. Screenshot is not using the aggregate arrows just the regular ones. Showing arrows for 15s, 30s, 1m, 2m, and 4 min. progressively larger arrows. transparency is in the code rather than user interface...but should be fine.
RSI Full Forecast [Titans_Invest]RSI Full Forecast
Get ready to experience the ultimate evolution of RSI-based indicators – the RSI Full Forecast, a boosted and even smarter version of the already powerful: RSI Forecast
Now featuring over 40 additional entry conditions (forecasts), this indicator redefines the way you view the market.
AI-Powered RSI Forecasting:
Using advanced linear regression with the least squares method – a solid foundation for machine learning - the RSI Full Forecast enables you to predict future RSI behavior with impressive accuracy.
But that’s not all: this new version also lets you monitor future crossovers between the RSI and the MA RSI, delivering early and strategic signals that go far beyond traditional analysis.
You’ll be able to monitor future crossovers up to 20 bars ahead, giving you an even broader and more precise view of market movements.
See the Future, Now:
• Track upcoming RSI & RSI MA crossovers in advance.
• Identify potential reversal zones before price reacts.
• Uncover statistical behavior patterns that would normally go unnoticed.
40+ Intelligent Conditions:
The new layer of conditions is designed to detect multiple high-probability scenarios based on historical patterns and predictive modeling. Each additional forecast is a window into the price's future, powered by robust mathematics and advanced algorithmic logic.
Full Customization:
All parameters can be tailored to fit your strategy – from smoothing periods to prediction sensitivity. You have complete control to turn raw data into smart decisions.
Innovative, Accurate, Unique:
This isn’t just an upgrade. It’s a quantum leap in technical analysis.
RSI Full Forecast is the first of its kind: an indicator that blends statistical analysis, machine learning, and visual design to create a true real-time predictive system.
⯁ SCIENTIFIC BASIS LINEAR REGRESSION
Linear Regression is a fundamental method of statistics and machine learning, used to model the relationship between a dependent variable y and one or more independent variables 𝑥.
The general formula for a simple linear regression is given by:
y = β₀ + β₁x + ε
β₁ = Σ((xᵢ - x̄)(yᵢ - ȳ)) / Σ((xᵢ - x̄)²)
β₀ = ȳ - β₁x̄
Where:
y = is the predicted variable (e.g. future value of RSI)
x = is the explanatory variable (e.g. time or bar index)
β0 = is the intercept (value of 𝑦 when 𝑥 = 0)
𝛽1 = is the slope of the line (rate of change)
ε = is the random error term
The goal is to estimate the coefficients 𝛽0 and 𝛽1 so as to minimize the sum of the squared errors — the so-called Random Error Method Least Squares.
⯁ LEAST SQUARES ESTIMATION
To minimize the error between predicted and observed values, we use the following formulas:
β₁ = /
β₀ = ȳ - β₁x̄
Where:
∑ = sum
x̄ = mean of x
ȳ = mean of y
x_i, y_i = individual values of the variables.
Where:
x_i and y_i are the means of the independent and dependent variables, respectively.
i ranges from 1 to n, the number of observations.
These equations guarantee the best linear unbiased estimator, according to the Gauss-Markov theorem, assuming homoscedasticity and linearity.
⯁ LINEAR REGRESSION IN MACHINE LEARNING
Linear regression is one of the cornerstones of supervised learning. Its simplicity and ability to generate accurate quantitative predictions make it essential in AI systems, predictive algorithms, time series analysis, and automated trading strategies.
By applying this model to the RSI, you are literally putting artificial intelligence at the heart of a classic indicator, bringing a new dimension to technical analysis.
⯁ VISUAL INTERPRETATION
Imagine an RSI time series like this:
Time →
RSI →
The regression line will smooth these values and extend them n periods into the future, creating a predicted trajectory based on the historical moment. This line becomes the predicted RSI, which can be crossed with the actual RSI to generate more intelligent signals.
⯁ SUMMARY OF SCIENTIFIC CONCEPTS USED
Linear Regression Models the relationship between variables using a straight line.
Least Squares Minimizes the sum of squared errors between prediction and reality.
Time Series Forecasting Estimates future values based on historical data.
Supervised Learning Trains models to predict outputs from known inputs.
Statistical Smoothing Reduces noise and reveals underlying trends.
⯁ WHY THIS INDICATOR IS REVOLUTIONARY
Scientifically-based: Based on statistical theory and mathematical inference.
Unprecedented: First public RSI with least squares predictive modeling.
Intelligent: Built with machine learning logic.
Practical: Generates forward-thinking signals.
Customizable: Flexible for any trading strategy.
⯁ CONCLUSION
By combining RSI with linear regression, this indicator allows a trader to predict market momentum, not just follow it.
RSI Full Forecast is not just an indicator — it is a scientific breakthrough in technical analysis technology.
⯁ Example of simple linear regression, which has one independent variable:
⯁ In linear regression, observations ( red ) are considered to be the result of random deviations ( green ) from an underlying relationship ( blue ) between a dependent variable ( y ) and an independent variable ( x ).
⯁ Visualizing heteroscedasticity in a scatterplot against 100 random fitted values using Matlab:
⯁ The data sets in the Anscombe's quartet are designed to have approximately the same linear regression line (as well as nearly identical means, standard deviations, and correlations) but are graphically very different. This illustrates the pitfalls of relying solely on a fitted model to understand the relationship between variables.
⯁ The result of fitting a set of data points with a quadratic function:
_________________________________________________
🔮 Linear Regression: PineScript Technical Parameters 🔮
_________________________________________________
Forecast Types:
• Flat: Assumes prices will remain the same.
• Linreg: Makes a 'Linear Regression' forecast for n periods.
Technical Information:
ta.linreg (built-in function)
Linear regression curve. A line that best fits the specified prices over a user-defined time period. It is calculated using the least squares method. The result of this function is calculated using the formula: linreg = intercept + slope * (length - 1 - offset), where intercept and slope are the values calculated using the least squares method on the source series.
Syntax:
• Function: ta.linreg()
Parameters:
• source: Source price series.
• length: Number of bars (period).
• offset: Offset.
• return: Linear regression curve.
This function has been cleverly applied to the RSI, making it capable of projecting future values based on past statistical trends.
______________________________________________________
______________________________________________________
⯁ WHAT IS THE RSI❓
The Relative Strength Index (RSI) is a technical analysis indicator developed by J. Welles Wilder. It measures the magnitude of recent price movements to evaluate overbought or oversold conditions in a market. The RSI is an oscillator that ranges from 0 to 100 and is commonly used to identify potential reversal points, as well as the strength of a trend.
⯁ HOW TO USE THE RSI❓
The RSI is calculated based on average gains and losses over a specified period (usually 14 periods). It is plotted on a scale from 0 to 100 and includes three main zones:
• Overbought: When the RSI is above 70, indicating that the asset may be overbought.
• Oversold: When the RSI is below 30, indicating that the asset may be oversold.
• Neutral Zone: Between 30 and 70, where there is no clear signal of overbought or oversold conditions.
______________________________________________________
______________________________________________________
⯁ ENTRY CONDITIONS
The conditions below are fully flexible and allow for complete customization of the signal.
______________________________________________________
______________________________________________________
🔹 CONDITIONS TO BUY 📈
______________________________________________________
• Signal Validity: The signal will remain valid for X bars .
• Signal Sequence: Configurable as AND or OR .
📈 RSI Conditions:
🔹 RSI > Upper
🔹 RSI < Upper
🔹 RSI > Lower
🔹 RSI < Lower
🔹 RSI > Middle
🔹 RSI < Middle
🔹 RSI > MA
🔹 RSI < MA
📈 MA Conditions:
🔹 MA > Upper
🔹 MA < Upper
🔹 MA > Lower
🔹 MA < Lower
📈 Crossovers:
🔹 RSI (Crossover) Upper
🔹 RSI (Crossunder) Upper
🔹 RSI (Crossover) Lower
🔹 RSI (Crossunder) Lower
🔹 RSI (Crossover) Middle
🔹 RSI (Crossunder) Middle
🔹 RSI (Crossover) MA
🔹 RSI (Crossunder) MA
🔹 MA (Crossover) Upper
🔹 MA (Crossunder) Upper
🔹 MA (Crossover) Lower
🔹 MA (Crossunder) Lower
📈 RSI Divergences:
🔹 RSI Divergence Bull
🔹 RSI Divergence Bear
📈 RSI Forecast:
🔹 RSI (Crossover) MA Forecast
🔹 RSI (Crossunder) MA Forecast
🔹 RSI Forecast 1 > MA Forecast 1
🔹 RSI Forecast 1 < MA Forecast 1
🔹 RSI Forecast 2 > MA Forecast 2
🔹 RSI Forecast 2 < MA Forecast 2
🔹 RSI Forecast 3 > MA Forecast 3
🔹 RSI Forecast 3 < MA Forecast 3
🔹 RSI Forecast 4 > MA Forecast 4
🔹 RSI Forecast 4 < MA Forecast 4
🔹 RSI Forecast 5 > MA Forecast 5
🔹 RSI Forecast 5 < MA Forecast 5
🔹 RSI Forecast 6 > MA Forecast 6
🔹 RSI Forecast 6 < MA Forecast 6
🔹 RSI Forecast 7 > MA Forecast 7
🔹 RSI Forecast 7 < MA Forecast 7
🔹 RSI Forecast 8 > MA Forecast 8
🔹 RSI Forecast 8 < MA Forecast 8
🔹 RSI Forecast 9 > MA Forecast 9
🔹 RSI Forecast 9 < MA Forecast 9
🔹 RSI Forecast 10 > MA Forecast 10
🔹 RSI Forecast 10 < MA Forecast 10
🔹 RSI Forecast 11 > MA Forecast 11
🔹 RSI Forecast 11 < MA Forecast 11
🔹 RSI Forecast 12 > MA Forecast 12
🔹 RSI Forecast 12 < MA Forecast 12
🔹 RSI Forecast 13 > MA Forecast 13
🔹 RSI Forecast 13 < MA Forecast 13
🔹 RSI Forecast 14 > MA Forecast 14
🔹 RSI Forecast 14 < MA Forecast 14
🔹 RSI Forecast 15 > MA Forecast 15
🔹 RSI Forecast 15 < MA Forecast 15
🔹 RSI Forecast 16 > MA Forecast 16
🔹 RSI Forecast 16 < MA Forecast 16
🔹 RSI Forecast 17 > MA Forecast 17
🔹 RSI Forecast 17 < MA Forecast 17
🔹 RSI Forecast 18 > MA Forecast 18
🔹 RSI Forecast 18 < MA Forecast 18
🔹 RSI Forecast 19 > MA Forecast 19
🔹 RSI Forecast 19 < MA Forecast 19
🔹 RSI Forecast 20 > MA Forecast 20
🔹 RSI Forecast 20 < MA Forecast 20
______________________________________________________
______________________________________________________
🔸 CONDITIONS TO SELL 📉
______________________________________________________
• Signal Validity: The signal will remain valid for X bars .
• Signal Sequence: Configurable as AND or OR .
📉 RSI Conditions:
🔸 RSI > Upper
🔸 RSI < Upper
🔸 RSI > Lower
🔸 RSI < Lower
🔸 RSI > Middle
🔸 RSI < Middle
🔸 RSI > MA
🔸 RSI < MA
📉 MA Conditions:
🔸 MA > Upper
🔸 MA < Upper
🔸 MA > Lower
🔸 MA < Lower
📉 Crossovers:
🔸 RSI (Crossover) Upper
🔸 RSI (Crossunder) Upper
🔸 RSI (Crossover) Lower
🔸 RSI (Crossunder) Lower
🔸 RSI (Crossover) Middle
🔸 RSI (Crossunder) Middle
🔸 RSI (Crossover) MA
🔸 RSI (Crossunder) MA
🔸 MA (Crossover) Upper
🔸 MA (Crossunder) Upper
🔸 MA (Crossover) Lower
🔸 MA (Crossunder) Lower
📉 RSI Divergences:
🔸 RSI Divergence Bull
🔸 RSI Divergence Bear
📉 RSI Forecast:
🔸 RSI (Crossover) MA Forecast
🔸 RSI (Crossunder) MA Forecast
🔸 RSI Forecast 1 > MA Forecast 1
🔸 RSI Forecast 1 < MA Forecast 1
🔸 RSI Forecast 2 > MA Forecast 2
🔸 RSI Forecast 2 < MA Forecast 2
🔸 RSI Forecast 3 > MA Forecast 3
🔸 RSI Forecast 3 < MA Forecast 3
🔸 RSI Forecast 4 > MA Forecast 4
🔸 RSI Forecast 4 < MA Forecast 4
🔸 RSI Forecast 5 > MA Forecast 5
🔸 RSI Forecast 5 < MA Forecast 5
🔸 RSI Forecast 6 > MA Forecast 6
🔸 RSI Forecast 6 < MA Forecast 6
🔸 RSI Forecast 7 > MA Forecast 7
🔸 RSI Forecast 7 < MA Forecast 7
🔸 RSI Forecast 8 > MA Forecast 8
🔸 RSI Forecast 8 < MA Forecast 8
🔸 RSI Forecast 9 > MA Forecast 9
🔸 RSI Forecast 9 < MA Forecast 9
🔸 RSI Forecast 10 > MA Forecast 10
🔸 RSI Forecast 10 < MA Forecast 10
🔸 RSI Forecast 11 > MA Forecast 11
🔸 RSI Forecast 11 < MA Forecast 11
🔸 RSI Forecast 12 > MA Forecast 12
🔸 RSI Forecast 12 < MA Forecast 12
🔸 RSI Forecast 13 > MA Forecast 13
🔸 RSI Forecast 13 < MA Forecast 13
🔸 RSI Forecast 14 > MA Forecast 14
🔸 RSI Forecast 14 < MA Forecast 14
🔸 RSI Forecast 15 > MA Forecast 15
🔸 RSI Forecast 15 < MA Forecast 15
🔸 RSI Forecast 16 > MA Forecast 16
🔸 RSI Forecast 16 < MA Forecast 16
🔸 RSI Forecast 17 > MA Forecast 17
🔸 RSI Forecast 17 < MA Forecast 17
🔸 RSI Forecast 18 > MA Forecast 18
🔸 RSI Forecast 18 < MA Forecast 18
🔸 RSI Forecast 19 > MA Forecast 19
🔸 RSI Forecast 19 < MA Forecast 19
🔸 RSI Forecast 20 > MA Forecast 20
🔸 RSI Forecast 20 < MA Forecast 20
______________________________________________________
______________________________________________________
🤖 AUTOMATION 🤖
• You can automate the BUY and SELL signals of this indicator.
______________________________________________________
______________________________________________________
⯁ UNIQUE FEATURES
______________________________________________________
Linear Regression: (Forecast)
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Plot Labels in the Graph Above: BUY/SELL
Automate and Monitor Signals/Alerts: BUY/SELL
Linear Regression (Forecast)
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Plot Labels in the Graph Above: BUY/SELL
Automate and Monitor Signals/Alerts: BUY/SELL
______________________________________________________
📜 SCRIPT : RSI Full Forecast
🎴 Art by : @Titans_Invest & @DiFlip
👨💻 Dev by : @Titans_Invest & @DiFlip
🎑 Titans Invest — The Wizards Without Gloves 🧤
✨ Enjoy!
______________________________________________________
o Mission 🗺
• Inspire Traders to manifest Magic in the Market.
o Vision 𐓏
• To elevate collective Energy 𐓷𐓏
PG MA Crossover Buy and Sell Options Special"If you've ever felt frustrated with buy-and-hold during volatile periods, this strategy gives you a smart, disciplined edge to actively manage your trades based on market strength, not hope. Give it a try, tweak the settings to suit your style, and unlock better consistency over time!"
// PG MA Crossover Direction Strategy — Quick Overview
// 📈 Entry:
// Long when MA is rising + price moves above it.
// Short when MA is falling + price moves below it.
// Smart re-entries near MA allowed.
// 📉 Exit:
// Long exit if price falls X% from top OR drops below MA.
// Short exit if price rises X% from low OR rises above MA.
// 🛡️ Stop Loss:
// Shorts have a hard stop-loss above entry to cap losses.
// 🎯 Goal:
// Beat Buy-and-Hold by riding strong trends, exiting early from weak ones, and managing risk dynamically.
// Designed for traders who want higher consistency and lower volatility over time.
// 🚀 Tip:
// Tweak the % thresholds and MA type/length for best results on your asset!
GTR369 Day Range DividerThe indicator divides the chart into Israeli trading days, starting at one o’clock after midnight and ending a minute before the next midnight, marking each day’s open with a thin vertical line whose color and width you can choose. A label with the day’s name (in Hebrew) can appear on the very first bar of the session, while another label is placed midway through the previous day, beneath the candles at a fixed distance from the bottom so it doesn’t obscure price. You can adjust the label’s color, size, and letter spacing, customize the line style, and decide whether to show the early-session label. The indicator ignores Saturday and Sunday, works on any intraday timeframe, never repaints after plotting, and lets you quickly spot daily sequences and time-of-day patterns for market analysis.
Zonas Psicológicas Cercanas .XX500Te pinta líneas en el gráfico en las zonas psicológicas 500 más cercanas al precio actual.
Day Range DividerThe indicator divides the chart into Israeli trading days, starting at one o’clock after midnight and ending a minute before the next midnight, marking each day’s open with a thin vertical line whose color and width you can choose. A label with the day’s name (in Hebrew) can appear on the very first bar of the session, while another label is placed midway through the previous day, beneath the candles at a fixed distance from the bottom so it doesn’t obscure price. You can adjust the label’s color, size, and letter spacing, customize the line style, and decide whether to show the early-session label. The indicator ignores Saturday and Sunday, works on any intraday timeframe, never repaints after plotting, and lets you quickly spot daily sequences and time-of-day patterns for market analysis.
Bitcoin as % Global M2 signalThis script provides signal system:
Buy signal: each time the YoY of the Global M2 rises more than 2.5% while the distance between the bitcoin price as a percentage of the Global M2 is below its yearly SMA.
Sell signal: the distance between the bitcoin price as a percentage of the Global M2 and its yearly SMA is > 0.7
This is a very simple system, but it seems to work pretty well to ride the bitcoin price cycle wave.
The parameters are hard coded but they can be easily changed to test different levels for both the buy and sell signals.
Islamabad Forex Academy Strategy-1 Best on 1H-4H forex charts (EURUSD/GBPUSD)
Adjust supertrend multiplier between 2.5-3.2 based on volatility
Switch to close-price crosses during low volatility periods
Combine with London/New York sessions for best results
🌎 Modern Economic Eras Dashboard🌍 Overview
The Modern Economic Eras Dashboard is a upgrade over the earlier "Modern Economic Eras - Visual Background & Labels" script.
Inspired by the 2020 Deutsche Bank Long-Term Asset Return Study ("The Age of Disorder"), this dashboard contextualizes market behavior through the major structural macroeconomic eras of modern history.
🔥 What's New?
Macroeconomic eras are colored clearly across the timeline.
Major financial crashes (e.g., Great Depression, Oil Crisis 1973, Dot-Com Bubble, GFC 2008, COVID Crash) are shaded distinctly.
Key macroeconomic indicators are overlaid and properly rescaled to align visually on a unified panel.
🎯 How to Use It
This tool is ideal for:
Long-term investors seeking to understand where current markets sit within historical macroeconomic regimes.
Macro researchers analyzing how asset classes performed across different structural periods.
Strategic traders identifying points of inflection tied to historical crises or regime shifts.
Educators and students visualizing economic history in a financial context.
📊 Scaled Data (for improved visualization)
Real GDP: divided by 100B
Inflation Index: divided by 2
US Debt to GDP: raw
Labor Force Participation Rate: raw
Oil Price: raw
US 10Y Real Yield: multiplied by 10
Active Symbol Price: user-adjustable scaling factor
⚡ Features
Background shading for eras and crises.
Adjustable symbol scaling via input field.
Clean, non-overlay pane for better visual separation.
Labels placed on the chart for easier historical reference.
🛠️ Usage
Best applied to major indices (SPX, DJI, MSCI World) on monthly timeframes for clearer historical visualization.
📖 Credits
Original structural macroeconomic eras based on Deutsche Bank's Long-Term Asset Return Study (2020), further adapted and expanded.
📝 Author’s Note
This script was created for investors, traders, and researchers who want to understand long-term market cycles through a clearer macro lens.
If you find this useful, a like or a comment is always appreciated! 🚀
EMA Crossover Strategy with AlertsEMA Crossover Strategy with Alerts
Overview
The EMA Crossover Strategy is a popular trend-following trading strategy that utilizes two Exponential Moving Averages (EMAs) to identify potential buy and sell signals. This strategy is designed to help traders capture significant market trends by generating alerts when a crossover or crossunder occurs between the short-term and long-term EMAs.
Strategy Details
Short EMA Length: 9 periods
Long EMA Length: 21 periods
How It Works
Calculation of EMAs:
The strategy calculates two EMAs: a short-term EMA (9 periods) and a long-term EMA (21 periods).
Crossover and Crossunder Conditions:
Crossover Condition: A buy signal is generated when the short-term EMA crosses above the long-term EMA.
Crossunder Condition: A sell signal is generated when the short-term EMA crosses below the long-term EMA.
Buy and Sell Signals:
Buy Signal: Plotted below the bar with a green label when the crossover condition is met.
Sell Signal: Plotted above the bar with a red label when the crossunder condition is met.
Alerts:
Alerts are set up to notify traders when a buy or sell signal is generated:
Buy Alert: Triggered when the short-term EMA crosses above the long-term EMA.
Sell Alert: Triggered when the short-term EMA crosses below the long-term EMA.
Strategy Execution:
Buy Entry: The strategy enters a long position when the buy condition is met.
Sell Entry: The strategy enters a short position when the sell condition is met.
Benefits
Trend Identification: Helps traders identify and follow strong market trends.
Clear Signals: Provides clear buy and sell signals based on EMA crossovers.
Alerts: Keeps traders informed with real-time alerts for buy and sell signals.
Usage
This strategy is suitable for various markets and timeframes. Traders can customize the EMA lengths to fit their specific trading style and market conditions.
August Pump PredictorAugust Pump Predictor is an indicator designed to forecast massive price movements.
Global M2 YoY % Increase signalThe script produces a signal each time the global M2 increases more than 2.5%. This usually coincides with bitcoin prices pumps, except when it is late in the business cycle or the bitcoin price / halving cycle.
It leverages dylanleclair Global M2 YoY % change, with several modifications:
adding a 10 week lead at the YoY Change plot for better visibility, so that the bitcoin pump moreless coincides with the YoY change.
signal increases > 2.5 in Global M2 at the point at which they occur with a green triangle up.
BTST By ANTThe BTST Indicator is a powerful tool specifically designed for traders in the Indian stock market. This unique indicator identifies and highlights key price movements at a pivotal time—3:15 PM. This time is crucial for making BTST (Buy Today, Sell Tomorrow) decisions, a popular trading strategy in India.
Key Features:
Gap Identification : The indicator detects whether the current price action represents a gap-up or gap-down situation compared to the Heikinashi candle close price. This information is vital for short-term traders looking to capitalize on price momentum.
Visual Alerts : When a gap-up trend is detected, a green label "Gap Up" is displayed above the relevant bar. Similarly, a red label "Gap Down" appears below the bar for gap-down movements. These visual indicators help traders make quick and informed decisions.
User-Friendly Insights: The BTST Indicator provides vital information about last closed prices and the dynamics between normal candles and Heikinashi candles. With detailed logs, users can see the exact conditions leading to buy or sell signals, helping optimize trading strategies.
Why Use the BTST Indicator?
Timeliness: The focus on the 3:15 PM mark aligns perfectly with trading patterns and market behavior specific to the Indian stock market, making it an invaluable addition to your trading arsenal.
Enhanced Decision-Making: By receiving immediate visual cues on significant price movements, traders can execute their BTST strategies with greater confidence and speed.
Designed for Indian Markets: This indicator caters specifically to the nuances of Indian stock trading, ensuring relevance and effectiveness for local traders.
Start utilizing the BTST Indicator today to enhance your trading strategies and position yourself for successful trades in the Indian stock market!
Global M2 [BizFing]MARKETSCOM:BITCOIN ECONOMICS:USM2
This is an indicator designed to show the correlation between the global M2 money supply and Bitcoin.
This indicator basically provides a Global M2 index by summing the M2 money supply data from the United States, South Korea, China, Japan, the EU, and the United Kingdom.
Furthermore, it is configured to allow you to add or remove the M2 data of desired countries within the settings.
I hope this proves to be a small aid in predicting the future price of Bitcoin.
If you have any questions or require any improvements while using it, please feel free to contact me.
Thank you.
🌎 Modern Economic Eras - Visual Backgrounds & LabelsModern Economic Eras - Visual Backgrounds & Labels
This indicator highlights key modern economic eras with distinct background shading and floating labels, based on the structural macroeconomic periods identified by Deutsche Bank in their Long-Term Asset Return Study (2020).
🌎 First Era of Globalization (1860–1914)
A period of strong global growth, trade expansion, and low inflation, ending with World War I.
⚔️ Great Wars and the Depression (1914–1945)
The most turbulent period in modern history, marked by conflict, economic hardship, and volatile inflation.
🪙 Bretton Woods & Gold System (1945–1971)
Post-war stability driven by gold-backed currencies, strong growth, and the creation of modern welfare states.
💸 Fiat Money & High Inflation Era (1971–1980)
After the collapse of Bretton Woods, fiat currencies led to global inflation surges and economic instability.
🌍 Second Era of Globalization (1980–2020?)
A golden age of asset returns, global trade boom, China's reintegration, and falling inflation supported by demographic trends.
⚡ Age of Disorder (2020–????)
Characterized by rising geopolitical tensions (especially US-China), high debt levels, political fragmentation, demographic reversals, inequality challenges, and environmental pressures.
Each era is visually segmented and labeled above the chart for intuitive historical context.
This tool helps traders and investors understand the broader macro context behind asset price movements across different long-term regimes.
Useful for:
✅ Macro analysis
✅ Historical financial studies
✅ Long-term strategic planning
Compatible with any asset and timeframe, although it is intended primarily for use on indices like the S&P 500 (SPX).
Sharpe Ratio Forced Selling StrategyThis study introduces the “Sharpe Ratio Forced Selling Strategy”, a quantitative trading model that dynamically manages positions based on the rolling Sharpe Ratio of an asset’s excess returns relative to the risk-free rate. The Sharpe Ratio, first introduced by Sharpe (1966), remains a cornerstone in risk-adjusted performance measurement, capturing the trade-off between return and volatility. In this strategy, entries are triggered when the Sharpe Ratio falls below a specified low threshold (indicating excessive pessimism), and exits occur either when the Sharpe Ratio surpasses a high threshold (indicating optimism or mean reversion) or when a maximum holding period is reached.
The underlying economic intuition stems from institutional behavior. Institutional investors, such as pension funds and mutual funds, are often subject to risk management mandates and performance benchmarking, requiring them to reduce exposure to assets that exhibit deteriorating risk-adjusted returns over rolling periods (Greenwood and Scharfstein, 2013). When risk-adjusted performance improves, institutions may rebalance or liquidate positions to meet regulatory requirements or internal mandates, a behavior that can be proxied effectively through a rising Sharpe Ratio.
By systematically monitoring the Sharpe Ratio, the strategy anticipates when “forced selling” pressure is likely to abate, allowing for opportunistic entries into assets priced below fundamental value. Exits are equally mechanized, either triggered by Sharpe Ratio improvements or by a strict time-based constraint, acknowledging that institutional rebalancing and window-dressing activities are often time-bound (Coval and Stafford, 2007).
The Sharpe Ratio is particularly suitable for this framework due to its ability to standardize excess returns per unit of risk, ensuring comparability across timeframes and asset classes (Sharpe, 1994). Furthermore, adjusting returns by a dynamically updating short-term risk-free rate (e.g., US 3-Month T-Bills from FRED) ensures that macroeconomic conditions, such as shifting interest rates, are accurately incorporated into the risk assessment.
While the Sharpe Ratio is an efficient and widely recognized measure, the strategy could be enhanced by incorporating alternative or complementary risk metrics:
• Sortino Ratio: Unlike the Sharpe Ratio, the Sortino Ratio penalizes only downside volatility (Sortino and van der Meer, 1991). This would refine entries and exits to distinguish between “good” and “bad” volatility.
• Maximum Drawdown Constraints: Integrating a moving window maximum drawdown filter could prevent entries during persistent downtrends not captured by volatility alone.
• Conditional Value at Risk (CVaR): A measure of expected shortfall beyond the Value at Risk, CVaR could further constrain entry conditions by accounting for tail risk in extreme environments (Rockafellar and Uryasev, 2000).
• Dynamic Thresholds: Instead of static Sharpe thresholds, one could implement dynamic bands based on the historical distribution of the Sharpe Ratio, adjusting for volatility clustering effects (Cont, 2001).
Each of these risk parameters could be incorporated into the current script as additional input controls, further tailoring the model to different market regimes or investor risk appetites.
References
• Cont, R. (2001) ‘Empirical properties of asset returns: stylized facts and statistical issues’, Quantitative Finance, 1(2), pp. 223-236.
• Coval, J.D. and Stafford, E. (2007) ‘Asset Fire Sales (and Purchases) in Equity Markets’, Journal of Financial Economics, 86(2), pp. 479-512.
• Greenwood, R. and Scharfstein, D. (2013) ‘The Growth of Finance’, Journal of Economic Perspectives, 27(2), pp. 3-28.
• Rockafellar, R.T. and Uryasev, S. (2000) ‘Optimization of Conditional Value-at-Risk’, Journal of Risk, 2(3), pp. 21-41.
• Sharpe, W.F. (1966) ‘Mutual Fund Performance’, Journal of Business, 39(1), pp. 119-138.
• Sharpe, W.F. (1994) ‘The Sharpe Ratio’, Journal of Portfolio Management, 21(1), pp. 49-58.
• Sortino, F.A. and van der Meer, R. (1991) ‘Downside Risk’, Journal of Portfolio Management, 17(4), pp. 27-31.
Sharpe & Sortino Ratio PROSharpe & Sortino Ratio PRO offers an advanced and more precise way to calculate and visualize the Sharpe and Sortino Ratios for financial assets on TradingView. Its main goal is to provide a scientifically accurate method for assessing the risk-adjusted performance of assets, both in the short and long term. Unlike TradingView’s built-in metrics, this script correctly handles periodic returns, uses optional logarithmic returns, properly annualizes both returns and volatility, and adjusts for the risk-free rate — all critical factors for truly meaningful Sharpe and Sortino calculations.
Users can customize the rolling analysis window (e.g., 252 periods for one year on daily data) and the long-term smoothing period (e.g., 1260 periods for five years). There’s also an option to select between linear and logarithmic returns and to manually input a risk-free rate if real-time data from FRED (the 3-Month T-Bill Rate via FRED:DGS3MO) is unavailable. Based on the chart’s timeframe (daily, weekly, or monthly), the script automatically adjusts the risk-free rate to a per-period basis.
The Sharpe Ratio is calculated by first determining the asset’s excess returns (returns after subtracting the risk-free return per period), then computing the average and standard deviation of those excess returns over the specified window, and finally annualizing these figures separately — in line with best scientific practices (Sharpe, 1994). The Sortino Ratio follows a similar approach but only considers negative returns, focusing specifically on downside risk (Sortino & Van der Meer, 1991).
To enhance readability, the script visualizes the ratios using a color gradient: strong negative values are shown in red, neutral values in yellow, and strong positive values in green. Additionally, the long-term averages for both Sharpe and Sortino are plotted with steady colors (teal and orange, respectively), making it easier to spot enduring performance trends.
Why calculating Sharpe and Sortino Ratios manually on TradingView is necessary?
While TradingView provides basic Sharpe and Sortino Ratios, they come with significant methodological flaws that can lead to misleading conclusions about an asset’s true risk-adjusted performance.
First, TradingView often computes volatility based on the standard deviation of price levels rather than returns (TradingView, 2023). This method is problematic because it causes the volatility measure to be directly dependent on the asset’s absolute price. For instance, a stock priced at $1,000 will naturally show larger absolute daily price moves than a $10 stock, even if their percentage changes are similar. This artificially inflates the measured standard deviation and, as a result, depresses the calculated Sharpe Ratio.
Second, TradingView frequently neglects to adjust for the risk-free rate. By treating all returns as risky returns, the computed Sharpe Ratio may significantly underestimate risk-adjusted performance, especially when interest rates are high (Sharpe, 1994).
Third, and perhaps most critically, TradingView doesn’t properly annualize the mean excess return and the standard deviation separately. In correct financial math, the mean excess return should be multiplied by the number of periods per year, while the standard deviation should be multiplied by the square root of the number of periods per year (Cont, 2001; Fabozzi et al., 2007). Incorrect annualization skews the Sharpe and Sortino Ratios and can lead to under- or overestimating investment risk.
These flaws lead to three major issues:
• Overstated volatility for high-priced assets.
• Incorrect scaling between returns and risk.
• Sharpe Ratios that are systematically biased downward, especially in high-price or high-interest environments.
How to properly calculate Sharpe and Sortino Ratios in Pine Script?
To get accurate results, the Sharpe and Sortino Ratios must be calculated using the correct methodology:
1. Use returns, not price levels, to calculate volatility. Ideally, use logarithmic returns for better mathematical properties like time additivity (Cont, 2001).
2. Adjust returns by subtracting the risk-free rate on a per-period basis to obtain true excess returns.
3. Annualize separately:
• Multiply the mean excess return by the number of periods per year (e.g., 252 for daily data).
• Multiply the standard deviation by the square root of the number of periods per year.
4. Finally, divide the annualized mean excess return by the annualized standard deviation to calculate the Sharpe Ratio.
The Sortino Ratio follows the same structure but uses downside deviations instead of standard deviations.
By following this scientifically sound method, you ensure that your Sharpe and Sortino Ratios truly reflect the asset’s real-world risk and return characteristics.
References
• Cont, R. (2001). Empirical properties of asset returns: stylized facts and statistical issues. Quantitative Finance, 1(2), pp. 223–236.
• Fabozzi, F.J., Gupta, F. and Markowitz, H.M. (2007). The Legacy of Modern Portfolio Theory. Journal of Investing, 16(3), pp. 7–22.
• Sharpe, W.F. (1994). The Sharpe Ratio. Journal of Portfolio Management, 21(1), pp. 49–58.
• Sortino, F.A. and Van der Meer, R. (1991). Downside Risk: Capturing What’s at Stake in Investment Situations. Journal of Portfolio Management, 17(4), pp. 27–31.
• TradingView (2023). Help Center - Understanding Sharpe and Sortino Ratios. Available at: www.tradingview.com (Accessed: 25 April 2025).
Heila's Advanced Buy/Sell Signal (Upgraded) - 100MA TouchI made it for myself, and it wouldn't be easy to lose if you just follow the signals.. but it's rather hard to see them.
LDC Fib + TP + SL (Full Clean Version)LDC Fib + TP + SL Backtester (Enhanced Version)
Description:
The modified version of backtester from @jdehorty.
This script is a highly enhanced version of a Fibonacci-based backtester, originally inspired by @jdehorty's logic.
🚀 Key Features:
Entry/Exit signals based on external source (src) with full date filtering (Start Date, End Date).
Automatic calculation of Fibonacci targets (1.618, 2.618, 3.618) and Stop Loss levels.
Flexible partial take profits with user-defined percentages (TP1 / TP2 / TP3 / ML exit).
Realistic tracking of capital growth, PNL, ROI, Winrate, Profit/Loss ratio, and average gains/losses per trade.
Automatic detection of Stop Loss hits.
📈 Full visualization:
Fib levels
Stop Loss lines
TP hits marked with small circles
Debug labels showing all trade exit details.
📋 Full on-screen Dashboard (Table) with key performance metrics.
🔔 Pre-configured alerts for:
Opening Long/Short positions
Closing positions
Take Profit levels
Stop Loss activation
This backtester is designed for serious strategy refinement and visual clarity.
Perfect for those who need deep analysis and accurate performance tracking on TradingView.
🚀
Massive thanks to @jdehorty for the original inspiration!
This version pushes it even further with a clean structure, advanced stats, and professional visualization!
Williams Percent Range proWilliams Percent Range with Divergences (Williams %R Div)
Description:
This indicator enhances the traditional Williams %R oscillator by detecting both Regular Divergence and Hidden Divergence directly on the %R line. It helps traders spot potential trend reversals and trend continuations with high precision.
Key Features:
Williams %R calculation (standard, normalized between -100 and 0).
Pivot-based detection of divergences:
Regular Bullish Divergence: Price makes a lower low, but %R makes a higher low → potential upward reversal.
Regular Bearish Divergence: Price makes a higher high, but %R makes a lower high → potential downward reversal.
Hidden Bullish Divergence: Price makes a higher low, but %R makes a lower low → potential trend continuation upward.
Hidden Bearish Divergence: Price makes a lower high, but %R makes a higher high → potential trend continuation downward.
Customizable settings:
Enable/disable Regular and Hidden Divergences separately.
Customize colors for each divergence type.
Visual plotting:
Divergence signals are marked with labels (Bull, Bear, H Bull, H Bear) directly on the %R panel.
Built-in alert conditions:
Instant alerts when a Regular or Hidden Divergence is detected.
Usage Recommendation:
Regular Divergences are best used to anticipate trend reversals.
Hidden Divergences are useful for confirming trend continuations.
Combining divergence detection with key support/resistance levels, candlestick patterns, or moving averages can significantly enhance trading accuracy.