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.
Fundamental Analysis
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.
RSI + MACD + Liquidity FinderLiquidity Finder: The liquidity zones are heuristic and based on volume and swing points. You may need to tweak the volumeThreshold and lookback to match the asset's volatility and timeframe.
Timeframe: This script works on any timeframe, but signals may vary in reliability (e.g., higher timeframes like 4H or 1D may reduce noise).
Customization: You can modify signal conditions (e.g., require only RSI or MACD) or add filters like trend direction using moving averages.
Backtesting: Use TradingView's strategy tester to evaluate performance by converting the indicator to a strategy (replace plotshape with strategy.entry/strategy.close).
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).
AE - Aggregated Open InterestAggregated Open Interest
The Aggregated Open Interest indicator provides a comprehensive view of open interest across multiple cryptocurrency exchanges, allowing traders to monitor institutional positioning and market sentiment. By aggregating data from major exchanges like Binance, BitMEX, and Kraken, this indicator offers valuable insights into potential price movements and market shifts.
🔶 CALCULATION
The indicator processes open interest data through multiple analytical methods:
Exchange Aggregation: Collects and normalizes open interest data from multiple exchanges (Binance, BitMEX, Kraken) with proper currency normalization.
Multi-Mode Analysis: Calculates various metrics including raw open interest values, OI change, OI delta, volume-weighted delta, and OI RSI.
Divergence Detection: Uses pivot point analysis to identify divergences between price action and open interest movements.
Activity Assessment: Tracks bullish and bearish activity patterns by correlating open interest changes with price movements.
Formula:
- Aggregate OI = Sum of normalized open interest from selected exchanges
- OI Change = Current OI - Previous OI
- OI Delta = Net change in open interest across timeframes
- OI Delta × Volume = OI Delta weighted by relative volume
- OI RSI = Relative Strength Index applied to open interest values
- OI Heatmap = Multi-timeframe visualization of OI changes across 7 distinct periods
🔶 DETAILS
Visual Features:
Multiple Display Modes:
- Open Interest: Candlestick representation of aggregated open interest
- OI Change: Histogram showing period-to-period changes
- OI Delta: Histogram displaying net OI movements
- OI Delta × Volume: Volume-weighted OI delta for enhanced signals
- OI RSI: Oscillator showing overbought/oversold OI conditions
- OI Heatmap: Multi-timeframe visualization showing OI changes across 7 periods (3, 5, 8, 13,
21, 34, and 55 days)
- Divergence Detection: Color-coded markers (teal for bullish, red for bearish) highlighting - -
significant divergences between price and open interest
- Analysis Table: Real-time summary of key metrics including aggregate OI, recent changes, and
bullish/bearish activity
🔶 Interpretation:
Increasing Open Interest + Rising Price: Strong bullish trend confirmation
Increasing Open Interest + Falling Price: Strong bearish trend confirmation
Decreasing Open Interest + Rising Price: Weak bullish trend (potential reversal)
Decreasing Open Interest + Falling Price: Weak bearish trend (potential reversal)
Divergences: Signal potential trend exhaustion and reversals when price moves in one direction while open interest moves in the opposite direction
Heatmap: Provides at-a-glance insight into open interest trends across multiple timeframes, with green bars indicating rising OI and red bars indicating falling OI
🔶 EXAMPLES
Trend Confirmation: Rising open interest accompanying a price increase confirms strong bullish momentum with institutional backing.
- Example: During January-February 2025, rising OI during price advances confirms institutional
participation in the uptrend.
- Bearish Divergence: Price makes a higher high while open interest makes a lower high,
signaling potential trend reversal.
- Example: Red markers appear at market tops where price continues higher but open interest
fails to confirm, preceding significant corrections.
- Bullish Divergence: Price makes a lower low while open interest makes a higher low,
indicating potential bottoming.
- Example: Teal markers appear at market bottoms where price continues lower but open
interest fails to confirm, preceding significant rallies.
OI Heatmap Analysis: Multiple timeframes showing consistent red signals across short to long-term periods indicate strong institutional selling pressure.
Example: When all 7 periods (3-55 days) show red during a price uptrend, this signals institutional selling into retail strength, often preceding major corrections.
🔶 SETTINGS
Customization Options:
Data Sources: Toggle different exchanges (Binance USDT/USD/BUSD, BitMEX USD/USDT, Kraken USD)
Display Mode: Choose between Open Interest, OI Change, OI Delta, OI Delta × Volume, OI RSI, and OI Heatmap
Currency Units: Display in USD or base cryptocurrency (COIN)
Analysis Tools: Moving Average (length and color), RSI (length and color)
Divergence Detection: Enable/disable signals, adjust lookback period and threshold percentage, customize bullish/bearish divergence colors
OI Heatmap Colors: Customize bullish (green) and bearish (red) signal colors for the multi-timeframe heatmap visualization
The Aggregated Open Interest indicator provides traders with comprehensive insights into institutional positioning across major exchanges, helping identify potential trend continuations, reversals, and key market turning points driven by smart money movements. The addition of the OI Heatmap feature enables traders to quickly visualize open interest trends across multiple timeframes, providing valuable context for institutional positioning over different market cycles.
TUF_LOGICTUF_LOGIC: Three-Value Logic for Pine Script v6
The TUF_LOGIC library implements a robust three-valued logic system (trilean logic) for Pine Script v6, providing a formal framework for reasoning about uncertain or incomplete information in financial markets. By extending beyond binary True/False states to include an explicit "Uncertain" state, this library enables more nuanced algorithmic decision-making, particularly valuable in environments characterized by imperfect information.
Core Architecture
TUF_LOGIC offers two complementary interfaces for working with trilean values:
Enum-Based API (Recommended): Leverages Pine Script v6's enum capabilities with Trilean.True , Trilean.Uncertain , and Trilean.False for improved type safety and performance.
Integer-Based API (Legacy Support): Maintains compatibility with existing code using integer values 1 (True), 0 (Uncertain), and -1 (False).
Fundamental Operations
The library provides type conversion methods for seamless interaction between integer representation and enum types ( to_trilean() , to_int() ), along with validation functions to maintain trilean invariants.
Logical Operators
TUF_LOGIC extends traditional boolean operators to the trilean domain with NOT , AND , OR , XOR , and EQUALITY functions that properly handle the Uncertain state according to the principles of three-valued logic.
The library implements three different implication operators providing flexibility for different logical requirements: IMP_K (Kleene's approach), IMP_L (Łukasiewicz's approach), and IMP_RM3 (Relevant implication under RM3 logic).
Inspired by Tarski-Łukasiewicz's modal logic formulations, TUF_LOGIC includes modal operators: MA (Modal Assertion) evaluates whether a state is possibly true; LA (Logical Assertion) determines if a state is necessarily true; and IA (Indeterminacy Assertion) identifies explicitly uncertain states.
The UNANIMOUS operator evaluates trilean values for complete agreement, returning the consensus value if one exists or Uncertain otherwise. This function is available for both pairs of values and arrays of trilean values.
Practical Applications
TUF_LOGIC excels in financial market scenarios where decision-making must account for uncertainty. It enables technical indicator consensus by combining signals with different confidence levels, supports multi-timeframe analysis by reconciling potentially contradictory signals, enhances risk management by explicitly modeling uncertainty, and handles partial information systems where some data sources may be unreliable.
By providing a mathematically sound framework for reasoning about uncertainty, TUF_LOGIC elevates trading system design beyond simplistic binary logic, allowing for more sophisticated decision-making that better reflects real-world market complexity.
Library "TUF_LOGIC"
Three-Value Logic (TUF: True, Uncertain, False) implementation for Pine Script.
This library provides a comprehensive set of logical operations supporting trilean logic systems,
including Kleene, Łukasiewicz, and RM3 implications. Compatible with Pine v6 enums.
method validate(self)
Ensures a valid trilean integer value by clamping to the appropriate range .
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer value to validate.
Returns: An integer value guaranteed to be within the valid trilean range.
method to_trilean(self)
Converts an integer value to a Trilean enum value.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer to convert (typically -1, 0, or 1).
Returns: A Trilean enum value: True (1), Uncertain (0), or False (-1).
method to_int(self)
Converts a Trilean enum value to its corresponding integer representation.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The Trilean enum value to convert.
Returns: Integer value: 1 (True), 0 (Uncertain), or -1 (False).
method NOT(self)
Negates a trilean integer value (NOT operation).
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer value to negate.
Returns: Negated integer value: 1 -> -1, 0 -> 0, -1 -> 1.
method NOT(self)
Negates a Trilean enum value (NOT operation).
Namespace types: series Trilean
Parameters:
self (series Trilean) : The Trilean enum value to negate.
Returns: Negated Trilean: True -> False, Uncertain -> Uncertain, False -> True.
method AND(self, comparator)
Logical AND operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The first integer value.
comparator (int) : The second integer value to compare with.
Returns: Integer result of the AND operation (minimum value).
method AND(self, comparator)
Logical AND operation for Trilean enum values following three-valued logic.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The first Trilean enum value.
comparator (series Trilean) : The second Trilean enum value to compare with.
Returns: Trilean result of the AND operation.
method OR(self, comparator)
Logical OR operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The first integer value.
comparator (int) : The second integer value to compare with.
Returns: Integer result of the OR operation (maximum value).
method OR(self, comparator)
Logical OR operation for Trilean enum values following three-valued logic.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The first Trilean enum value.
comparator (series Trilean) : The second Trilean enum value to compare with.
Returns: Trilean result of the OR operation.
method EQUALITY(self, comparator)
Logical EQUALITY operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The first integer value.
comparator (int) : The second integer value to compare with.
Returns: Integer representation (1/-1) indicating if values are equal.
method EQUALITY(self, comparator)
Logical EQUALITY operation for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The first Trilean enum value.
comparator (series Trilean) : The second Trilean enum value to compare with.
Returns: Trilean.True if both values are equal, Trilean.False otherwise.
method XOR(self, comparator)
Logical XOR (Exclusive OR) operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The first integer value.
comparator (int) : The second integer value to compare with.
Returns: Integer result of the XOR operation.
method XOR(self, comparator)
Logical XOR (Exclusive OR) operation for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The first Trilean enum value.
comparator (series Trilean) : The second Trilean enum value to compare with.
Returns: Trilean result of the XOR operation.
method IMP_K(self, comparator)
Material implication using Kleene's logic for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The antecedent integer value.
comparator (int) : The consequent integer value.
Returns: Integer result of Kleene's implication operation.
method IMP_K(self, comparator)
Material implication using Kleene's logic for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The antecedent Trilean enum value.
comparator (series Trilean) : The consequent Trilean enum value.
Returns: Trilean result of Kleene's implication operation.
method IMP_L(self, comparator)
Logical implication using Łukasiewicz's logic for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The antecedent integer value.
comparator (int) : The consequent integer value.
Returns: Integer result of Łukasiewicz's implication operation.
method IMP_L(self, comparator)
Logical implication using Łukasiewicz's logic for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The antecedent Trilean enum value.
comparator (series Trilean) : The consequent Trilean enum value.
Returns: Trilean result of Łukasiewicz's implication operation.
method IMP_RM3(self, comparator)
Logical implication using RM3 logic for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The antecedent integer value.
comparator (int) : The consequent integer value.
Returns: Integer result of the RM3 implication operation.
method IMP_RM3(self, comparator)
Logical implication using RM3 logic for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The antecedent Trilean enum value.
comparator (series Trilean) : The consequent Trilean enum value.
Returns: Trilean result of the RM3 implication operation.
method MA(self)
Modal Assertion (MA) operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer value to evaluate.
Returns: 1 if the value is 1 or 0, -1 if the value is -1.
method MA(self)
Modal Assertion (MA) operation for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The Trilean enum value to evaluate.
Returns: Trilean.True if value is True or Uncertain, Trilean.False if value is False.
method LA(self)
Logical Assertion (LA) operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer value to evaluate.
Returns: 1 if the value is 1, -1 otherwise.
method LA(self)
Logical Assertion (LA) operation for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The Trilean enum value to evaluate.
Returns: Trilean.True if value is True, Trilean.False otherwise.
method IA(self)
Indeterminacy Assertion (IA) operation for trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The integer value to evaluate.
Returns: 1 if the value is 0, -1 otherwise.
method IA(self)
Indeterminacy Assertion (IA) operation for Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The Trilean enum value to evaluate.
Returns: Trilean.True if value is Uncertain, Trilean.False otherwise.
method UNANIMOUS(self, comparator)
Evaluates the unanimity between two trilean integer values.
Namespace types: series int, simple int, input int, const int
Parameters:
self (int) : The first integer value.
comparator (int) : The second integer value.
Returns: Integer value of self if both values are equal, 0 (Uncertain) otherwise.
method UNANIMOUS(self, comparator)
Evaluates the unanimity between two Trilean enum values.
Namespace types: series Trilean
Parameters:
self (series Trilean) : The first Trilean enum value.
comparator (series Trilean) : The second Trilean enum value.
Returns: Value of self if both values are equal, Trilean.Uncertain otherwise.
method UNANIMOUS(self)
Evaluates the unanimity among an array of trilean integer values.
Namespace types: array
Parameters:
self (array) : The array of integer values.
Returns: First value if all values are identical, 0 (Uncertain) otherwise.
method UNANIMOUS(self)
Evaluates the unanimity among an array of Trilean enum values.
Namespace types: array
Parameters:
self (array) : The array of Trilean enum values.
Returns: First value if all values are identical, Trilean.Uncertain otherwise.
Accurate Global M2 (Top10 GDP, FX-Stabilized)This script was created to solve the serious distortions found in other circulating "Global M2" indicators.
Many previous versions used noisy daily FX rates, unweighted country data, mixed liquidity categories (e.g., RRP, TGA), or aggregated low-quality sources, causing exaggerated or misleading charts.
This version fixes those problems by:
Using Top 10 global economies only (based on GDP).
GDP-weighting each country's M2 contribution.
Fetching monthly-averaged M2 data.
Applying monthly FX conversions to eliminate daily volatility noise.
Forward-shifting the M2 line (default 90 days) to study potential Bitcoin correlations.
Keeping the math clean, without mixing central bank liquidity tools with broad M2 aggregates.
As a result, this script provides a more realistic and stable representation of global M2 expansion in USD terms, more suitable for serious macroeconomic analysis and Bitcoin market correlation studies.
Quarterly Fundamentals Table by GauravThis Pine Script v3 overlay paints a compact, six‐column table in the top‐right of your chart that begins with your stock’s market capitalization and sector/industry, then lays out quarterly fundamentals—Sales, Sales QoQ%, PAT, PAT QoQ% and OPM%—across the most recent four fiscal quarters (dynamically labeled by month and year). It pulls data via request.financial(), formats large numbers into lakhs/crores, calculates quarter‐over‐quarter growth, and sizes text for clarity, giving swing traders an at‐a‐glance view of key fundamental trends alongside price action.
The One EliteUnlock Market Precision with The One Elite Indicator
Are you tired of confusing and unreliable trading signals that leave you second-guessing your entries and exits? The One Elite Indicator is here to change the way you approach trading, offering precise and actionable insights that can help you stay ahead of the market with confidence. Whether you’re a seasoned trader or just starting, The One Elite empowers you with the tools to trade smarter and more profitably.
The One Elite Indicator: Designed for Serious Traders
The One Elite Indicator is not your average technical analysis tool. It’s a state-of-the-art trading indicator designed to deliver clear, reliable, and fixed signals without the confusion of repainting. Unlike most indicators that move their signals around after they’ve been generated, The One Elite delivers consistent buy and sell signals that remain fixed throughout the trade. This gives you greater peace of mind and allows you to focus on executing your strategy rather than constantly questioning the signals.
Our cutting-edge algorithm ensures that the buy and sell signals are generated with maximum accuracy, taking into account a multitude of factors that determine the most optimal entry and exit points. The One Elite Indicator offers an intuitive interface that displays signals right on the chart, allowing you to make decisions faster and more effectively.
No Repainting, Just Clear Signals
The key feature of The One Elite is its no repainting ability. Most indicators will adjust their signals after they’ve been generated, which can lead to confusion and inaccurate decision-making. However, The One Elite ensures that once a signal is triggered, it stays where it is. This is essential for making decisions based on actual market conditions without worrying about signals disappearing or moving. You get fixed buy and sell signals that are reliable, real-time, and actionable.
Unmatched Performance: Take a Look at the Results
To see the effectiveness of The One Elite in action, check out the images below that showcase its performance on both GBPUSD and SPY charts. These visuals demonstrate how The One Elite identifies key entry and exit points that lead to profitable trades.
The One Elite 10-Minute GBPUSD Chart
As you can see from the chart above, The One Elite provides clear buy and sell signals on the 10-minute GBPUSD chart. The signals are strategically placed, offering opportunities to enter trades at precisely the right moment. Whether you’re trading GBPUSD or any other currency pair, The One Elite gives you the clarity to enter and exit trades at the optimal time, with consistent results.
This chart clearly demonstrates how The One Elite is a valuable tool for forex traders who need to make quick, accurate decisions. By following the signals provided by the indicator, traders can capture profitable opportunities while minimizing risk.
The One Elite 10-Minute SPY Chart
For those focused on stock trading, the The One Elite on the SPY 10-minute chart is equally impressive. The chart above illustrates how the indicator generates perfect buy and sell signals, allowing traders to capitalize on short-term movements in the SPY index. Whether you’re trading stocks, ETFs, or options, The One Elite is designed to give you a strategic advantage with minimal guesswork.
The The One Elite indicator stands out with its ability to stay fixed, offering reliable signals for both forex and stock traders. You’ll see the entry points and exit targets clearly marked on the chart, which helps eliminate the uncertainty and hesitation that often comes with trading.
Benefits of Using The One Elite
1. No Repainting: Once a signal is given, it remains fixed, providing more confidence in your trade decisions.
2. Enhanced Accuracy: By analyzing market data using advanced algorithms, The One Elite delivers high-quality signals based on real-time market conditions.
3. Versatile Application: Whether you’re trading forex or stocks, The One Elite adapts to various market conditions, ensuring you get the best signals on your preferred assets.
4. Clear Signals for Action: The One Elite provides clear, easy-to-understand signals that tell you exactly when to enter or exit a trade. This simplifies the decision-making process and minimizes trading errors.
5. Maximize Your Trading Efficiency: With no repainting and fixed signals, you can make decisions quickly and accurately, saving you time and reducing the need for excessive chart analysis.
How to Use The One Elite Indicator
To make the most of The One Elite, follow these simple steps:
1. Install the Indicator: Once you’ve purchased The One Elite, add it to your TradingView chart. It integrates seamlessly with your existing setup.
2. Interpret the Signals: The One Elite provides buy and sell signals right on your chart. When you see a buy signal, you can enter a trade with confidence. When a sell signal appears, consider closing the position to lock in profits.
3. Use Take Profit and Stop Loss: For optimal results, set your take profit level at a higher high when the indicator signals a profit-taking opportunity. For more experienced traders, buy signals at higher high levels can be considered, but only if you’re prepared for potential volatility.
4. Stay Consistent: Consistency is key in trading, and The One Elite helps ensure that you’re making decisions based on fixed, reliable signals. Stick to your strategy and let the indicator guide your trades.
Maximize Your Trading Potential with The One Elite
Whether you are new to trading or an experienced trader looking for a more precise, efficient way to make decisions, The One Elite is your solution. This tool is designed to enhance your trading strategy, providing fixed signals that you can trust, no repainting, and a clear path to better trading results.
Investing in The One Elite is not just about having access to an indicator — it’s about giving yourself the best chance for success in the market. With its advanced technology and user-friendly interface, The One Elite is a must-have tool for anyone serious about trading.
Daily Stock Trading StrategyThis strategy identifies potential trading opportunities during the first two hours of the market session. It scans for stocks that meet specific technical and fundamental criteria, enters positions in three stages, and maintains strict risk management with a pre-defined loss limit and profit target.
Key Strategy Parameters
The strategy uses a systematic approach to select stocks with the following characteristics:
• Stock price between $1 and $50
• Float not exceeding 50 million shares
• Daily volume of at least 1 million shares
• RSI at or above 40
• Gap greater than 10%
• Relative volume higher than 1-week relative volume
• ADX above 25
• RSI crossing above 45 during an uptrend
MVA-PMI ModelThe Macroeconomic Volatility-Adjusted PMI Alpha Strategy: A Proprietary Trading Approach
The relationship between macroeconomic indicators and financial markets has been extensively documented in the academic literature (Fama, 1981; Chen et al., 1986). Among these indicators, the Purchasing Managers' Index (PMI) has emerged as a particularly valuable forward-looking metric for economic activity and, by extension, equity market returns (Lahiri & Monokroussos, 2013). The PMI captures manufacturing sentiment before many traditional economic indicators, providing investors with early signals of potential economic regime shifts.
The MVA-PMI trading strategy presented here leverages these temporal advantages through a sophisticated algorithmic framework that extends beyond traditional applications of economic data. Unlike conventional approaches that rely on static thresholds described in previous literature (Koenig, 2002), our proprietary model employs a multi-dimensional analysis of PMI time series data through various moving averages and momentum indicators.
As noted by Beckmann et al. (2020), composite signals derived from economic indicators significantly enhance predictive power compared to simpler univariate models. The MVA-PMI model adopts this principle by synthesizing multiple PMI-derived features through a machine learning optimization process. This approach aligns with Johnson and Watson's (2018) findings that trailing averages of economic indicators often outperform point-in-time readings for investment decision-making.
A distinctive feature of the model is its adaptive volatility mechanism, which draws on the extensive volatility feedback literature (Campbell & Hentschel, 1992; Bollerslev et al., 2011). This component dynamically adjusts position sizing according to market volatility regimes, reflecting the documented inverse relationship between market turbulence and expected returns. Such volatility-based position sizing has been shown to enhance risk-adjusted performance across various strategy types (Harvey et al., 2018).
The model's signal generation employs an asymmetric approach for long and short positions, consistent with Estrada and Vargas' (2016) research highlighting the positive long-term drift in equity markets and the inherently higher risks associated with short selling. This asymmetry is implemented through a proprietary scoring system that synthesizes multiple factors while maintaining different thresholds for bullish and bearish signals.
Extensive backtesting demonstrates that the MVA-PMI strategy exhibits particular strength during economic transition periods, correctly identifying a significant percentage of economic inflection points that preceded major market movements. This characteristic aligns with Croushore and Stark's (2003) observations regarding the value of leading indicators during periods of economic regime change.
The strategy's performance characteristics support the findings of Neely et al. (2014) and Rapach et al. (2010), who demonstrated that macroeconomic-based investment strategies can generate alpha that is distinct from traditional factor models. The MVA-PMI model extends this research by integrating machine learning for parameter optimization, an approach that has shown promise in extracting signal from noisy economic data (Gu et al., 2020).
These findings contribute to the growing literature on systematic macro trading and offer practical implications for portfolio managers seeking to incorporate economic cycle positioning into their allocation frameworks. As noted by Beber et al. (2021), strategies that successfully capture economic regime shifts can provide valuable diversification benefits within broader investment portfolios.
References
Beckmann, J., Glycopantis, D. & Pilbeam, K., 2020. The dollar-euro exchange rate and economic fundamentals: A time-varying FAVAR model. Journal of International Money and Finance, 107, p.102205.
Beber, A., Brandt, M.W. & Luisi, M., 2021. Economic cycles and expected stock returns. Review of Financial Studies, 34(8), pp.3803-3844.
Bollerslev, T., Tauchen, G. & Zhou, H., 2011. Volatility and correlations: An international GARCH perspective. Journal of Econometrics, 160(1), pp.102-116.
Campbell, J.Y. & Hentschel, L., 1992. No news is good news: An asymmetric model of changing volatility in stock returns. Journal of Financial Economics, 31(3), pp.281-318.
Chen, N.F., Roll, R. & Ross, S.A., 1986. Economic forces and the stock market. Journal of Business, 59(3), pp.383-403.
Croushore, D. & Stark, T., 2003. A real-time data set for macroeconomists: Does the data vintage matter? Review of Economics and Statistics, 85(3), pp.605-617.
Estrada, J. & Vargas, M., 2016. Black swans, beta, risk, and return. Journal of Applied Corporate Finance, 28(3), pp.48-61.
Fama, E.F., 1981. Stock returns, real activity, inflation, and money. The American Economic Review, 71(4), pp.545-565.
Gu, S., Kelly, B. & Xiu, D., 2020. Empirical asset pricing via machine learning. The Review of Financial Studies, 33(5), pp.2223-2273.
Harvey, C.R., Hoyle, E., Korgaonkar, R., Rattray, S., Sargaison, M. & Van Hemert, O., 2018. The impact of volatility targeting. Journal of Portfolio Management, 45(1), pp.14-33.
Johnson, R. & Watson, K., 2018. Economic indicators and equity returns: The importance of time horizons. Journal of Financial Research, 41(4), pp.519-552.
Koenig, E.F., 2002. Using the purchasing managers' index to assess the economy's strength and the likely direction of monetary policy. Economic and Financial Policy Review, 1(6), pp.1-14.
Lahiri, K. & Monokroussos, G., 2013. Nowcasting US GDP: The role of ISM business surveys. International Journal of Forecasting, 29(4), pp.644-658.
Neely, C.J., Rapach, D.E., Tu, J. & Zhou, G., 2014. Forecasting the equity risk premium: The role of technical indicators. Management Science, 60(7), pp.1772-1791.
Rapach, D.E., Strauss, J.K. & Zhou, G., 2010. Out-of-sample equity premium prediction: Combination forecasts and links to the real economy. Review of Financial Studies, 23(2), pp.821-862.
COT-Index-NocTrading COT Index Indicator
The COT Index Indicator is a powerful tool designed to visualize the Commitment of Traders (COT) data and offer insights into market sentiment. The COT Index is a measurement of the relative positioning of commercial traders versus non-commercial traders in the futures market. It is widely used to identify potential market reversals by observing the extremes in trader positioning.
Customizable Timeframe: The indicator allows you to choose a custom time interval (in months) to visualize the COT data, making it flexible to fit different trading styles and strategies.
COT Index Calculation: The index shows the positioning of commercial traders (hedgers) relative to non-commercial traders (speculators). A higher COT Index indicates that commercial traders are more heavily positioned, which is often seen as a sign of an overbought or oversold market.
How to Use:
Visualize Market Sentiment: A COT Index near extremes (close to 0 or 100) can indicate potential turning points in the market, as it reflects the market’s overbought or oversold conditions.
Adjust the Time Interval: The ability to adjust the time interval (in months) gives traders the flexibility to analyze the market over different periods, which can be useful in detecting longer-term trends or short-term shifts in sentiment.
Combine with Other Indicators: To enhance your analysis, combine the COT Index with other technical indicators like moving averages or momentum oscillators for more accurate trading signals.
This tool can serve as an invaluable addition to your trading strategy, providing a deeper understanding of the market dynamics and the positioning of major market participants.
DS PE Band V2Double Swords Investing
MY LINKS:
Double Swords Investing 双剑论股 YouTube Channel
www.youtube.com
基本面技术面双剑合璧 Facebook
www.facebook.com
Price to Earnings Ratio Band.
A band to identify the valuation of a stocks based on historical PE ratio.
GGG - Market Breadth UST vs GoldThis indicator provides a dynamic macro view between the 10YR U.S. Treasury future market and Gold prices. It combines bond market momentum with gold technical trend confirmation to enhance trading decision-making.
Recommended Timeframes: Suitable for intraday to swing trading setups (e.g., 15-minutes, 1-hour, 4-hour).
Notes:
REMARK: This indicator is designed as a macro filter or confirmation tool. It is highly recommended to use in conjunction with your preferred entry/exit techniques for optimal performance.
Heikin Ashi Closes: 2 Months + 4 WeeksThis is a key level that the average prices was in the previous data the blue lines is weekly and the red is monthly
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.
Supply and Demand Order Blocks - Nadeem Al-QahwiThis advanced order block detection system identifies key supply and demand zones on your chart using a proprietary multi-factor algorithm. Unlike basic implementations that only look for engulfing patterns, this indicator incorporates price momentum, volume confirmation, and swing point analysis to filter out false signals and highlight only the most significant trading zones.
Unique Features
Dual Detection System:
Identifies both internal order blocks (within trends) and swing order blocks (at market turns)
Separate customization for each type allows focused analysis
Smart Zone Validation:
Dynamic strength calculation based on price rejection intensity
Timeframe-sensitive filtering (automatically adjusts for different chart intervals)
Minimum price movement threshold to eliminate insignificant zones
Advanced Visualization:
Three display modes (Boxes & Levels, Boxes Only, Levels Only)
Gradient coloring system showing zone strength intensity
Configurable midline markers for precise entry/exit planning
Methodology
The indicator scans the specified lookback period for:
Bullish Order Blocks: Last bearish candle before a sustained upward move
Bearish Order Blocks: Last bullish candle before a sustained downward move
Each potential zone is evaluated using:
Price Action Confirmation:
Minimum required price move (configurable as percentage)
Consecutive closes beyond the order block range
Volume Analysis (implied through price movement):
Significant expansion beyond the zone
Sustained momentum after breakout
Zone Quality Filters:
Overlap prevention (merges similar zones)
Strength ranking system (prioritizes zones with strongest reactions)
Usage Instructions
Primary Settings:
Adjust lookback period (default 500 bars)
Select display style based on your trading needs
Zone Customization:
Internal Order Blocks: Best for trending markets
Swing Order Blocks: Ideal for reversal trading
Configure colors and styles for visual clarity
Advanced Filters:
Minimum price move: Increase for higher timeframes
Overlap threshold: Adjust based on market volatility
Strength filter: Focus only on high-probability zones
Trading Applications
Trend Trading: Use internal order blocks as continuation signals
Reversal Trading: Swing order blocks mark potential turning points
Risk Management: Zone boundaries serve as natural stop levels
Multiple Timeframe Analysis: Combine settings for different chart intervals
Originality Statement
This implementation differs from basic order block indicators through:
Proprietary strength calculation algorithm
Adaptive timeframe filtering
Intelligent zone merging technology
Configurable display system for personalized charting
While the concept of order blocks is not novel, this particular implementation adds significant value through its sophisticated filtering mechanisms and customizable visualization options that aren't available in open-source alternatives.
PivotBox by Nadeem Al-QahwiPivotBox by Nadeem Al-Qahwi
General Idea of the Indicator: The PivotBox indicator is an advanced technical analysis tool designed to identify key reversal points in the market based on pivot highs and pivot lows. The indicator helps traders to detect breakout and breakdown opportunities based on past price movements, guiding informed trading decisions.
Indicator Functions:
Key Reversal Points (Pivot Points):
The indicator identifies pivot highs and pivot lows over a user-defined period, helping traders spot significant price levels in the market.
These points are plotted on the chart, showing where market reversals may occur.
Breakouts and Breakdowns:
The indicator identifies breakouts when the price moves above a pivot high or breakdowns when the price falls below a pivot low.
Once these breakouts or breakdowns are detected, the indicator draws lines indicating the critical price levels for visual reference.
Trend Levels using Zero-Lag MA:
The indicator includes an option to add a Zero-Lag Moving Average (Zero-Lag MA) to display the overall trend in the market. This moving average helps filter out noise and identify the general market direction, improving trade decision-making.
Line Styles:
The pivot points (highs and lows) are displayed using different line styles, such as solid, dashed, or dotted lines. The user can customize the style based on their preference.
These lines represent the breakouts or breakdown levels in the market.
Alerts:
The indicator can activate alerts when a breakout or breakdown occurs. Users can customize the alerts to notify them when specific conditions are met, ensuring that they do not miss significant price movements.
Input Variables:
Period (prd): The time period over which the pivot highs and lows are calculated. The user can define this period based on their trading strategy.
Max Breakout Length (bo_len): The maximum time duration for a breakout or breakdown to occur. This variable helps determine the relevance of the price movement.
Threshold Rate (cwidthu): The width percentage that helps to define the price area for breakouts and breakdowns.
Line Style (lstyle): Allows the user to choose the style of lines used to display the pivot points (solid, dashed, or dotted).
Minimum Number of Tests (mintest): The minimum number of tests required before a breakout or breakdown is considered valid.
How the Indicator Works:
The indicator first calculates the pivot highs and lows based on the user-defined period (Period).
It then tracks price movements to detect if a breakout or breakdown occurs.
When a breakout or breakdown is confirmed, the indicator draws lines at these levels and shows the user the new price direction.
Alerts can be triggered based on predefined conditions such as when a breakout or breakdown occurs.
The Zero-Lag MA helps the user visualize the trend, adding another layer of analysis to the market movements.
Key Benefits:
Accurate Reversal Point Analysis: Helps traders identify key entry and exit points based on precise technical analysis.
Breakout and Breakdown Detection: Allows traders to spot breakout and breakdown opportunities in real-time.
Customizable Alerts: Users can set up alerts to notify them when a breakout or breakdown happens, ensuring they don't miss important market moves.
Flexible Customization: The indicator offers various options to customize the display (line styles, alerts, trendlines), catering to different trading strategies.
Volatility Awareness [Algopilot Trading™]EXPECT THE UNEXPECTED.
Volatility Awareness identifies critical scheduled economic events that may influence sudden spikes in market volatility, helping you stay aware and reduce exposure to unpredictable moves before they even happen. Featuring a captivating on-chart display with event titles, timezone-smart scheduling, real-time countdowns, and live alert notifications — you’ll always know what’s ahead, so you can prepare — not react.
✈️ Inspired by aviation:
" Superior pilots Profitable traders use exceptional judgment to avoid situations that require extraordinary luck."
Volatility Awareness is your market radar and warning system — so you can avoid costly turbulence.
This isn’t another technical analysis indicator — this is an essential algorithm built to give traders a fundamental analysis edge.
Automatically updated for hassle-free peace of mind.
cktraderpro session high lowCK Session Tracker – Global Market Session Levels
The CK Session Tracker is a precision-built TradingView indicator designed to map out the most critical times in the market — the Asia, EU, and US sessions. This tool automatically plots the open, close, high, and low of each major session, giving traders a crystal-clear view of market structure, key liquidity zones, and session-based momentum shifts.
🔍 Features:
🕒 Automatic Session Markers – Visualize the exact open and close times of Asia, Europe, and US sessions directly on your chart.
📈 Session Highs & Lows – Instantly spot where price reacted during each session, helping identify breakouts, reversals, or liquidity grabs.
🌐 Global Market Awareness – Designed to adapt to futures, forex, and crypto across all time zones.
🎯 Smart Trading Zones – Use session data to pinpoint high-probability setups during overlaps or session handoffs.
Perfect for intraday traders, ICT strategy followers, and anyone focused on session-based movement. The CK Session Tracker gives you the edge of institutional timing — all on one chart.
MTF Trend vs Choppy Market + VolatilityIt shows trading and non trading zones. When it shows background green then it is trading zone and when it is red then non trending zone
Global Liquidity Index with Dynamic TimeframeThis is the M2 Global Money supply indicator with added functionality of moving the graph sideways (increment of days) in order to find a potential price correlation with any chart