Echo Chamber [theUltimator5]The Echo Chamber - When history repeats, maybe you should listen.
Ever had that eerie feeling you've seen this exact price action before? The Echo Chamber doesn't just give you déjà vu—it mathematically proves it, scales it, and projects what happened next.
📖 WHAT IT DOES
The Echo Chamber is an advanced pattern recognition tool that scans your chart's history to find segments that closely match your current price action. But here's where it gets interesting: it doesn't just find similar patterns - It expands and contracts the time window to create a uniquely scaled fractal. Patterns don't always follow the same timeframe, but they do follow similar patterns.
Using a custom correlation analysis algorithm combined with flexible time-scaling, this indicator:
Finds historical price segments that mirror your current market structure
Scales and overlays them perfectly onto your current chart
Projects forward what happened AFTER that historical match
Gives you a visual "echo" from the past with a glimpse into potential futures
══════════════════════════════
HOW TO USE IT
This indicator starts off in manual mode, which means that YOU, the user, can select the point in time that you want to project from. Simply click on a point in time to set the starting value.
Once you select your point in time, the indicator will automatically plot the chosen historical chart pattern and correlation over the current chart and project the price forwards based on how the chart looked in the past. If you want to change the point in time, you can update it from the settings, or drag the point on the chart over to a new position.
You can manually select any point in time, and the chart will quickly update with the new pattern. A correlation will be shown in a table alongside the date/timestamp of the selected point in time.
You can switch to auto mode, which will automatically search out the best-fit pattern over a defined lookback range and plot the past/future projection for you without having to manually select a point in time at all. It simply finds the best fit for you.
You can change the scale factor by adjusting multiplication and division variables to find time-scaled fractal patterns.
══════════════════════════════
🎯 KEY FEATURES
Two Operating Modes:
🔧 MANUAL MODE - Select any historical point and see how it correlates with current price action in real-time. Perfect for:
• Analyzing specific past events (crashes, rallies, consolidations)
• Testing historical patterns against current conditions
• Educational analysis of market structure repetition
🤖 AUTO MODE - It automatically scans through your lookback period to find the single best-correlated historical match. Ideal for:
• Quick pattern discovery
• Systematic trading approach
• Unbiased pattern recognition
Time Warp Technology:
The time warp feature expands and compresses the correlation window to provide a custom fractal so you can analyze windows of time that don't necessarily match the current chart.
💡 *Example: Multiplier=3, Divisor=2 gives you a 1.5x time stretch—perfect for finding patterns that played out 50% slower than current price action.*
Drawing Modes:
Scale Only : Pure vertical scaling—matches price range while maintaining temporal alignment at bar 0
Rotate & Scale : Advanced geometric transformation that anchors both the start AND end points, creating a rotated fit that matches your current segment's slope and range
Visual Components:
🟠 Orange Overlay : The historical match, perfectly scaled to your current price action
🟣 Purple Projection : What happened NEXT after that historical pattern (dotted line into the future)
📦 Highlight Boxes : Shows you exactly where in history these patterns came from
📊 Live Correlation Table : Real-time correlation coefficient with color-coded strength indicator
══════════════════════════════
⚙️ PARAMETERS EXPLAINED
Correlation Window Length (20) : How many bars to match. Smaller = more precise matches but noisier. Larger = broader patterns but fewer matches.
Note: if this value is too high in auto mode, the script may time out from computational overload.
Multiplication Factor : Historical time multiplier. 2 = sample every 2nd bar from history. Higher values find slower historical patterns.
Division Factor : Historical time divisor applied after multiplication. Final sample rate = (Length × Factor) ÷ Divisor, rounded down.
Lookback Range : How far back to search for patterns. More history = better chance of finding matches but slower performance.
Note: if this value is too high in auto mode, the script may time out from computational overload.
Future Projection Length : How many bars forward to project from the historical match. Your crystal ball's focal length.
══════════════════════════════
💼 TRADING APPLICATIONS
Trend Continuation/Reversal :
If the purple projection continues the current trend, that's your historical confirmation. If it reverses, you've found a potential turning point that's happened before under similar conditions.
Support/Resistance Validation :
Does the projection respect your S/R levels? History suggests those levels matter. Does it break through? You've found historical precedent for a breakout.
Time-Based Exits :
The projection shows not just WHERE price might go, but WHEN. Use it to anticipate timing of moves.
Multi-Timeframe Analysis :
Use time compression to overlay higher timeframe patterns onto lower timeframes. See daily patterns on hourly charts, weekly on daily, etc.
Pattern Education :
In Manual Mode, study how specific historical events correlate with current conditions. Build your pattern recognition library.
══════════════════════════════
📊 CORRELATION TABLE
The table shows your correlation coefficient as a percentage:
80-100%: Extremely strong correlation—history is practically repeating
60-80%: Strong correlation—significant similarity
40-60%: Moderate correlation—some structural similarity
20-40%: Weak correlation—limited similarity
0-20%: Very weak correlation—essentially random match
-20-40%: Weak inverse correlation
-40-60%: Moderate inverse correlation
-60-80%: Strong inverse correlation
-80-100%: Extremely strong inverse correlation—history is practically inverting
**Important**: The correlation measures SHAPE similarity, not price level. An 85% correlation means the price movements follow a very similar pattern, regardless of whether prices are higher or lower.
══════════════════════════════
⚠️ IMPORTANT DISCLAIMERS
- Past performance does NOT guarantee future results (but it sure is interesting to study)
- High correlation doesn't mean causation—markets are complex adaptive systems
- Use this as ONE tool in your analytical toolkit, not a standalone trading system
- The projection is what HAPPENED after a similar pattern in the past, not a prediction
- Always use proper risk management regardless of what the Echo Chamber suggests
══════════════════════════════
🎓 PRO TIPS
1. Start with Auto Mode to find high-correlation matches, then switch to Manual Mode to study why that period was similar
2. Experiment with time warping on different timeframes—a 2x factor on a daily chart lets you see weekly patterns
3. Watch for correlation decay —if correlation drops sharply after the match, current conditions are diverging from history
4. Combine with volume —check if volume patterns also match
5. Use "Rotate & Scale" mode when the current trend angle differs from the historical match
6. Increase lookback range to 500-1000+ on daily/weekly charts for finding rare historical parallels
══════════════════════════════
🔧 TECHNICAL NOTES
- Uses Pearson correlation coefficient for pattern matching
- Implements range-based scaling to normalize different price levels
- Rotation mode uses linear interpolation for geometric transformation
- All calculations are performed on close prices
- Boxes highlight actual historical bar ranges (high/low)
- Maximum of 500 lines and 500 boxes for performance optimization
Forecasting
Per Bak Self-Organized CriticalityTL;DR: This indicator measures market fragility. It measures the system's vulnerability to cascade failures and phase transitions. I've added four independent stress vectors: tail risk, volatility regime, credit stress, and positioning extremes. This allows us to quantify how susceptible markets are to disproportionate moves from small shocks, similar to how a steep sandpile is primed for avalanches.
Avalanches, forest fires, earthquakes, pandemic outbreaks, and market crashes. What do they all have in common? They are not random.
These events follow power laws - stable systems that naturally evolve toward critical states where small triggers can unleash catastrophic cascades.
For example, if you are building a sandpile, there will be a point with a little bit additional sand will cause a landslide.
Markets build fragility grain by grain, like a sandpile approaching avalanche.
The Per Bak Self-Organized Criticality (SOC) indicator detects when the markets are a few grains away from collapse.
This indicator is highly inspired by the work of Per Bak related to the science of self-organized criticality .
As Bak said:
"The earthquake does not 'know how large it will become'. Thus, any precursor state of a large event is essentially identical to a precursor state of a small event."
For markets, this means:
We cannot predict individual crash size from initial conditions
We can predict statistical distribution of crashes
We can identify periods of increased systemic risk (proximity to critical state)
BTW, this is a forwarding looking indicator and doesn't reprint. :)
The Story of Per Bak
In 1987, Danish physicist Per Bak and his colleagues discovered an important pattern in nature: self-organized criticality.
Their sandpile experiment revealed something: drop grains of sand one by one onto a pile, and the system naturally evolves toward a critical state. Most grains cause nothing. Some trigger small slides. But occasionally a single grain triggers a massive avalanche.
The key insight is that we cannot predict which grain will trigger the avalanche, but you can measure when the pile has reached a critical state.
Why Markets Are the Ultimate SOC System?
Financial markets exhibit all the hallmarks of self-organized criticality:
Interconnected agents (traders, institutions, algorithms) with feedback loops
Non-linear interactions where small events can cascade through the system
Power-law distributions of returns (fat tails, not normal distributions)
Natural evolution toward fragility as leverage builds, correlations tighten, and positioning crowds
Phase transitions where calm markets suddenly shift to crisis regimes
Mathematical Foundation
Power Law Distributions
Traditional finance assumes returns follow a normal distribution. "Markets return 10% on average." But I disagree. Markets follow power laws:
P(x) ∝ x^(-α)
Where P(x) is the probability of an event of size x, and α is the power law exponent (typically 3-4 for financial markets).
What this means: Small moves happen constantly. Medium moves are less frequent. Catastrophic moves are rare but follow predictable probability distributions. The "fat tails" are features of critical systems.
Critical Slowing Down
As systems approach phase transitions, they exhibit critical slowing down—reduced ability to absorb shocks. Mathematically, this appears as:
τ ∝ |T - T_c|^(-ν)
Where τ is the relaxation time, T is the current state, T_c is the critical threshold, and ν is the critical exponent.
Translation: Near criticality, markets take longer to recover from perturbations. Fragility compounds.
Component Aggregation & Non-Linear Emergence
The Per Bak SOC our index aggregates four normalized components (each scaled 0-100) with tunable weights:
SOC = w₁·C_tail + w₂·C_vol + w₃·C_credit + w₄·C_position
Default weights (you can change this):
w₁ = 0.34 (Tail Risk via SKEW)
w₂ = 0.26 (Volatility Regime via VIX term structure)
w₃ = 0.18 (Credit Stress via HYG/LQD + TED spread)
w₄ = 0.22 (Positioning Extremes via Put/Call ratio)
Each component uses percentile ranking over a 252-day lookback combined with absolute thresholds to capture both relative regime shifts and extreme absolute levels.
The Four Pillars Explained
1. Tail Risk (SKEW Index)
Measures options market pricing of fat-tail events. High SKEW indicates elevated outlier probability.
C_tail = 0.7·percentrank(SKEW, 252) + 0.3·((SKEW - 115)/0.5)
2. Volatility Regime (VIX Term Structure)
Combines VIX level with term structure slope. Backwardation signals acute stress.
C_vol = 0.4·VIX_level + 0.35·VIX_slope + 0.25·VIX_ratio
3. Credit Stress (HYG/LQD + TED Spread)
Tracks high-yield deterioration versus investment-grade and interbank lending stress.
C_credit = 0.65·percentrank(LQD/HYG, 252) + 0.35·(TED/0.75)·100
4. Positioning Extremes (Put/Call Ratio)
Detects extreme hedging demand through percentile ranking and z-score analysis.
C_position = 0.6·percentrank(P/C, 252) + 0.4·zscore_normalized
What the Indicator Really Measures?
Not Volatility but Fragility
Markets Going Down ≠ Fragility Building (actually when markets go down, risk and fragility are released)
The 0-100 Scale & Regime Thresholds
The indicator outputs a 0-100 fragility score with four regimes:
🟢 Safe (0-39): System resilient, can absorb normal shocks
🟡 Building (40-54): Early fragility signs, watch for deterioration
🟠 Elevated (55-69): System vulnerable
🔴 Critical (70-100): Highly susceptible to cascade failures
Further Reading for Nerds
Bak, P., Tang, C., & Wiesenfeld, K. (1987). "Self-organized criticality: An explanation of 1/f noise." Physical Review Letters.
Bak, P. & Chen, K. (1991). "Self-organized criticality." Scientific American.
Bak, P. (1996). How Nature Works: The Science of Self-Organized Criticality. Copernicus.
Feedback is appreciated :)
IU Momentum OscillatorDESCRIPTION:
The IU Momentum Oscillator is a specialized trend-following tool designed to visualize the raw "energy" of price action. Unlike traditional oscillators that rely solely on closing prices relative to a range (like RSI), this indicator calculates momentum based on the ratio of bullish candles over a specific lookback period.
This "Neon Edition" has been engineered with a focus on visual clarity and aesthetic depth. It utilizes "Shadow Plotting" to create a glowing effect and dynamic "Trend Clouds" to highlight the strength of the move. The result is a clean, modern interface that allows traders to instantly gauge market sentiment—whether the bulls or bears are in control—without cluttering the chart with complex lines.
USER INPUTS:
- Momentum Length (Default: 20): The number of past candles analyzed to count bullish occurrences.
- Momentum Smoothing (Default: 20): An SMA filter applied to the raw data to reduce noise and provide a cleaner wave.
- Signal Line Length (Default: 5): The length of the EMA signal line used to generate crossover signals and the "Trend Cloud."
- Overbought / Oversold Levels (Default: 60 / 40): Thresholds that define extreme market conditions.
- Colors: Fully customizable Neon Cyan (Bullish) and Neon Magenta (Bearish) inputs to match your chart theme.
LONG CONDITION:
- Signal: A Buy signal is indicated by a small Cyan Circle.
- Logic: Occurs when the Main Momentum Line (Glowing) crosses ABOVE the Grey Signal Line.
- Visual Confirmation: The "Trend Cloud" turns Cyan and expands, indicating that bullish momentum is accelerating relative to the recent average.
SHORT CONDITIONS:
- Signal: A Sell signal is indicated by a small Magenta Circle.
- Logic: Occurs when the Main Momentum Line (Glowing) crosses BELOW the Grey Signal Line.
- Visual Confirmation: The "Trend Cloud" turns Magenta, indicating that bearish pressure is increasing.
WHY IT IS UNIQUE:
1. Candle-Count Logic: Most oscillators calculate price distance. This indicator calculates price participation (how many candles were actually green vs red). This offers a different perspective on trend sustainability.
2. Optimized Performance: The script uses math.sum functions rather than heavy for loops, ensuring it loads instantly and runs smoothly on all timeframes.
3. Visual Hierarchy: It uses dynamic gradients and transparency (Alpha channels) to create a "Glow" and "Cloud" effect. This makes the chart easier to read at a glance compared to flat, single-line oscillators.
HOW USER CAN BENEFIT FROM IT:
- Trend Confirmation: Traders can use the "Trend Cloud" to stay in trades longer. As long as the cloud is thick and colored, the trend is strong.
- Divergence Spotting: Because this calculates momentum differently than RSI, it can often show divergences (price goes up, but the count of bullish candles goes down) earlier than standard tools.
- Scalping: The crisp crossover signals (Circles) provide excellent entry triggers for scalpers on lower timeframes when combined with key support/resistance levels.
DISCLAIMER:
This source code and the information presented here are for educational and informational purposes only. It does not constitute financial, investment, or trading advice.
Trading in financial markets involves a high degree of risk and may not be suitable for all investors. You should not rely solely on this indicator to make trading decisions. Always perform your own due diligence, manage your risk appropriately, and consult with a qualified financial advisor before executing any trades.
Bifurcation Early WarningBifurcation Early Warning (BEW) — Chaos Theory Regime Detection
OVERVIEW
The Bifurcation Early Warning indicator applies principles from chaos theory and complex systems research to detect when markets are approaching critical transition points — moments where the current regime is likely to break down and shift to a new state.
Unlike momentum or trend indicators that tell you what is happening, BEW tells you when something is about to change. It provides early warning of regime shifts before they occur, giving traders time to prepare for increased volatility or trend reversals.
THE SCIENCE BEHIND IT
In complex systems (weather, ecosystems, financial markets), major transitions don't happen randomly. Research has identified three universal warning signals that precede critical transitions:
1. Critical Slowing Down
As a system approaches a tipping point, it becomes "sluggish" — small perturbations take longer to decay. In markets, this manifests as rising autocorrelation in returns.
2. Variance Amplification
Short-term volatility begins expanding relative to longer-term baselines as the system destabilizes.
3. Flickering
The system oscillates between two potential states before committing to one — visible as increased crossing of mean levels.
BEW combines all three signals into a single composite score.
COMPONENTS
AR(1) Coefficient — Critical Slowing Down (Blue)
Measures lag-1 autocorrelation of returns over a rolling window.
• Rising toward 1.0: Market becoming "sticky," slow to mean-revert — transition approaching
• Low values (<0.3): Normal mean-reverting behavior, stable regime
Variance Ratio (Purple)
Compares short-term variance to long-term variance.
• Above 1.5: Short-term volatility expanding — energy building before a move
• Near 1.0: Volatility stable, no unusual pressure
Flicker Count (Yellow/Teal)
Counts state changes (crossings of the dynamic mean) within the lookback period.
• High count: Market oscillating between states — indecision before commitment
• Low count: Price firmly in one regime
INTERPRETING THE BEW SCORE
0–50 (STABLE): Normal market conditions. Existing strategies should perform as expected.
50–70 (WARNING): Elevated instability detected. Consider reducing exposure or tightening risk parameters.
70–85 (DANGER): High probability of regime change. Avoid initiating new positions; widen stops on existing ones.
85+ (CRITICAL): Bifurcation likely imminent or in progress. Expect large, potentially unpredictable moves.
HOW TO USE
As a Regime Filter
• BEW < 50: Normal trading conditions — apply your standard strategies
• BEW > 60: Elevated caution — reduce position sizes, avoid mean-reversion plays
• BEW > 80: High alert — consider staying flat or hedging existing positions
As a Preparation Signal
BEW tells you when to pay attention, not which direction. When readings elevate:
• Watch for confirmation from volume, order flow, or other directional indicators
• Prepare for breakout scenarios in either direction
• Adjust take-profit and stop-loss distances for larger moves
For Volatility Adjustment
High BEW periods correlate with larger candles. Use this to:
• Widen stops during elevated readings
• Adjust position sizing inversely to BEW score
• Set more ambitious profit targets when entering during high-BEW breakouts
Divergence Analysis
• Price making new highs/lows while BEW stays low: Trend likely to continue smoothly
• Price consolidating while BEW rises: Breakout incoming — direction uncertain but move will be significant
SETTINGS GUIDE
Core Settings
• Lookback Period: General reference period (default: 50)
• Source: Price source for calculations (default: close)
Critical Slowing Down (AR1)
• AR(1) Calculation Period: Bars used for autocorrelation (default: 100). Higher = smoother, slower.
• AR(1) Warning Threshold: Level at which AR(1) is considered elevated (default: 0.85)
Variance Growth
• Variance Short Period: Fast variance window (default: 20)
• Variance Long Period: Slow variance window (default: 100)
• Variance Ratio Threshold: Level for maximum score contribution (default: 1.5)
Regime Flickering
• Flicker Detection Period: Window for counting state changes (default: 20)
• Flicker Bandwidth: ATR multiplier for state detection — lower = more sensitive (default: 0.5)
• Flicker Count Threshold: Number of crossings for maximum score (default: 4)
TIMEFRAME RECOMMENDATIONS
• 5m–15m: Use shorter periods (AR: 30–50, Var: 10/50). Expect more noise.
• 1H: Balanced performance with default or slightly extended settings (AR: 100, Var: 20/100).
• 4H–Daily: Extend periods further (AR: 100–150, Var: 30/150). Cleaner signals, less frequent.
ALERTS
Three alert conditions are included:
• BEW Warning: Score crosses above 50
• BEW Danger: Score crosses above 70
• BEW Critical: Score crosses above 85
LIMITATIONS
• No directional bias: BEW detects instability, not direction. Combine with trend or momentum indicators.
• Not a timing tool: Elevated readings may persist for several bars before the actual move.
• Parameter sensitive: Optimal settings vary by asset and timeframe. Backtest before live use.
• Leading indicator trade-off: Early warning means some false positives are inevitable.
CREDITS
Inspired by research on early warning signals in complex systems:
• Dakos et al. (2012) — "Methods for detecting early warnings of critical transitions"
DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always conduct your own analysis and risk management. Use at your own risk.
FUSED 9.5 INSTITUTIONAL [FINAL] - AgTradezInstitutional style Indicator that gives you trend direction, MSS, with Tp levels and much more.
MACD Forecast Colorful [DiFlip]MACD Forecast Colorful
The Future of Predictive MACD — is one of the most advanced and customizable MACD indicators ever published on TradingView. Built on the classic MACD foundation, this upgraded version integrates statistical forecasting through linear regression to anticipate future movements — not just react to the past.
With a total of 22 fully configurable long and short entry conditions, visual enhancements, and full automation support, this indicator is designed for serious traders seeking an analytical edge.
⯁ Real-Time MACD Forecasting
For the first time, a public MACD script combines the classic structure of MACD with predictive analytics powered by linear regression. Instead of simply responding to current values, this tool projects the MACD line, signal line, and histogram n bars into the future, allowing you to trade with foresight rather than hindsight.
⯁ Fully Customizable
This indicator is built for flexibility. It includes 22 entry conditions, all of which are fully configurable. Each condition can be turned on/off, chained using AND/OR logic, and adapted to your trading model.
Whether you're building a rules-based quant system, automating alerts, or refining discretionary signals, MACD Forecast Colorful gives you full control over how signals are generated, displayed, and triggered.
⯁ With MACD Forecast Colorful, you can:
• Detect MACD crossovers before they happen.
• Anticipate trend reversals with greater precision.
• React earlier than traditional indicators.
• Gain a powerful edge in both discretionary and automated strategies.
• This isn’t just smarter MACD — it’s predictive momentum intelligence.
⯁ Scientifically Powered by Linear Regression
MACD Forecast Colorful is the first public MACD indicator to apply least-squares predictive modeling to MACD behavior — effectively introducing machine learning logic into a time-tested tool.
It uses statistical regression to analyze historical behavior of the MACD and project future trajectories. The result is a forward-shifted MACD forecast that can detect upcoming crossovers and divergences before they appear on the chart.
⯁ Linear Regression: Technical Foundation
Linear regression is a statistical method that models the relationship between a dependent variable (y) and one or more independent variables (x). The basic formula for simple linear regression is:
y = β₀ + β₁x + ε
Where:
y = predicted variable (e.g., future MACD value)
x = independent variable (e.g., bar index)
β₀ = intercept
β₁ = slope
ε = random error (residual)
The regression model calculates β₀ and β₁ using the least squares method, minimizing the sum of squared prediction errors to produce the best-fit line through historical values. This line is then extended forward, generating a forecast based on recent price momentum.
⯁ Least Squares Estimation
The regression coefficients are computed with the following formulas:
β₁ = Σ((xᵢ - x̄)(yᵢ - ȳ)) / Σ((xᵢ - x̄)²)
β₀ = ȳ - β₁x̄
Where:
Σ denotes summation; x̄ and ȳ are the means of x and y; and i ranges from 1 to n (number of observations). These equations produce the best linear unbiased estimator under the Gauss–Markov assumptions — constant variance (homoscedasticity) and a linear relationship between variables.
⯁ Regression in Machine Learning
Linear regression is a foundational model in supervised learning. Its ability to provide precise, explainable, and fast forecasts makes it critical in AI systems and quantitative analysis.
Applying linear regression to MACD forecasting is the equivalent of injecting artificial intelligence into one of the most widely used momentum tools in trading.
⯁ Visual Interpretation
Picture the MACD values over time like this:
Time →
MACD →
A regression line is fitted to recent MACD values, then projected forward n periods. The result is a predictive trajectory that can cross over the real MACD or signal line — offering an early-warning system for trend shifts and momentum changes.
The indicator plots both current MACD and forecasted MACD, allowing you to visually compare short-term future behavior against historical movement.
⯁ Scientific Concepts Used
Linear Regression: models the relationship between variables using a straight line.
Least Squares Method: minimizes squared prediction errors for best-fit.
Time-Series Forecasting: projects future data based on past patterns.
Supervised Learning: predictive modeling using labeled inputs.
Statistical Smoothing: filters noise to highlight trends.
⯁ Why This Indicator Is Revolutionary
First open-source MACD with real-time predictive modeling.
Scientifically grounded with linear regression logic.
Automatable through TradingView alerts and bots.
Smart signal generation using forecasted crossovers.
Highly customizable with 22 buy/sell conditions.
Enhanced visuals with background (bgcolor) and area fill (fill) support.
This isn’t just an update — it’s the next evolution of MACD forecasting.
⯁ Example of simple linear regression with one independent variable
This example demonstrates how a basic linear regression works when there is only one independent variable influencing the dependent variable. This type of model is used to identify a direct relationship between two variables.
⯁ In linear regression, observations (red) are considered the result of random deviations (green) from an underlying relationship (blue) between a dependent variable (y) and an independent variable (x)
This concept illustrates that sampled data points rarely align perfectly with the true trend line. Instead, each observed point represents the combination of the true underlying relationship and a random error component.
⯁ Visualizing heteroscedasticity in a scatterplot with 100 random fitted values using Matlab
Heteroscedasticity occurs when the variance of the errors is not constant across the range of fitted values. This visualization highlights how the spread of data can change unpredictably, which is an important factor in evaluating the validity of regression models.
⯁ The datasets in Anscombe’s quartet were designed to have nearly the same linear regression line (as well as nearly identical means, standard deviations, and correlations) but look very different when plotted
This classic example shows that summary statistics alone can be misleading. Even with identical numerical metrics, the datasets display completely different patterns, emphasizing the importance of visual inspection when interpreting a model.
⯁ Result of fitting a set of data points with a quadratic function
This example illustrates how a second-degree polynomial model can better fit certain datasets that do not follow a linear trend. The resulting curve reflects the true shape of the data more accurately than a straight line.
⯁ What is the MACD?
The Moving Average Convergence Divergence (MACD) is a technical analysis indicator developed by Gerald Appel. It measures the relationship between two moving averages of a security’s price to identify changes in momentum, direction, and strength of a trend. The MACD is composed of three components: the MACD line, the signal line, and the histogram.
⯁ How to use the MACD?
The MACD is calculated by subtracting the 26-period Exponential Moving Average (EMA) from the 12-period EMA. A 9-period EMA of the MACD line, called the signal line, is then plotted on top of the MACD line. The MACD histogram represents the difference between the MACD line and the signal line.
Here are the primary signals generated by the MACD:
• Bullish Crossover: When the MACD line crosses above the signal line, indicating a potential buy signal.
• Bearish Crossover: When the MACD line crosses below the signal line, indicating a potential sell signal.
• Divergence: When the price of the security diverges from the MACD, suggesting a potential reversal.
• Overbought/Oversold Conditions: Indicated by the MACD line moving far away from the signal line, though this is less common than in oscillators like the RSI.
⯁ How to use MACD forecast?
The MACD Forecast is built on the same foundation as the classic MACD, but with predictive capabilities.
Step 1 — Spot Predicted Crossovers:
Watch for forecasted bullish or bearish crossovers. These signals anticipate when the MACD line will cross the signal line in the future, letting you prepare trades before the move.
Step 2 — Confirm with Histogram Projection:
Use the projected histogram to validate momentum direction. A rising histogram signals strengthening bullish momentum, while a falling projection points to weakening or bearish conditions.
Step 3 — Combine with Multi-Timeframe Analysis:
Use forecasts across multiple timeframes to confirm signal strength (e.g., a 1h forecast aligned with a 4h forecast).
Step 4 — Set Entry Conditions & Automation:
Customize your buy/sell rules with the 20 forecast-based conditions and enable automation for bots or alerts.
Step 5 — Trade Ahead of the Market:
By preparing for future momentum shifts instead of reacting to the past, you’ll always stay one step ahead of lagging traders.
📈 BUY
🍟 Signal Validity: The signal will remain valid for X bars.
🍟 Signal Sequence: Configurable as AND or OR.
🍟 MACD > Signal Smoothing
🍟 MACD < Signal Smoothing
🍟 Histogram > 0
🍟 Histogram < 0
🍟 Histogram Positive
🍟 Histogram Negative
🍟 MACD > 0
🍟 MACD < 0
🍟 Signal > 0
🍟 Signal < 0
🍟 MACD > Histogram
🍟 MACD < Histogram
🍟 Signal > Histogram
🍟 Signal < Histogram
🍟 MACD (Crossover) Signal
🍟 MACD (Crossunder) Signal
🍟 MACD (Crossover) 0
🍟 MACD (Crossunder) 0
🍟 Signal (Crossover) 0
🍟 Signal (Crossunder) 0
🔮 MACD (Crossover) Signal Forecast
🔮 MACD (Crossunder) Signal Forecast
📉 SELL
🍟 Signal Validity: The signal will remain valid for X bars.
🍟 Signal Sequence: Configurable as AND or OR.
🍟 MACD > Signal Smoothing
🍟 MACD < Signal Smoothing
🍟 Histogram > 0
🍟 Histogram < 0
🍟 Histogram Positive
🍟 Histogram Negative
🍟 MACD > 0
🍟 MACD < 0
🍟 Signal > 0
🍟 Signal < 0
🍟 MACD > Histogram
🍟 MACD < Histogram
🍟 Signal > Histogram
🍟 Signal < Histogram
🍟 MACD (Crossover) Signal
🍟 MACD (Crossunder) Signal
🍟 MACD (Crossover) 0
🍟 MACD (Crossunder) 0
🍟 Signal (Crossover) 0
🍟 Signal (Crossunder) 0
🔮 MACD (Crossover) Signal Forecast
🔮 MACD (Crossunder) Signal Forecast
🤖 Automation
All BUY and SELL conditions can be automated using TradingView alerts. Every configurable condition can trigger alerts suitable for fully automated or semi-automated strategies.
⯁ Unique Features
Linear Regression: (Forecast)
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Table of Conditions: BUY/SELL
Conditions Label: BUY/SELL
Plot Labels in the graph above: BUY/SELL
Automate & Monitor Signals/Alerts: BUY/SELL
Background Colors: "bgcolor"
Background Colors: "fill"
Linear Regression (Forecast)
Signal Validity: The signal will remain valid for X bars
Signal Sequence: Configurable as AND/OR
Table of Conditions: BUY/SELL
Conditions Label: BUY/SELL
Plot Labels in the graph above: BUY/SELL
Automate & Monitor Signals/Alerts: BUY/SELL
Background Colors: "bgcolor"
Background Colors: "fill"
Previous Week's chart Action (Prediction) maybeUsing chart data on the same day and hour from last week to gauge a possible future outcome. Not investing advise. Do your own research.
NYMO Fib Levels - RGNYMO is a single-session tool built around Fibonacci projections from the New York morning move. It automatically marks the NYMO session, measures its high–low range and projects your custom fib multiples above and below price, with every level drawn and labelled so you always know exactly which multiple you are trading around.
The core of the script is the 12:00–12:30 opening window. That first 30 minutes is treated as the price-discovery phase of the session: it captures the initial burst of liquidity, the repricing of overnight positions and the first real directional push. The high and low of 12:00–12:30 form the opening range, and all fib projections are anchored to that move, turning the very first half-hour into a structured map for the rest of the session.
On top of the fib framework, NYMO can show the NYMO session box, compare the current range to recent NYMO statistics, and trigger alerts when price breaks the NYMO high or low or trades through key fib areas. It is built for traders who only care about the New York morning and want all of their structure, targets and alerts driven by fibs from that one defined opening window.
BTC Price Prediction Model [Global PMI]V2🇺🇸 English Guide
1. Introduction
This indicator was created by GW Capital using Gemini Vibe Coding technology. It leverages advanced AI coding capabilities to reconstruct complex macroeconomic models into actionable trading tools.
2. Credits
Special thanks to the original model author, Marty Kendall. His research into the correlation between Bitcoin's price and macroeconomic factors lays the foundation for this algorithm.
3. Model Principles & Formula
This model calculates the "Fair Value" of Bitcoin based on four key macroeconomic pillars. It assumes that Bitcoin's price is a function of Global Liquidity, Network Security, Risk Appetite, and the Economic Cycle.
💡 Unique Insight: PMI & The 4-Year Cycle
A key distinguishing feature of this model is the hypothesis that Bitcoin's famous "4-Year Halving Cycle" may be intrinsically linked to the Global Business Cycle (PMI), rather than just supply shocks.
Therefore, the model incorporates PMI as a valuation "Amplifier".
Note: Due to TradingView data limitations, US PMI is currently used as the proxy for the global cycle.
The Formula
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
Global Liquidity (M2): Sum of M2 supply from US, China, Eurozone, and Japan (converted to USD). Represents the pool of fiat money available to flow into assets.
Network Security (Hashrate): Bitcoin's hashrate, representing the physical security and utility of the network.
Risk Appetite (S&P 500): Used as a proxy for global risk sentiment.
Economic Cycle (PMI Z-Score): US Manufacturing PMI is used to amplify or dampen the valuation based on where we are in the business cycle (Expansion vs. Contraction).
4. How to Use
The indicator plots the Fair Value (White Line) and four sentiment bands based on statistical deviation (Z-Score).
Sentiment Zones
🚨 Extreme Greed (Red Zone): Price > +0.3 StdDev. Historically indicates a market top or overheated sentiment.
⚠️ Greed (Orange Zone): Price > +0.15 StdDev. Bullish momentum is strong but caution is advised.
⚖️ Fair Value (White Line): The theoretical "correct" price based on macro data.
😨 Fear (Teal Zone): Price < -0.15 StdDev. Undervalued territory.
💎 Extreme Fear (Green Zone): Price < -0.3 StdDev. Historically a generational buying opportunity.
Sentiment Score (0-100)
100: Maximum Greed (Top)
50: Fair Value
0: Maximum Fear (Bottom)
5. Usage Recommendations
Timeframe: Daily (1D) or Weekly (1W) ONLY.
Reason: The underlying data sources (M2, PMI) are updated monthly. The S&P 500 and Hashrate are daily. Using this indicator on intraday charts (e.g., 15m, 1h, 4h) adds no value because the fundamental data does not change that fast.
Long-Term View: This is a macro-cycle indicator designed for identifying cycle tops and bottoms over months and years, not for day trading.
6. Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. The model relies on historical correlations which may not hold true in the future. All trading involves risk. GW Capital and the creators assume no responsibility for any trading losses.
7. Support Us ❤️
If you find this indicator useful, please Boost 👍, Comment, and add it to your Favorites! Your support keeps us going.
🇨🇳 中文说明 (Chinese Version)
1. 简介
本指标由 GW Capital 使用 Gemini Vibe Coding 技术制作。利用先进的 AI 编程能力,将复杂的宏观经济模型重构为可执行的交易工具。
2. 致谢
特别感谢模型原作者 Marty Kendall。他对这一算法的研究奠定了基础,揭示了比特币价格与宏观经济因素之间的深层联系。
3. 模型原理与公式
该模型基于四大宏观经济支柱计算比特币的“公允价值”。它假设比特币的价格是全球流动性、网络安全性、风险偏好和经济周期的函数。
💡 独家洞察:PMI 与 4年周期
本模型的一个核心独特之处在于:我们认为比特币著名的“4年减半周期”背后的真正驱动力,可能与全球商业周期 (PMI) 高度同步,而不仅仅是供应减半。
因此,模型特别引入 PMI 作为估值的“放大器” (Amplifier)。
注:由于 TradingView 数据源限制,目前采用历史数据最详尽的美国 PMI 作为全球周期的代理指标。
模型公式
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
全球流动性 (M2): 美、中、欧、日四大经济体的 M2 总量(折算为美元)。代表可流入资产的法币资金池。
网络安全性 (Hashrate): 比特币全网算力,代表网络的物理安全性和实用价值。
风险偏好 (S&P 500): 作为全球风险情绪的代理指标。
经济周期 (PMI Z-Score): 美国制造业 PMI 用于根据商业周期(扩张 vs 收缩)来放大或抑制估值。
4. 指标用法
指标会在图表上绘制 公允价值 (白线) 以及基于统计偏差 (Z-Score) 的四条情绪带。
情绪区间
🚨 极度贪婪 (红色区域): 价格 > +0.3 标准差。历史上通常预示市场顶部或情绪过热。
⚠️ 一般贪婪 (橙色区域): 价格 > +0.15 标准差。多头动能强劲,但需谨慎。
⚖️ 公允价值 (白线): 基于宏观数据的理论“正确”价格。
😨 一般恐惧 (青色区域): 价格 < -0.15 标准差。进入低估区域。
💎 极度恐惧 (绿色区域): 价格 < -0.3 标准差。历史上通常是代际级别的买入机会。
情绪评分 (0-100)
100: 极度贪婪 (顶部)
50: 公允价值
0: 极度恐惧 (底部)
5. 使用建议
周期: 仅限日线 (1D) 或周线 (1W)。
原因: 底层数据源(M2, PMI)是月度更新的。标普500和算力是日度更新的。在日内图表(如15分钟、1小时、4小时)上使用此指标没有任何意义,因为基本面数据不会变化得那么快。
长期视角: 这是一个宏观周期指标,旨在识别数月甚至数年的周期顶部和底部,而非用于日内交易。
6. 免责声明
本指标仅供教育和参考使用,不构成任何财务建议。该模型依赖于历史相关性,未来可能不再适用。所有交易均涉及风险。GW Capital 及制作者不对任何交易损失承担责任。
ETH_LuxRelayAll good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good All good
BTC Price Prediction Model [Global PMI]🇨🇳 中文说明 (Chinese Version)
1. 简介
本指标由 GW Capital 使用 Gemini Vibe Coding 技术制作。利用先进的 AI 编程能力,将复杂的宏观经济模型重构为可执行的交易工具。
2. 致谢
特别感谢模型原作者 Marty Kendall。他对这一算法的研究奠定了基础,揭示了比特币价格与宏观经济因素之间的深层联系。
3. 模型原理与公式
该模型基于四大宏观经济支柱计算比特币的“公允价值”。它假设比特币的价格是全球流动性、网络安全性、风险偏好和经济周期的函数。
模型公式
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
全球流动性 (M2): 美、中、欧、日四大经济体的 M2 总量(折算为美元)。代表可流入资产的法币资金池。
网络安全性 (Hashrate): 比特币全网算力,代表网络的物理安全性和实用价值。
风险偏好 (S&P 500): 作为全球风险情绪的代理指标。
经济周期 (PMI Z-Score): 美国制造业 PMI 用于根据商业周期(扩张 vs 收缩)来放大或抑制估值。
4. 指标用法
指标会在图表上绘制 公允价值 (白线) 以及基于统计偏差 (Z-Score) 的四条情绪带。
情绪区间
🚨 极度贪婪 (红色区域): 价格 > +0.3 标准差。历史上通常预示市场顶部或情绪过热。
⚠️ 一般贪婪 (橙色区域): 价格 > +0.15 标准差。多头动能强劲,但需谨慎。
⚖️ 公允价值 (白线): 基于宏观数据的理论“正确”价格。
😨 一般恐惧 (青色区域): 价格 < -0.15 标准差。进入低估区域。
💎 极度恐惧 (绿色区域): 价格 < -0.3 标准差。历史上通常是代际级别的买入机会。
情绪评分 (0-100)
100: 极度贪婪 (顶部)
50: 公允价值
0: 极度恐惧 (底部)
5. 使用建议
周期: 仅限日线 (1D) 或周线 (1W)。
原因: 底层数据源(M2, PMI)是月度更新的。标普500和算力是日度更新的。在日内图表(如15分钟、1小时、4小时)上使用此指标没有任何意义,因为基本面数据不会变化得那么快。
长期视角: 这是一个宏观周期指标,旨在识别数月甚至数年的周期顶部和底部,而非用于日内交易。
6. 免责声明
本指标仅供教育和参考使用,不构成任何财务建议。该模型依赖于历史相关性,未来可能不再适用。所有交易均涉及风险。GW Capital 及制作者不对任何交易损失承担责任。
🇺🇸 English Guide (英文说明)
1. Introduction
This indicator was created by GW Capital using Gemini Vibe Coding technology. It leverages advanced AI coding capabilities to reconstruct complex macroeconomic models into actionable trading tools.
2. Credits
Special thanks to the original model author, Marty Kendall. His research into the correlation between Bitcoin's price and macroeconomic factors lays the foundation for this algorithm.
3. Model Principles & Formula
This model calculates the "Fair Value" of Bitcoin based on four key macroeconomic pillars. It assumes that Bitcoin's price is a function of Global Liquidity, Network Security, Risk Appetite, and the Economic Cycle.
The Formula
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
Global Liquidity (M2): Sum of M2 supply from US, China, Eurozone, and Japan (converted to USD). Represents the pool of fiat money available to flow into assets.
Network Security (Hashrate): Bitcoin's hashrate, representing the physical security and utility of the network.
Risk Appetite (S&P 500): Used as a proxy for global risk sentiment.
Economic Cycle (PMI Z-Score): US Manufacturing PMI is used to amplify or dampen the valuation based on where we are in the business cycle (Expansion vs. Contraction).
4. How to Use
The indicator plots the Fair Value (White Line) and four sentiment bands based on statistical deviation (Z-Score).
Sentiment Zones
🚨 Extreme Greed (Red Zone): Price > +0.3 StdDev. Historically indicates a market top or overheated sentiment.
⚠️ Greed (Orange Zone): Price > +0.15 StdDev. Bullish momentum is strong but caution is advised.
⚖️ Fair Value (White Line): The theoretical "correct" price based on macro data.
😨 Fear (Teal Zone): Price < -0.15 StdDev. Undervalued territory.
💎 Extreme Fear (Green Zone): Price < -0.3 StdDev. Historically a generational buying opportunity.
Sentiment Score (0-100)
100: Maximum Greed (Top)
50: Fair Value
0: Maximum Fear (Bottom)
5. Usage Recommendations
Timeframe: Daily (1D) or Weekly (1W) ONLY.
Reason: The underlying data sources (M2, PMI) are updated monthly. The S&P 500 and Hashrate are daily. Using this indicator on intraday charts (e.g., 15m, 1h, 4h) adds no value because the fundamental data does not change that fast.
Long-Term View: This is a macro-cycle indicator designed for identifying cycle tops and bottoms over months and years, not for day trading.
6. Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. The model relies on historical correlations which may not hold true in the future. All trading involves risk. GW Capital and the creators assume no responsibility for any trading losses.
Donchian ForecastDonchian Forecast – multi-timeframe Donchian/ATR bias with ADX regime blending
Donchian Forecast is a multi-timeframe bias tool that turns classic Donchian channels into a normalized trend/mean-reversion “forecast” and a single bias value in .
It projects a short polyline path from the current price and shows how that path adapts when the market shifts from ranging to trending (via ADX).
---
Concept
1. Donchian position → direction
For each timeframe, the script measures where price sits inside its Donchian channel:
-1 = near channel low
0 = middle
+1 = near channel high
This Donchian position is multiplied by ATR to create a **price delta** (how far the forecast moves from current price).
2. Local behavior: trend vs mean-reversion around Donchian
The indicator treats the edges vs middle of the Donchian channel differently:
* By default, edges behave more “trend-like”, middle more “mean-reverting”.
* If you enable the reversed option, this logic flips (edges = mean-reverting, middle = trend-
like).
* This “local” behavior is controlled smoothly by the absolute Donchian position |pos| (not by hard zone switches).
3. Global ADX modulation (regime aware)
ADX is mapped from your chosen low → high thresholds into a signed factor in :
* ADX ≤ low → -1 (fully reversed behavior, more range/mean-reversion oriented)
* ADX ≥ high → +1 (fully normal behavior, more trend oriented)
* Values in between create a **smooth transition**.
* This global factor can:
* Keep the local behavior as is (trending regime),
* Flip it (range regime), or
* Neutralize it (indecisive regime).
4. Multi-timeframe aggregation (1x–12x chart timeframe)
* The script repeats the same logic across 12 horizons:
* 1x = chart timeframe
* 2x..12x = multiples of the chart timeframe (e.g., 5m → 10m, 15m, …; 1h → 2h, 3h, …).
* For each horizon it builds:
* Donchian position
* ATR-scaled delta (in price units)
* Locally + globally blended delta (after Donchian + ADX logic).
* These blended deltas are ATR-weighted and summed into a single bias in , which is then shown as Bias % in the on-chart table.
---
### What you see on the chart
* Forecast polyline
* Starting at the current close, the indicator draws a short chain of **up to 12 segments**:
* Segment 1: from current price → 1x projection
* Segment 2: 1x → 2x projection
* … up to 12x.
* Each segment is:
* Green when its blended delta is ≥ 0 (upward bias)
* Red when its blended delta is < 0 (downward bias)
* This is not future price, but a synthetic path showing how the Donchian/ATR/ADX model “expects” price to drift across multiple horizons.
* Bias table (top-center)
* `Bias: X.Y%`
* > 0% (green) → net upward bias across horizons
* < 0% (red) → net downward bias
* Magnitude (e.g., ±70–100%) ≈ strength of the directional skew.
* `ADX:` current ADX value (from your DMI settings).
* `ADXBlend:` the signed ADX factor in :
* +1 ≈ fully “trend-interpretation” of Donchian behavior
* 0 ≈ neutral / mixed regime
* -1 ≈ fully “reversed/mean-reversion interpretation”
---
Inputs & settings
Core Donchian / ATR
* Donchian Length – lookback for Donchian high/low on each horizon.
* Price Source – input series used for position inside the Donchian channel (default: close).
* ATR Length – ATR lookback for all horizons.
* ATR Multiplier – scales the size of each forecast step in price units (higher = longer segments / more aggressive forecast).
*Local behavior at high ADX
* Reversed local blend at high ADX?
* Off (default) – edges behave more trend-like, middle more mean-reverting.
* On – flips that logic (edges more mean-reverting, middle more trend-like).
* The actual effect is always modulated by the global ADX factor, so you can experiment with how the regime logic feels in different markets.
Global ADX blending
* DMI DI Length – period for the DI+ and DI- components.
* ADX Smoothing – smoothing length for ADX.
* ADX low (mean-rev zone) – below this level, the global factor pushes behavior toward reversal/range logic .
* ADX high (trend zone) – above this level, the global factor pushes behavior toward **trend logic**.
* Values between low and high create a smooth blend rather than a hard on/off switch.
---
How to use it (examples)
* Directional bias dashboard
* Use the Bias % as a compact summary of multi-horizon Donchian/ATR/ADX conditions:
* Consider only trades aligned with the sign of Bias (e.g., longs only when Bias > 0).
* Use the magnitude to filter for **strong vs weak** directional contexts.
* Regime-aware context
* Watch ADX and ADXBlend:
* High ADX & ADXBlend ≈ +1 → favor trend-continuation ideas.
* Low ADX & ADXBlend ≈ -1 → favor range/mean-reversion ideas.
* Around 0 → mixed/transition regimes; forecasts will be more muted.
* Visual sanity check for systems
* Overlay Donchian Forecast on your usual entries/exits to see:
* When your system trades **with** the multi-TF Donchian bias.
* When it trades **against** it (possible fade setups or no-trade zones).
This script does not generate entry or exit signals by itself. It is a contextual/forecast tool meant to sit on top of your own trading logic.
---
Notes
* Works on most symbols and timeframes; higher-timeframe multiples are built from the chart timeframe.
* The forecast line is a model-based projection, not a prediction or guarantee of future price.
* Always combine this with your own risk management, testing, and judgement. This is for educational and analytical purposes only and is not financial advice.
Buffett Quality Filter (TTM)//@version=6
indicator("Buffett Quality Filter (TTM)", overlay = true, max_labels_count = 500)
// 1. Get financial data (TTM / FY / FQ)
// EPS (TTM) for P/E
eps = request.financial(syminfo.tickerid, "EARNINGS_PER_SHARE_BASIC", "TTM")
// Profitability & moat (annual stats)
roe = request.financial(syminfo.tickerid, "RETURN_ON_EQUITY", "FY")
roic = request.financial(syminfo.tickerid, "RETURN_ON_INVESTED_CAPITAL", "FY")
// Margins (TTM – rolling 12 months)
grossMargin = request.financial(syminfo.tickerid, "GROSS_MARGIN", "TTM")
netMargin = request.financial(syminfo.tickerid, "NET_MARGIN", "TTM")
// Balance sheet safety (quarterly)
deRatio = request.financial(syminfo.tickerid, "DEBT_TO_EQUITY", "FQ")
currentRat = request.financial(syminfo.tickerid, "CURRENT_RATIO", "FQ")
// Growth (1-year change, TTM)
epsGrowth1Y = request.financial(syminfo.tickerid, "EARNINGS_PER_SHARE_BASIC_ONE_YEAR_GROWTH", "TTM")
revGrowth1Y = request.financial(syminfo.tickerid, "REVENUE_ONE_YEAR_GROWTH", "TTM")
// Free cash flow (TTM) and shares to build FCF per share for P/FCF
fcf = request.financial(syminfo.tickerid, "FREE_CASH_FLOW", "TTM")
sharesOut = request.financial(syminfo.tickerid, "TOTAL_SHARES_OUTSTANDING", "FQ")
fcfPerShare = (not na(fcf) and not na(sharesOut) and sharesOut != 0) ? fcf / sharesOut : na
// 2. Valuation ratios from price
pe = (not na(eps) and eps != 0) ? close / eps : na
pFcf = (not na(fcfPerShare) and fcfPerShare > 0) ? close / fcfPerShare : na
// 3. Thresholds (Buffett-style, adjustable)
minROE = input.float(15.0, "Min ROE %")
minROIC = input.float(12.0, "Min ROIC %")
minGM = input.float(30.0, "Min Gross Margin %")
minNM = input.float(8.0, "Min Net Margin %")
maxDE = input.float(0.7, "Max Debt / Equity")
minCurr = input.float(1.3, "Min Current Ratio")
minEPSG = input.float(8.0, "Min EPS Growth 1Y %")
minREVG = input.float(5.0, "Min Revenue Growth 1Y %")
maxPE = input.float(20.0, "Max P/E")
maxPFCF = input.float(20.0, "Max P/FCF")
// 4. Individual conditions
cROE = not na(roe) and roe > minROE
cROIC = not na(roic) and roic > minROIC
cGM = not na(grossMargin) and grossMargin > minGM
cNM = not na(netMargin) and netMargin > minNM
cDE = not na(deRatio) and deRatio < maxDE
cCurr = not na(currentRat) and currentRat > minCurr
cEPSG = not na(epsGrowth1Y) and epsGrowth1Y > minEPSG
cREVG = not na(revGrowth1Y) and revGrowth1Y > minREVG
cPE = not na(pe) and pe < maxPE
cPFCF = not na(pFcf) and pFcf < maxPFCF
// 5. Composite “Buffett Score” (0–10) – keep it on ONE line to avoid line-continuation errors
score = (cROE ? 1 : 0) + (cROIC ? 1 : 0) + (cGM ? 1 : 0) + (cNM ? 1 : 0) + (cDE ? 1 : 0) + (cCurr ? 1 : 0) + (cEPSG ? 1 : 0) + (cREVG ? 1 : 0) + (cPE ? 1 : 0) + (cPFCF ? 1 : 0)
// Strictness
minScoreForPass = input.int(7, "Min score to pass (0–10)", minval = 1, maxval = 10)
passes = score >= minScoreForPass
// 6. Visuals
bgcolor(passes ? color.new(color.green, 80) : na)
plot(score, "Buffett Score (0–10)", color = color.new(color.blue, 0))
// Info label on last bar
var label infoLabel = na
if barstate.islast
if not na(infoLabel)
label.delete(infoLabel)
infoText = str.format(
"Buffett score: {0} ROE: {1,number,#.0}% | ROIC: {2,number,#.0}% GM: {3,number,#.0}% | NM: {4,number,#.0}% P/E: {5,number,#.0} | P/FCF: {6,number,#.0} D/E: {7,number,#.00} | Curr: {8,number,#.00}",
score, roe, roic, grossMargin, netMargin, pe, pFcf, deRatio, currentRat)
infoLabel := label.new(bar_index, high, infoText,
style = label.style_label_right,
color = color.new(color.black, 0),
textcolor = color.white,
size = size.small)
Multi-Factor Trend Confluence Indicator (PTP V4)Disclaimer: This is a technical analysis tool for educational and informational purposes only. It does not constitute investment advice, financial solicitation, or a recommendation to buy or sell any security or instrument. Trading involves significant risk, and past performance is not indicative of future results. Use at your own risk.
KEY Features and Strategic Methodology
This is a comprehensive trend and confluence indicator built on multiple factors to identify potential pullbacks within an established trend.
• Core Trend Filter: Uses a long-term EMA to confirm the overall market bias.
• Fibonacci Pullback Logic: Identifies potential low-risk entry zones by calculating a 61.8% Fibonacci Retracement over a user-defined lookback period.
• Multi-Factor Confluence: A signal is generated only when the price touches the Fib zone AND the following factors align (You can edit the script to adjust the confluence conditions.):
o RSI is above 50.
o Positive DI is above Negative DI (DMI Bullish Crossover).
o Price is above the fast EMA.
• Consecutive Signal Counter: Includes a unique counter that highlights bars where the confluence conditions have been met for a minimum number of consecutive candles (4 by default), aiding in the validation of strong momentum entries.
• Moving Average Visualization: Plots and color-fills 10 WMA, 21 EMA, 42 EMA, and 200 EMA to provide a full market context and visualize momentum shifts.
1. Short-Term Momentum (WMA10 vs. EMA42 Fill)
This fill area highlights immediate price acceleration and momentum shifts:
• Green Fill (Bullish Momentum): WMA10 > EMA42.
• Red Fill (Bearish Momentum): WMA10 < EMA42.
2. Long-Term Market Context (EMA200 vs. EMA42 Fill)
This fill area defines the dominant backdrop of the market, essential for strategic positioning:
• Green Fill (Bullish Context): EMA200 < EMA42.
• Red Fill (Bearish Context): EMA200 > EMA42.
EMA200 Line Coloration
The EMA200 line color itself also provides a visual cue for the long-term context:
• Red Line: When EMA200 > EMA42 (Bearish Context).
• Green Line: When EMA200 < EMA42 (Bullish Context).
Customization
The indicator is highly customizable via the settings menu, allowing users to adjust lengths for EMA, RSI, DMI, Pivot Points, and the specific parameters for the Fibonacci Retracement Strategy (tolerance and candle limits).
F5/F15 Breakout High and Low Mark by MDHi This scirpt will mark Previous day high and low and current day 5 Mint and 15 Mint according to your requirement it will mark and show you the Buy signal according to that
Dynamic `request` demoPublish a new script-This should help people to make better analysis of the market
FPT - DCA ModelFPT - DCA Model is a simple but powerful tool to backtest a weekly “buy the dip” DCA plan with dynamic position sizing and partial profit-taking.
🔹 Core Idea
- Invest a fixed amount every week (on Friday closes)
- Buy more aggressively when price trades at a discount from its 52-week high
- Take partial profits when price stretches too far above the daily EMA50
- Track the performance of your DCA plan vs a simple buy-and-hold from the same start date
⚙ How it works
1. Weekly DCA (on Daily timeframe)
- On each Friday after the Start Date:
- Add the “Weekly contribution” to the cash pool.
- If the close is below the “Discount from 52W high” level:
→ FULL DCA: use the full weekly contribution + an extra booster from your stash (up to “Max extra stash used on dip”).
→ Marked on the chart with a small green triangle under the bar.
- Otherwise:
→ HALF DCA: invest only 50% of the weekly contribution and keep the other 50% as stash (uninvested cash).
→ Marked with a small blue triangle under the bar.
2. 52-Week High Discount Logic
- The script computes the 52-week high as the highest daily high of the last 252 trading days.
- The “discount level” is: 52W high × (1 – Discount%).
- When price is at or below this level, dips are treated as buying opportunities and the model allocates more.
3. Selling Logic (Partial Take Profit)
- When the close is above the daily EMA50 by the selected percentage:
→ Sell the given “Sell portion of qty (%)” of your current holdings.
→ Marked with a small red triangle above the bar.
- This behaves like a gradual profit-taking system: if price stays extended above EMA50, multiple partial sells can occur over time.
📊 Panel (top-right)
The panel summarizes the state of your DCA plan:
- Weeks: number of DCA weeks since Start Date
- Total deposit: total money contributed (sum of all weekly contributions)
- Shares qty: total number of shares accumulated
- Avg price: volume-weighted average entry price
- Shares value: current market value of all shares (qty × close)
- Cash: uninvested cash (including saved stash)
- Total equity: Shares value + Cash
- DCA % PnL: performance of the DCA plan vs total deposits
- Stock % since start: performance of the underlying asset since the Start Date
✅ Recommended Use
- Timeframe: Daily (the DCA engine is designed to run on daily bars and Friday closes).
- Works best on stocks, ETFs or indices where a 52-week high is a meaningful reference.
- You can tune:
- Weekly contribution
- Discount from 52W high
- Booster amount
- EMA50 extension threshold and sell portion
⚠ Notes & Disclaimer
- This script is a backtesting and educational tool. It does not place real orders.
- Past performance does not guarantee future results.
- Always combine DCA and risk management with your own research and judgment.
Built by FPT (Funded Pips Trading) for long-term, rules-based DCA planning.
Fibonacci Projection with Volume & Delta Profile (Zeiierman)█ Overview
Fibonacci Projection with Volume & Delta Profile (Zeiierman) blends classic Fibonacci swing analysis with modern volume-flow reading to create a unified, projection-based market framework. The indicator automatically detects the latest swing high and swing low, builds a complete Fibonacci structure, and then projects future extension targets with clear visual pathways.
What makes this tool unique is the integration of two volume-based systems directly into the Fibonacci structure. A Fib-aligned Volume Profile shows how bullish and bearish volume accumulated inside the swing range, while a separate Delta Profile reveals the imbalance of buy–sell pressure inside each Fibonacci interval. Together, these elements transform the standard Fibonacci tool into a multi-dimensional structural and volume-flow map.
█ How It Works
The indicator first detects the most recent swing high and swing low using the Period setting. That swing defines the Fibonacci range, from which the script draws retracement levels (0.236–0.786) and builds a forward projection path using the chosen Projection Level and a 1.272 extension.
Along this path, it draws projection lines, target boxes, and percentage labels that show how far each projected leg extends relative to the previous one.
Inside the same swing range, the script builds a Fib-based Volume Profile by splitting price into rows and assigning each bar’s volume as bullish (close > open) or bearish (close ≤ open). On top of that, it calculates a Volume Delta Profile between each pair of fib levels, showing whether buyers or sellers dominated that band and how strong that imbalance was.
█ How to Use
This tool helps traders quickly understand market structure and where the price may be heading next. The projection engine shows the most likely future targets, highlights strong or weak legs in the move, and updates automatically whenever a new swing forms. This ensures you always see the most relevant and up-to-date projection path.
The Fib Volume Profile shows where volume supported the move and where it did not. Thick bullish buckets reveal zones where buyers stepped in aggressively, often becoming retestable support. Thick bearish buckets highlight zones of resistance or rejection, particularly useful if projected levels align with prior liquidity.
The Delta Profile adds a second dimension to volume reading by showing where buy–sell pressure was truly imbalanced. A projected Fibonacci target that aligns with a strong bullish delta, for example, may suggest continuation. A projection into a band dominated by bearish delta may warn of reversal or hesitation.
█ Settings
Period – bars used to determine swing high/low
Projection Level – chosen Fib ratio for projection path
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
bebekoh oscillator this oscillator is only to be used for confluences. do not use this oscillator alone as it is not reliable for some time.
Sugarol Strategythis strategy is only use for friends indicator purposes. it is not recommended to use for trading as it has a small winning percentage
sugarol sa goldthis indicator is only for those who have itchy hands who cannot wait for the zone. so, if you see the buy or sell indicator just press the buy and sell button and wait for your luck.
Bappa - Dynamic VWAP Simple Vwap, just dynamic colour Coding added to sense whether VWAP is in uptrend or downtrend. Refer to colour code to enter Call side or Put side, it never disappoints you at any timeframe. Enjoy & happy Trading!!
Better results if used in conjuction with Pivots/ fractals indicator, named as Bappa EMA + BBW (V2) indicator.






















