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!
Forecasting
QuantumSync Pulse [ w.aritas ]QuantumSync Pulse (QSP) is an advanced technical indicator crafted for traders seeking a dynamic and adaptable tool to analyze diverse market conditions. By integrating momentum, mean reversion, and regime detection with quantum-inspired calculations and entropy analysis, QSP offers a powerful histogram that reflects trend strength and market uncertainty. With multi-timeframe synchronization, adaptive filtering, and customizable visualization, it’s a versatile addition to any trading strategy.
Key Features
Hybrid Signals: Combines momentum and mean reversion, dynamically weighted by market regime.
Quantum Tunneling: Enhances responsiveness in volatile markets using volatility-adjusted calculations.
3-State Entropy: Assesses market uncertainty across up, down, and neutral states.
Regime Detection: Adapts signal weights with Hurst exponent and volatility ROC.
Multi-Timeframe Alignment: Syncs with higher timeframe trends for context.
Customizable Histogram: Displays trend strength with ADX-based visuals and flexible styling.
How to Use and Interpret
Histogram Interpretation
Positive (Above Zero): Bullish momentum; color intensity shows trend strength.
Negative (Below Zero): Bearish momentum; gradients indicate weakness.
Overlaps: Alignment of final_z (signal) and ohlc4 (price) histograms highlights key price levels or turning points.
Regime Visualization
Green Background: Trending market; prioritize momentum signals.
Red Background: Mean-reverting market; focus on reversion signals.
Blue Background: Neutral state; balance both signal types.
Trading Signals
Buy: Histogram crosses above zero or shows positive divergence between histograms.
Sell: Histogram crosses below zero or exhibits negative divergence.
Confirmation: Match signals with regime background—green for trends, red for ranges.
Customization
Tweak Momentum Length, Entropy Lookback, and Hurst Exponent Lookback for sensitivity.
Adjust color themes and transparency to suit your charts.
Tips for Optimal Use
Timeframes: Use higher timeframes (1h, 4h) for trend context and lower (5m, 15m) for entries.
Pairing: Combine with RSI, MACD, or volume indicators for confirmation.
Backtesting: Test settings on historical data for asset-specific optimization.
Overlaps: Watch for histogram overlaps to identify support, resistance, or reversals.
Simulated Performance
Trending Markets: Histogram stays above/below zero, with overlaps at retracements for entries.
Range-Bound Markets: Oscillates around zero; overlaps signal reversals in red regimes.
Volatile Markets: Quantum tunneling ensures quick reactions, with filters reducing noise.
Elevate your trading with QuantumSync Pulse—a sophisticated tool that adapts to the market’s rhythm and your unique style.
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).
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.
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.
Dettsec Strategy SMThe DETTSEC SilverMic Strategy is a precision-engineered trend-following system designed to identify key market reversals using dynamic ATR-based stop levels. Built with the aim of riding trends while avoiding noise and false signals, this strategy uses the Average True Range (ATR) to calculate adaptive stop zones that respond to market volatility. With a combination of smart trailing logic and visual aids, it offers traders clear entry signals and real-time direction tracking.
At the core of this strategy lies a dual-layer stop system. When the market is trending upwards, the strategy calculates a Long Stop by subtracting the ATR from the highest price (or close, depending on user settings) over a specified period. Conversely, in a downtrend, it calculates a Short Stop by adding ATR to the lowest price (or close). These stops are not static — they trail in the direction of the trend and only reset when a reversal is confirmed, ensuring the system remains adaptive yet stable.
The strategy detects trend direction based on price behavior relative to these stops. When the price closes above the Short Stop, the system identifies a potential bullish reversal and shifts into a long mode. Similarly, a close below the Long Stop flips the system into a bearish mode. These directional changes trigger Buy or Sell signals, plotted clearly on the chart with optional label markers and circular highlights.
To enhance usability, the strategy includes visual elements such as color-filled backgrounds indicating the active trend state (green for long, red for short). Traders can customize whether to display Buy/Sell labels, use closing prices for extremum detection, and highlight state changes. Additionally, real-time alerts are built-in for direction changes and trade entries — empowering traders to stay informed even when off the charts.
Whether you're a manual trader seeking confirmation for your entries, or an algo-enthusiast automating entries based on clean signals, the DETTSEC SilverMic Strategy is designed to deliver clarity, reliability, and precision. As always, it's optimized for performance and simplicity
🔔 Credit Spread Monitor: HY & IG vs US10Y🔔 Credit Spread Monitor: HY & IG vs US10Y
This macroeconomic tool tracks credit risk sentiment by plotting the yield spreads between:
🔵 Investment Grade (IG): BAMLC0A0CMEY → ICE BofA US Corporate Index Effective Yield. Reflects average yield for US investment-grade corporate bonds.
🔴 High Yield (HY): BAMLH0A0HYM2EY → ICE BofA US High Yield Index Effective Yield. Measures average yield for US high-yield (non-investment grade) corporate bonds.
⚪ Treasury 10Y: US10Y → 10-Year US Treasury Yield. Benchmark rate for US government long-term debt.
Spreads calculated:
IG Spread = IG Yield - US10Y
HY Spread = HY Yield - US10Y
🔎 Key Alert Zones:
🔴 HY Spread > +2σ → Potential financial stress / risk-off event
🟠 Inverted yield curve (10Y < 2Y) + HY Spread > 2% → Recession signal
🟢 HY Spread < 1.5% → Risk-on behavior, strong credit sentiment
This indicator is ideal for:
✅ Macro traders looking to anticipate economic inflection points
✅ Portfolio managers monitoring systemic risk or credit cycles
✅ Fixed-income analysts tracking the cost of corporate borrowing
Sourced from FRED (Federal Reserve Economic Data) and TradingView’s bond feeds. Designed to work on daily resolution using open prices for best consistency across series.
Divergence Detector - Free🔵Introduction
🟣Understanding Divergence
As mentioned, divergence occurs in technical analysis when a stock's price behaves contrary to indicators on the price chart. Divergence can signify either a reversal of the stock's trend or a continuation of the previous trend correction.
Divergences can act as reversal patterns or continuation patterns. Moreover, divergences can be utilized to identify potential support and resistance levels.
For instance, when an indicator is trending upwards and positive, but the price is declining and trending downwards, divergence occurs. Divergence in a stock indicates trader indecision in buying and selling and warns traders to reconsider their decisions regarding buying or holding the stock.
Divergence aids analysts in identifying critical price points. In indicator divergences, it serves as a potent signal in the realm of technical analysis.
🟣Types of Divergence
1.Regular Divergence
o Positive Regular Divergence (RD+)
o Negative Regular Divergence (RD-)
2.Hidden Divergence
o Positive Hidden Divergence (HD+)
o Negative Hidden Divergence (HD-)
3.Time Divergence
Key Note: This indicator is specifically designed to identify "Regular Divergence" only. Therefore, the following explanation pertains to this type of divergence.
🔵Regular Divergence/Convergence
Regular Divergence(Convergence) occurs due to conflicting behavior between the indicator and the price chart, typically at the end of a trend. Recognizing Regular Divergence suggests an anticipation of a trend reversal or a pattern resembling a reversal.
snapshot
🟣Positive Regular Divergence (RD+)
In contrast to negative divergence, positive Regular Divergence occurs at the end of a downtrend and between two price lows. It manifests when the price forms a new low on the price chart, but the indicator fails to recognize it.
Positive Regular Divergence indicates strong buying pressure and weak selling pressure. Following the identification of positive divergence on the chart, one can anticipate a price increase for the examined stock.
snapshot
🟣Negative Regular Divergence (RD-)
This type of Regular Divergence emerges between two price highs during an uptrend. A new high is formed on the price chart, but the indicator fails to acknowledge it. This scenario indicates negative Regular Divergence.
The likelihood of a subsequent market downturn is high. Negative divergence signifies strong selling pressure and weak buying pressure, suggesting an unfavorable future for the stock.
snapshot
🔵How to use
By utilizing the "Fractal Period" input, you can specify your desired periods for identifying divergences.
Additionally, through the "Divergence Detect Method" feature, you can choose which oscillators (MACD, RSI, or AO) to base divergence identification on.
Divergence in MACD Oscillator:
Divergence in the MACD indicator occurs when the price chart and the MACD line form a noticeable opposing pattern, meaning the price moves contrary to the MACD line. In this scenario, one expects a reversal in price direction.
snapshot
Divergence in RSI Oscillator:
If divergence occurs during a downtrend on the price chart (two consecutive lows, with the second low being lower) and on the corresponding RSI point (two consecutive lows, with the second low being higher), it signifies positive Regular Divergence and implies a buying signal.
Conversely, if divergence occurs during an uptrend on the price chart (two consecutive highs, with the second high being higher) and on the corresponding RSI point (two consecutive highs, with the second high being lower), it indicates negative Regular Divergence, signaling a selling opportunity.
snapshot
Divergence in AO Oscillator:
The AO indicator calculates histograms similar to the AO base. It calculates the difference between the simple moving averages of 5 and 34 periods based on the median of each bar. Then, it plots the bars based on the difference.
It then compares the histograms to detect peaks and troughs in the AO histograms and compares the identified peaks and troughs to the price. Whenever divergence is detected, it plots lines and arrows.
snapshot
🔵Table
The table contains information on the functional features of this oscillator that you can utilize. Four categories of information are presented in the table: "Exist," "Consecutive," "Divergence Quality," and "Change Phase Indicator."
Exist:
If divergence exists, you'll see "+" in this row.
Consecutive:
Divergences may occur consecutively. If same-type divergences form within short intervals, you can observe the count in this row.
snapshot
Divergence Quality: Based on the number of consecutive divergences, their quality can be evaluated. If one divergence exists, its quality is considered "Normal." If two divergences exist, the quality is "Good," and if three or more divergences exist, the quality is considered "Strong."
Change Phase Indicator: If a phase change occurs between two oscillation peaks formed based on divergence, this change is identified and displayed in this row.
snapshot
Dettsec SM ALERTSThe DETTSEC SilverMic Strategy is a precision-engineered trend-following system designed to identify key market reversals using dynamic ATR-based stop levels. Built with the aim of riding trends while avoiding noise and false signals, this strategy uses the Average True Range (ATR) to calculate adaptive stop zones that respond to market volatility. With a combination of smart trailing logic and visual aids, it offers traders clear entry signals and real-time direction tracking.
At the core of this strategy lies a dual-layer stop system. When the market is trending upwards, the strategy calculates a Long Stop by subtracting the ATR from the highest price (or close, depending on user settings) over a specified period. Conversely, in a downtrend, it calculates a Short Stop by adding ATR to the lowest price (or close). These stops are not static — they trail in the direction of the trend and only reset when a reversal is confirmed, ensuring the system remains adaptive yet stable.
The strategy detects trend direction based on price behavior relative to these stops. When the price closes above the Short Stop, the system identifies a potential bullish reversal and shifts into a long mode. Similarly, a close below the Long Stop flips the system into a bearish mode. These directional changes trigger Buy or Sell signals, plotted clearly on the chart with optional label markers and circular highlights.
To enhance usability, the strategy includes visual elements such as color-filled backgrounds indicating the active trend state (green for long, red for short). Traders can customize whether to display Buy/Sell labels, use closing prices for extremum detection, and highlight state changes. Additionally, real-time alerts are built-in for direction changes and trade entries — empowering traders to stay informed even when off the charts.
Whether you're a manual trader seeking confirmation for your entries, or an algo-enthusiast automating entries based on clean signals, the DETTSEC SilverMic Strategy is designed to deliver clarity, reliability, and precision. As always, it's optimized for performance and simplicity.
Issued By Dettsec Algo Pvt Ltd,
Created By - Gaurav Sanghvi - Co-Founder Dettsec Algo Pvt Ltd
Tanmay Joshi - Founder Dettsec Algo Pvt Ltd
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.
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).
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.
ka66: ADR EstimationThis is based on Daryl Guppy's Average Daily Range indicator, the link is difficult to find, but it is an estimation/projection indicator for a daily range.
The thesis is (if I understand correctly):
The range (high - low) of a particular day can be determined, with 85% probability, by taking the ranges of the last 5 days, and getting their average, then multiplying this average value by 0.75. This final value is the estimated range for the next day.
The indicator does not say anything about potential direction, so it may be used as a Take Profit or Stop Loss estimator for the trading strategy in use. Either on the daily timeframe, or an intraday timeframe.
And if we enter the market intraday for a day trade, when the day's range has already exceeded or is close to exceeding the estimated/projected value, perhaps the move is already quite exhausted, and the trade needs to be reconsidered.
A further implication is: if 0.75 multiple occurs with 85% probability, then a lower multiple is even more probable, if one was looking for a more conservative estimate.
The indicator shows three things for a visual inspection of the validity of this concept (and allows basic customisation of parameters):
The day's range, shown in a translucent gray/deep green, as columns. This is the current bar's range. If intraday, it will repaint.
The 5 day average up to the current bar, shown as a step-line plot in orange. If intraday, it will repaint.
The projected range: a thinner blue histogram column, this is offset one bar forward, as it is a future estimate/forward-looking. It too will repaint if the current day is still not complete.
To evaluate the historical results of the chosen settings visually (eye-ball it!), compare the blue histogram bar to the gray bar/column, i.e. the estimate vs. actual range:
When the blue bar is generally within the gray column, and close enough to that column's size/range, then the projected estimation has been reasonable.
if the blue bar tends to be relatively smaller than the gray bar, then we are underestimating often. Increase the projection multiple setting, as a simple fix.
if the blue bar tends to exceed the range of the gray bar a lot, we are overestimating often. Lower the projection multiple setting, as a simple fix.
Guppy's document says that they basically calculate this ADR for multiple markets and focus on markets with the top 5 ranges (in descending order, of course), to maximise the profit potential on intraday trades planned for the next day. Because it is an estimation, this calculation can be run at the end of the day on completed bars.
This indicator also allows displaying the value as percentages, taking the logic of the ATR% (ATR Percent) indicator, which divides the ATR by the close value and multiplies it by 100 to get a normalised percentage value, allowing it to be compared across markets (but in the same timeframe!).
Auto Trend Channel + Buy/Sell AlertsThis indicator automatically detects trend channels using a linear regression line, and dynamically plots upper and lower channel boundaries based on standard deviation. It helps traders identify potential Buy and Sell zones with clear visual signals and customizable alerts.
💡 How It Works:
🧠 Regression-Based Channel: Calculates the central trend line using ta.linreg() over a user-defined length.
📏 Dynamic Boundaries: Upper and lower channel lines are offset by a multiplier of the standard deviation for precision volatility tracking.
✅ Buy Signals: Triggered when price crosses above the lower boundary — potential bounce entry.
❌ Sell Signals: Triggered when price crosses below the upper boundary — potential reversal exit.
🔔 Alerts Enabled: Get real-time alerts when price touches the channel lines.
NIG Probability TableNormal-Inverse Gaussian Probability Table
This indicator implements the Normal-Inverse Gaussian (NIG) distribution to estimate the likelihood of future price based on recent market behavior.
📊 Key Features:
- Estimates the parameters (α: tail heaviness, β: skewness, δ: scale, μ: location)
of the NIG distribution using a sliding window over log returns.
- Uses a numerically approximated version of the modified Bessel function (K₁)
to calculate the NIG probability density function (PDF).
- Normalizes the total probability across all bins to ensure the values are interpretable.
- Displays a dynamic probability table showing the chance of future returns falling into each bin.
⚠️ Notes:
- This is a real-time approximation. The Bessel function and posterior inference are simplified.
- Tail probabilities and shape parameters are sensitive to the window size and input settings.
- Useful for risk analysis, option overlays, and strategy filters.
RSI Swing Indicator + AlertThis is updated script that adds alert function to MrDinasty's "RSI Swing Indicator v2".
This is amazing script.
We must appreciate him forever.
Anyways, you can execute the following best practice after you get alert.
www.youtube.com
This seems to be work most effectively with 3min chart.
BTC 雙MACD 背離策略(基礎共振 / 適用15分鐘 / 多空自動)📌 Strategy Name: BTC Dual MACD Divergence Strategy (15min, Auto Long & Short)
🔍 Overview:
This strategy uses a dual MACD divergence signal (fast and slow MACD) combined with a proximity filter to the 28-period Simple Moving Average (SMA28) to detect potential trend reversals with stronger confirmation.
🧠 Entry Conditions:
Bullish or Bearish divergence detected on both fast and slow MACD.
Price must be within ±1.5% of the SMA28 (proximity condition).
Long and short entries are allowed automatically.
🎯 Exit Conditions:
Fixed Risk-to-Reward ratio of 1:1.5.
Take Profit: +1.5% from entry price.
Stop Loss: -1.0% from entry price.
⏱ Timeframe:
Optimized for 15-minute charts.
Can be integrated with auto-trading bots via alerts/webhooks.
⚠️ Notes:
This strategy is designed for technical validation and automation testing.
Please backtest thoroughly and use proper risk management before applying in live trading.
Ideal for pairing with platforms like WunderTrading, 3Commas, or other webhook-based bot systems.
🔥 Entry-Exit + choppy Zone [Phil Vo]🔥 Entry-Exit Master Tool | ATR Zones + Choppy Filter + Trap Detection
📘 Description:
This script is a high-precision scalping assistant designed to improve trade timing and reduce emotional, low-conviction entries. It blends volatility-based logic, market strength confirmation, and choppy zone detection into a clean visual format to help traders make better decisions in fast-paced 1–5 minute environments.
Built for active traders of SPY, QQQ, and other liquid assets, this tool focuses on three key areas:
Entry & Exit Calculation using ATR logic
Choppy/Sideways Zone Detection to avoid poor conditions
Market Maker Trap Zones to identify manipulation-prone areas
This script acts as a disciplined trading co-pilot: filter the noise, highlight opportunity, and help you stick to the plan.
🧠 Core Features:
✅ Entry-Exit Zones (ATR-Based)
Calculates volatility-adjusted buffer zones using ATR Period and Multiplier
Helps avoid chasing entries during low volatility or fake momentum moves
⚠️ Choppy/Sideways Zone Detection
Marks uncertain, low-momentum environments using:
ATR compression
Weak ADX (trend strength)
Narrow price range
Below-average volume
Grey background + grey dots on candles signal chop zones
Designed to help you stay out, exit early, or wait for clarity
Especially effective for avoiding scalping traps during consolidations
🧱 Market Maker Trap Zones
Identifies high-probability reversal areas near swing highs/lows
Uses RSI + swing logic to warn of potential liquidity grabs or false breakouts
📋 How to Use:
Look for Buy/Sell Labels outside grey chop zones.
Use VWAP or trend confirmation to strengthen the trade idea.
Avoid trading inside choppy zones – grey background = no-fly zone.
Exit positions early if price re-enters a chop zone or volume/ADX collapses.
Watch for reversal plays near trap zones – swing highs/lows may reverse quickly
⚙️ Recommended Settings for 1–5 Minute Scalping:
Setting Suggested Value Notes
ATR Period 7 – 10 Faster reaction to volatility
ATR Multiplier 1.2 – 1.4 Tighter stops for scalping
Trend SMA Period 10 – 14 Short-term trend filter
Min ATR Volatility 0.08 – 0.1 Filters slow bars
Choppy Lookback Period 10 – 14 Recent bar scan for chop
ADX Length / Threshold 10 / 20 – 25 Detects weak or strong trend strength
Volume Lookback / Multiplier 14 / 0.7 – 0.8 Filters weak volume activity
RSI Length / Swing Lookback 14 / 3 – 5 Used for trap zone logic
Zone Size Multiplier 0.002 – 0.003 Controls sensitivity of trap zones
ATR Padding Strength 1.2 – 1.5 Adds margin to trap zone detection
👁️ Visuals on Chart:
✅ Buy/Sell Labels = Entry signal confirmation
✅ Grey background = Choppy/sideways zone – avoid entries!
✅ Grey dots = Choppy candles within chop zone
✅ Colored lines/zones = Market structure + trap zones
⚠️ Disclaimer:
This script is for educational purposes only and does not constitute financial advice. Always test and validate any system before applying in live markets.
Global M2 Money Supply // Days Offset =Implementation of Colin Crypto M2 money supply indicator which seems to lead BTC movement.
EMA200/EMA7 HA w/ TP/SL & Markdown Alerts1. Purpose
A hybrid trend-and-momentum strategy on Heikin-Ashi candles that:
Enters long when price is sufficiently below the 200-period EMA and then crosses up above the 7-period EMA, plus bullish HA trend/momentum.
Enters short when price is sufficiently above the 200-period EMA and then crosses down below the 7-period EMA, plus bearish HA trend/momentum.
Applies configurable take-profit and stop-loss levels on every trade.
Emits rich “Markdown” alerts and plots key levels and a live stats table on the chart.
2. Inputs
Input Description Default
Enable Longs Toggle permission to open long trades true
Enable Shorts Toggle permission to open short trades false
Take Profit % TP distance from entry (percent) 2 %
Stop Loss % SL distance from entry (percent) 2 %
Long Threshold % How far below EMA200 price must be to trigger a long raw signal 0.1 %
Short Threshold % How far above EMA200 price must be to trigger a short raw signal 0.1 %
3. Core Calculations
Heikin-Ashi candles
ha_open / ha_close via request.security(heikinashi,…)
Trend EMAs on HA close
ema200 (200-period) in red
ema7 ( 7-period) in blue
Trend filters
Bullish HA if ha_close > ha_open
Bearish HA if ha_close < ha_open
Momentum filters (two consecutive HA closes rising/falling)
momBull: two rising bars
momBear: two falling bars
4. Signal Generation
Raw long signal (sigLong0) when
(ema200 - ha_close)/ema200 > thLong (price sufficiently below EMA200)
ta.crossover(ha_close, ema7)
Raw short signal (sigShort0) when
(ha_close - ema200)/ema200 > thShort (price sufficiently above EMA200)
ta.crossunder(ha_close, ema7)
Final signals only fire if the corresponding raw signal AND trend/momentum filters and the “enable” checkbox are satisfied.
5. Entries & Exits
On Long:
Record entryPrice = close
Compute tpLine = entryPrice * (1 + tpPerc)
Compute slLine = entryPrice * (1 - slPerc)
strategy.entry("Long", …)
On Short:
tpLine = entryPrice * (1 - tpPerc)
slLine = entryPrice * (1 + slPerc)
strategy.entry("Short", …)
All exits handled by
pinescript
Copier
Modifier
strategy.exit("Exit Long", from_entry="Long", limit=tpLine, stop=slLine)
strategy.exit("Exit Short", from_entry="Short", limit=tpLine, stop=slLine)
6. Alerts
Rich Markdown alerts sent at each entry, containing:
Pair & exchange
Entry price & leverage (hard-coded “5x”)
Calculated TP & SL levels
Simpler alertconditions for chart-based alerts:
“🔥 Achat {{ticker}} à {{close}}”
“❄️ Vente {{ticker}} à {{close}}”
7. Visuals & Stats Table
Plots:
TP/SL lines in green/red (only when a position is open)
EMA200 (red) & EMA7 (blue) overlays
Live stats table (bottom-right) updated every 10 bars showing:
Total trades
Win rate (%)
Net profit
Average profit per trade
Max drawdown
In essence, this strategy blends a trend-filter (200 EMA) with a momentum-confirmation (crossover of 7 EMA on HA bars), applies strict risk management (TP/SL), and surfaces both visual and alert-based feedback to help you capture small, disciplined scalps in trending markets. Ready for telegram