Higher Timeframe MA High Low BandsHigher Timeframe Customer MA High Low Bands. There are 3 different Moving Average Parameters Available. Indicator will plot 3 lines of MA Length With Source of High, Close and Low. User can change relevant MA parameters / Show or Hide MA.
Happy Trading
Wskaźniki i strategie
Relative Volume EMA (RVOL)Relative Volume EMA (RVOL) measures the current bar’s volume relative to its typical volume over a selected lookback period.
It helps traders identify whether a price move is supported by real participation or if it’s occurring on weak, low-quality volume.
This version uses:
RVOL = Current Volume ÷ Volume EMA
Volume EMA Length: adjustable
Signal Threshold: a customizable horizontal line (default = 1.2)
How to Use
1. RVOL > 1.2 → High-Quality Momentum
A value above 1.2 indicates that the current bar has at least 20% more volume than normal, suggesting:
Strong conviction
Algorithmic activity
Momentum-backed breakout or breakdown
Higher probability trend continuation
These bars are ideal for confirming entries after a technical setup (e.g., pullback, engulfing pattern, Ichimoku trend confirmation, etc.).
2. RVOL < 1.0 → Weak or Low-Quality Move
When RVOL is below 1.0:
Volume is below average
Moves are more likely to fail or reverse
Breakouts are unreliable
Triggers lack institutional participation
These bars are best avoided for trade entries.
Why This Indicator Is Useful
In many strategies, price alone is not enough.
RVOL acts as a filter to ensure that your signals occur during times when the market is actually active and committed.
Typical use cases:
Confirm trend-following entries
Validate pullbacks and breakout candles
Filter out low-volume chop
Identify session-based volume surges
Improve risk-to-reward quality by entering only during true momentum
Recommended Settings
EMA Length: 20
Threshold Line: 1.2
Works well on Forex, Crypto, and Indices
Best used on 15m, 30m, 1H, and 4H charts
Moving Average Exponential 21 & 55 CloudTake the trade after price goes into the cloud and comes back.
️Omega RatioThe Omega Ratio is a risk-return performance measure of an investment asset, portfolio, or strategy. It is defined as the probability-weighted ratio, of gains versus losses for some threshold return target. The ratio is an alternative for the widely used Sharpe ratio and is based on information the Sharpe ratio discards.
█ OVERVIEW
As we have mentioned many times, stock market returns are usually not normally distributed. Therefore the models that assume a normal distribution of returns may provide us with misleading information. The Omega Ratio improves upon the common normality assumption among other risk-return ratios by taking into account the distribution as a whole.
█ CONCEPTS
Two distributions with the same mean and variance, would according to the most commonly used Sharpe Ratio suggest that the underlying assets of the distribution offer the same risk-return ratio. But as we have mentioned in our Moments indicator, variance and standard deviation are not a sufficient measure of risk in the stock market since other shape features of a distribution like skewness and excess kurtosis come into play. Omega Ratio tackles this problem by employing all four Moments of the distribution and therefore taking into account the differences in the shape features of the distributions. Another important feature of the Omega Ratio is that it does not require any estimation but is rather calculated directly from the observed data. This gives it an advantage over standard statistical estimators that require estimation of parameters and are therefore sampling uncertainty in its calculations.
█ WAYS TO USE THIS INDICATOR
Omega calculates a probability-adjusted ratio of gains to losses, relative to the Minimum Acceptable Return (MAR). This means that at a given MAR using the simple rule of preferring more to less, an asset with a higher value of Omega is preferable to one with a lower value. The indicator displays the values of Omega at increasing levels of MARs and creating the so-called Omega Curve. Knowing this one can compare Omega Curves of different assets and decide which is preferable given the MAR of your strategy. The indicator plots two Omega Curves. One for the on chart symbol and another for the off chart symbol that u can use for comparison.
When comparing curves of different assets make sure their trading days are the same in order to ensure the same period for the Omega calculations. Value interpretation: Omega<1 will indicate that the risk outweighs the reward and therefore there are more excess negative returns than positive. Omega>1 will indicate that the reward outweighs the risk and that there are more excess positive returns than negative. Omega=1 will indicate that the minimum acceptable return equals the mean return of an asset. And that the probability of gain is equal to the probability of loss.
█ FEATURES
• "Low-Risk security" lets you select the security that you want to use as a benchmark for Omega calculations.
• "Omega Period" is the size of the sample that is used for the calculations.
• “Increments” is the number of Minimal Acceptable Return levels the calculation is carried on. • “Other Symbol” lets you select the source of the second curve.
• “Color Settings” you can set the color for each curve.
EMA Crossover + Angle + Candle Pattern + Breakout (Clean) finalmayank raj 9 15 ema strategy which will give me 1 crore
Historical Volatility EstimatorsHistorical volatility is a statistical measure of the dispersion of returns for a given security or market index over a given period. This indicator provides different historical volatility model estimators with percentile gradient coloring and volatility stats panel.
█ OVERVIEW There are multiple ways to estimate historical volatility. Other than the traditional close-to-close estimator. This indicator provides different range-based volatility estimators that take high low open into account for volatility calculation and volatility estimators that use other statistics measurements instead of standard deviation. The gradient coloring and stats panel provides an overview of how high or low the current volatility is compared to its historical values.
█ CONCEPTS We have mentioned the concepts of historical volatility in our previous indicators, Historical Volatility, Historical Volatility Rank, and Historical Volatility Percentile. You can check the definition of these scripts. The basic calculation is just the sample standard deviation of log return scaled with the square root of time. The main focus of this script is the difference between volatility models.
Close-to-Close HV Estimator: Close-to-Close is the traditional historical volatility calculation. It uses sample standard deviation. Note: the TradingView build in historical volatility value is a bit off because it uses population standard deviation instead of sample deviation. N – 1 should be used here to get rid of the sampling bias.
Pros:
• Close-to-Close HV estimators are the most commonly used estimators in finance. The calculation is straightforward and easy to understand. When people reference historical volatility, most of the time they are talking about the close to close estimator.
Cons:
• The Close-to-close estimator only calculates volatility based on the closing price. It does not take account into intraday volatility drift such as high, low. It also does not take account into the jump when open and close prices are not the same.
• Close-to-Close weights past volatility equally during the lookback period, while there are other ways to weight the historical data.
• Close-to-Close is calculated based on standard deviation so it is vulnerable to returns that are not normally distributed and have fat tails. Mean and Median absolute deviation makes the historical volatility more stable with extreme values.
Parkinson Hv Estimator:
• Parkinson was one of the first to come up with improvements to historical volatility calculation. • Parkinson suggests using the High and Low of each bar can represent volatility better as it takes into account intraday volatility. So Parkinson HV is also known as Parkinson High Low HV. • It is about 5.2 times more efficient than Close-to-Close estimator. But it does not take account into jumps and drift. Therefore, it underestimates volatility. Note: By Dividing the Parkinson Volatility by Close-to-Close volatility you can get a similar result to Variance Ratio Test. It is called the Parkinson number. It can be used to test if the market follows a random walk. (It is mentioned in Nassim Taleb's Dynamic Hedging book but it seems like he made a mistake and wrote the ratio wrongly.)
Garman-Klass Estimator:
• Garman Klass expanded on Parkinson’s Estimator. Instead of Parkinson’s estimator using high and low, Garman Klass’s method uses open, close, high, and low to find the minimum variance method.
• The estimator is about 7.4 more efficient than the traditional estimator. But like Parkinson HV, it ignores jumps and drifts. Therefore, it underestimates volatility.
Rogers-Satchell Estimator:
• Rogers and Satchell found some drawbacks in Garman-Klass’s estimator. The Garman-Klass assumes price as Brownian motion with zero drift.
• The Rogers Satchell Estimator calculates based on open, close, high, and low. And it can also handle drift in the financial series.
• Rogers-Satchell HV is more efficient than Garman-Klass HV when there’s drift in the data. However, it is a little bit less efficient when drift is zero. The estimator doesn’t handle jumps, therefore it still underestimates volatility.
Garman-Klass Yang-Zhang extension:
• Yang Zhang expanded Garman Klass HV so that it can handle jumps. However, unlike the Rogers-Satchell estimator, this estimator cannot handle drift. It is about 8 times more efficient than the traditional estimator.
• The Garman-Klass Yang-Zhang extension HV has the same value as Garman-Klass when there’s no gap in the data such as in cryptocurrencies.
Yang-Zhang Estimator:
• The Yang Zhang Estimator combines Garman-Klass and Rogers-Satchell Estimator so that it is based on Open, close, high, and low and it can also handle non-zero drift. It also expands the calculation so that the estimator can also handle overnight jumps in the data.
• This estimator is the most powerful estimator among the range-based estimators. It has the minimum variance error among them, and it is 14 times more efficient than the close-to-close estimator. When the overnight and daily volatility are correlated, it might underestimate volatility a little.
• 1.34 is the optimal value for alpha according to their paper. The alpha constant in the calculation can be adjusted in the settings. Note: There are already some volatility estimators coded on TradingView. Some of them are right, some of them are wrong. But for Yang Zhang Estimator I have not seen a correct version on TV.
EWMA Estimator:
• EWMA stands for Exponentially Weighted Moving Average. The Close-to-Close and all other estimators here are all equally weighted.
• EWMA weighs more recent volatility more and older volatility less. The benefit of this is that volatility is usually autocorrelated. The autocorrelation has close to exponential decay as you can see using an Autocorrelation Function indicator on absolute or squared returns. The autocorrelation causes volatility clustering which values the recent volatility more. Therefore, exponentially weighted volatility can suit the property of volatility well.
• RiskMetrics uses 0.94 for lambda which equals 30 lookback period. In this indicator Lambda is coded to adjust with the lookback. It's also easy for EWMA to forecast one period volatility ahead.
• However, EWMA volatility is not often used because there are better options to weight volatility such as ARCH and GARCH.
Adjusted Mean Absolute Deviation Estimator:
• This estimator does not use standard deviation to calculate volatility. It uses the distance log return is from its moving average as volatility.
• It’s a simple way to calculate volatility and it’s effective. The difference is the estimator does not have to square the log returns to get the volatility. The paper suggests this estimator has more predictive power.
• The mean absolute deviation here is adjusted to get rid of the bias. It scales the value so that it can be comparable to the other historical volatility estimators.
• In Nassim Taleb’s paper, he mentions people sometimes confuse MAD with standard deviation for volatility measurements. And he suggests people use mean absolute deviation instead of standard deviation when we talk about volatility.
Adjusted Median Absolute Deviation Estimator:
• This is another estimator that does not use standard deviation to measure volatility.
• Using the median gives a more robust estimator when there are extreme values in the returns. It works better in fat-tailed distribution.
• The median absolute deviation is adjusted by maximum likelihood estimation so that its value is scaled to be comparable to other volatility estimators.
█ FEATURES
• You can select the volatility estimator models in the Volatility Model input
• Historical Volatility is annualized. You can type in the numbers of trading days in a year in the Annual input based on the asset you are trading.
• Alpha is used to adjust the Yang Zhang volatility estimator value.
• Percentile Length is used to Adjust Percentile coloring lookbacks.
• The gradient coloring will be based on the percentile value (0- 100). The higher the percentile value, the warmer the color will be, which indicates high volatility. The lower the percentile value, the colder the color will be, which indicates low volatility.
• When percentile coloring is off, it won’t show the gradient color.
• You can also use invert color to make the high volatility a cold color and a low volatility high color. Volatility has some mean reversion properties. Therefore when volatility is very low, and color is close to aqua, you would expect it to expand soon. When volatility is very high, and close to red, you would it expect it to contract and cool down.
• When the background signal is on, it gives a signal when HVP is very low. Warning there might be a volatility expansion soon.
• You can choose the plot style, such as lines, columns, areas in the plotstyle input.
• When the show information panel is on, a small panel will display on the right.
• The information panel displays the historical volatility model name, the 50th percentile of HV, and HV percentile. 50 the percentile of HV also means the median of HV. You can compare the value with the current HV value to see how much it is above or below so that you can get an idea of how high or low HV is. HV Percentile value is from 0 to 100. It tells us the percentage of periods over the entire lookback that historical volatility traded below the current level. Higher HVP, higher HV compared to its historical data. The gradient color is also based on this value.
█ HOW TO USE If you haven’t used the hvp indicator, we suggest you use the HVP indicator first. This indicator is more like historical volatility with HVP coloring. So it displays HVP values in the color and panel, but it’s not range bound like the HVP and it displays HV values. The user can have a quick understanding of how high or low the current volatility is compared to its historical value based on the gradient color. They can also time the market better based on volatility mean reversion. High volatility means volatility contracts soon (Move about to End, Market will cooldown), low volatility means volatility expansion soon (Market About to Move).
█ FINAL THOUGHTS HV vs ATR The above volatility estimator concepts are a display of history in the quantitative finance realm of the research of historical volatility estimations. It's a timeline of range based from the Parkinson Volatility to Yang Zhang volatility. We hope these descriptions make more people know that even though ATR is the most popular volatility indicator in technical analysis, it's not the best estimator. Almost no one in quant finance uses ATR to measure volatility (otherwise these papers will be based on how to improve ATR measurements instead of HV). As you can see, there are much more advanced volatility estimators that also take account into open, close, high, and low. HV values are based on log returns with some calculation adjustment. It can also be scaled in terms of price just like ATR. And for profit-taking ranges, ATR is not based on probabilities. Historical volatility can be used in a probability distribution function to calculated the probability of the ranges such as the Expected Move indicator. Other Estimators There are also other more advanced historical volatility estimators. There are high frequency sampled HV that uses intraday data to calculate volatility. We will publish the high frequency volatility estimator in the future. There's also ARCH and GARCH models that takes volatility clustering into account. GARCH models require maximum likelihood estimation which needs a solver to find the best weights for each component. This is currently not possible on TV due to large computational power requirements. All the other indicators claims to be GARCH are all wrong.
Zonas de Liquidez Pro + Puntos de GiroRequirements for marking 💧:✅ High crosses the zone✅ Close returns inside (false breakout / fakeout)✅ Volume is 20% greater than the average✅ Occurs within the last 10 bars(Note: This last requirement is stated in the text but not explicitly in the code snippet provided)📚 Psychology Behind the SweepWho lost money?Traders with stops placed too tightlyBuyers who entered "on the breakout"Bots with automatic orders placed aboveWho made money?Smart Money / InstitutionsThey sold at a high priceThey hunted for liquidity before moving the priceThey know where retail stops are located🎯 How to Use the Drops in Your TradingGolden Rule:💧 near a strong zone + Multiple rejections = PROBABLE REVERSALStrategy:See 💧 at resistance → Look for SHORTSee 💧 at support → Look for LONGPrice returns to the swept zone → High-probability setupStop beyond the sweep high/low → ProtectionPractical Example:If you see 💧 LIQ at $111,263 (resistance)→ Wait for bearish rejection→ Entry: Sell at $110,800→ Stop: $111,500 (above the sweep high)→ Target: Next support level⚠️ Common Mistakes❌ Mistake 1: Trading the breakoutPrice breaks $111k → "It's going to the moon!" → Buy💧 LIQ appears → It was a trap → Drop → Loss✅ Correct Approach:Price breaks $111k → Check if there is 💧 LIQ💧 appears → "It's a trap" → Wait for rejection → Sell❌ Mistake 2: Ignoring the volumeNot all sweeps are equal.Sweeps with high volume are more reliable.No volume = it could be noise.🎓 Ultra-Fast SummaryElementMeaning💧 LIQLiquidity sweep detectedAt ResistanceBullish trap → Prepare for a shortAt SupportBearish trap → Prepare for a longWith High VolumeMore reliable signalNear Strong Zone High probability of reversal🔥 The Magic of Your IndicatorScenarioWithout this IndicatorWith this IndicatorAction"The price broke $111k, I'm buying!""There is 💧 LIQ + zone + rejections → It's a trap."ResultYou loseYou avoid a loss or gain on the short
NQUSB Sector Industry Stocks Strength
A Comprehensive Multi-Industry Performance Comparison Tool
The complete Pine Script code and supporting Python automation scripts are available on GitHub:
GitHub Repository: github.com
Original idea from by www.tradingview.com
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ WHAT'S NEW ═══
4-Level Hierarchical Navigation:
Primary: All 11 NQUSB sectors (NQUSB10, NQUSB15, NQUSB20, etc.)
Secondary (Default): Broad sectors like Technology, Energy
Tertiary: Industry groups within sectors
Quaternary: Individual stocks within industries (37 semiconductors)
Enhanced Stock Coverage:
1,176 total stocks across 129 industries
37 semiconductor stocks
Market-cap weighted selection: 60% tech / 35% others
Range: 1-37 stocks per industry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ CORE FEATURES ═══
1. Drill-Down/Drill-Up Navigation
View NVDA at different granularity levels:
Quaternary: ● NVDA ranks #3 of 37 semiconductors
Tertiary: ✓ Semiconductors at 85% (strongest in tech hardware)
Secondary: ✓ Tech Hardware at 82% (stronger than software)
Primary: ✓ Technology at 78% (#1 sector overall)
Insight: One indicator, one stock, four perspectives - instantly see if strength is stock-specific, industry-specific, or sector-wide.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2. Visual Current Stock Identification
Violet Markers - Instant Recognition:
● (dot) marker when current stock is in top N performers
✕ (cross) marker when current stock is below top N
Violet color (#9C27B0) on both symbol and value labels
Example: "NVDA ● ranks #3 of 37"
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3. Rank Display in Title
Dynamic title shows performance context:
"Semiconductors (RS Rating - 3 Months) | NVDA ranks #3 of 37"
#1 = Best performer, higher number = lower rank
Total adjusts if current stock auto-added
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
4. Auto-Add Current Stock
Always Included:
Current stock automatically added if not in predefined list
Example: Viewing PRSO → "PRSO ranks #37 of 39 ✕"
Works for any stock - from NVDA to obscure small-caps
Violet markers ensure visibility even when ranked low
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ DUAL PERFORMANCE METRICS ═══
RS Rating (Relative Strength):
Normalized strength score 1-99
Compare stocks across different price ranges
Default benchmark: SPX
% Return:
Simple percentage price change
Direct performance comparison
11 Time Periods:
1 Week, 2 Weeks, 1 Month, 2 Months, 3 Months (Default) , 6 Months, 1 Year, YTD, MTD, QTD, Custom (1-500 days)
Result: 22 analytical combinations (2 metrics × 11 periods)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ USE CASES ═══
Sector Rotation Analysis:
Is NVDA's strength semiconductors-specific or tech-wide?
Drill through all 4 levels to find answer
Identify which industry groups are leading/lagging
Finding Hidden Gems:
JPM ranks #3 of 13 in Major Banks
But Financials sector weak overall (68%)
= Relative strength play in weak sector
Cross-Industry Comparison:
129 industries covered
Market-wide scan capability
Find strongest performers across all sectors
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ TECHNICAL SPECIFICATIONS ═══
V32 Stats:
Total Industries: 129
Total Stocks: 1,176
File Size: 82,032 bytes (80.1 KB)
Request Limit: 39 max (Semiconductors), 10-16 typical
Granularity Levels: 4 (Primary → Quaternary)
Smart Stock Allocation:
Technology industries: 60% coverage
Other industries: 35% coverage
Market-cap weighted selection
Formula: MIN(39, MAX(5, CEILING(total × percentage)))
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
═══ KEY ADVANTAGES ═══
vs. Single Industry Tools:
✓ 129 industries vs 1
✓ Market-wide perspective
✓ Hierarchical navigation
✓ Sector rotation detection
vs. Manual Comparison:
✓ No ETF research needed
✓ Instant visual markers
✓ Automatic ranking
✓ One-click drill-down
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For complete documentation, Python automation scripts, and CSV data files:
github.com
Version: V32
Last Updated: 2025-11-30
Pine Script Version: v5
@Unwind Pressure Detector - AUDITED v3.0SQUEEZE → UNWIND PRESSURE DETECTOR v3.0
The first indicator that not only finds oversold squeezes… but tells you exactly when the move is exhausting and it’s time to take profits.
Fully audited, clean Pine Script v6, zero repainting, zero lag tricks.
WHAT IT DOES
• Detects high-probability squeeze setups (RSI + Volume + VIX + Trend confluence)
• Scores pressure from 0–115 with dynamic sensitivity (Low to Extreme)
• Identifies CRITICAL zones where explosive moves are most likely
• Most importantly → flags the UNWIND when trapped shorts are finally covering and the rally is running out of fuel (perfect profit-taking signal)
FEATURES
• Real-time pressure dashboard (top-right)
• Color-coded background zones (Critical = red, High = orange)
• Smart anti-spam labels with ATR offset
• Three alert conditions:
→ Squeeze Setup
→ Critical Squeeze
→ Unwind / Take Profit
• Works on all markets & timeframes (stocks, forex, crypto, futures)
WHY THIS VERSION IS DIFFERENT
- v3.0 completely rewrote the unwind logic (now requires rally + sharp pressure drop)
- No false unwinds during strong trends
- Built for real trading, not just pretty screenshots
100% Open Source • Fully commented • Free to modify & rep, I want this in the public library forever.
Created with love for the TradingView community
Drop a ♥ and follow if you find it useful!
#squeeze #ttmsqueeze #unwind #volatility #vix #takeprofits #smartmoney
Psychological levels [Kodologic] Psychological levels
Markets are not random, they are driven by human psychology and algorithmic order flow. A well-known phenomenon in trading is the "Whole Number Bias" — the tendency for price to react significantly at clean, round numbers (e.g., Bitcoin at $95,000 or EURUSD at 1.0500).
Manually drawing horizontal lines at every round number is tedious, clutters your object tree, and distracts you from analyzing price action.
Psychological levels Numbers is a workflow utility designed to solve this problem. It automatically projects a clean, customizable grid of key price levels onto your chart, helping you instantly identify areas where liquidity and orders are likely to cluster.
Why This Indicator Helps Traders :
Professional traders know that "00" and "50" levels act as magnets for price. Here is how this tool assists in your analysis:
1. Institutional Footprints : Large institutions and bank algorithms often execute orders at whole numbers to simplify accounting. This script highlights these potential liquidity zones automatically.
2. Support & Resistance Discovery: You will often notice price wicking or reversing exactly on these grid lines. This helps in spotting natural support and resistance without needing complex technical analysis.
3. Cognitive Load Reduction: Instead of calculating where the next "major level" is, the grid is visually present, allowing you to focus on candlestick patterns and market structure.
Features :
Dynamic Calculation : The grid updates automatically as price moves, you never have to redraw lines.
Zero Clutter : The lines are drawn using code, meaning they do not appear in your manual drawing tools list or clutter your object tree.
Fully Customizable Step : You define what constitutes a "Round Number" for your specific asset class (Forex, Crypto, Indices, or Stocks).
Visual Control : Adjust line styles (Solid, Dotted, Dashed), colors, and transparency to keep your chart aesthetic and readable.
How to Use in Your Strategy :
1. Target Setting (Take Profit)
If you are in a long position, use the next upper grid line as a logical Take Profit area. Price often gravitates toward these whole numbers before reversing or consolidating.
2. Stop Loss Placement
Avoid placing Stop Losses exactly on a round number, as these are often "stop hunted." Instead, use the grid to visualize the level and place your stop slightly *below* or *above* the round number for better protection.
3. Confluence Trading
Do not use these lines in isolation. Look for Confluence :
Example: If a Fibonacci 61.8% level lines up exactly with a Round Number grid line, that level becomes a high-probability reversal zone.
Settings Guide (Important)
Since every asset is priced differently, you must adjust the "levels Step Size" to match your instrument:
Forex (e.g., EURUSD, GBPUSD): Set Step Size to `0.0050` (50 pips) or `0.0100` (100 pips).
Crypto (e.g., BTCUSD): Set Step Size to `500` or `1000`.
Indices (e.g., US30, SPX500): Set Step Size to `100` or `500`.
Gold (XAUUSD):** Set Step Size to `10`.
Disclaimer: This tool is for educational and visual aid purposes only. It does not provide buy or sell signals. Always manage your risk.
@Complete Squeeze Cycle Detector v2.0 FINALDescription:
The Complete Squeeze Cycle Detector identifies and tracks the full lifecycle of squeeze formations, from pre-squeeze consolidation through active squeeze periods to squeeze completion. The indicator systematically detects the characteristic conditions that precede and accompany squeeze events.
The indicator monitors multiple factors associated with squeeze development including:
• Volatility compression relative to recent volume activity
• Elevated market stress conditions as measured by VIX levels
• Momentum compression through rate of change measurements across multiple time periods
• Alignment of multiple exponential moving averages indicating consolidation
The squeeze cycle is classified into three distinct phases: Pre-Squeeze Setup, Active Squeeze, and Squeeze Complete. Each phase is identified based on threshold levels of multiple compression metrics, with adjustable sensitivity settings to control the strictness of detection.
The indicator provides visual identification of each phase through labels, background coloring, and an optional dashboard, allowing users to distinguish between the preparation phase where volatility contracts, the active squeeze phase where compression reaches critical levels, and the completion phase where the squeeze releases and directional movement resumes.
This systematic approach enables users to identify squeeze formations throughout their complete development cycle rather than focusing only on the breakout phase.
Mebane Faber GTAA 5In 2007, Mebane Faber published research that challenged the conventional wisdom of buy-and-hold investing. His paper, titled "A Quantitative Approach to Tactical Asset Allocation" and published in the Journal of Wealth Management, demonstrated that a simple timing mechanism could reduce portfolio volatility and drawdowns while maintaining competitive returns (Faber, 2007). This indicator implements his Global Tactical Asset Allocation strategy, known as GTAA5, following the original methodology.
The core insight of Faber's research stems from a century of market data. By analyzing asset class performance from 1901 onwards, Faber found that a ten-month simple moving average served as an effective trend filter across major asset classes. When an asset trades above its ten-month moving average, it tends to continue its upward trajectory; when it falls below, significant drawdowns often follow (Faber, 2007, pp. 12-16). This observation aligns with momentum research by Jegadeesh and Titman (1993), who documented that intermediate-term momentum persists across equity markets.
The GTAA5 strategy allocates capital equally across five diversified asset classes: domestic equities (SPY), international developed markets (EFA), aggregate bonds (AGG), commodities (DBC), and real estate investment trusts (VNQ). Each asset receives a twenty percent allocation when trading above its ten-month moving average. When an asset falls below this threshold, its allocation moves to short-term treasury bills (SHY), creating a dynamic cash position that scales with market risk (Cambria Investment Management, 2013).
The strategy's historical performance during market crises illustrates its function. During the 2008 financial crisis, traditional sixty-forty portfolios experienced drawdowns exceeding forty percent. The GTAA5 strategy limited losses to approximately twelve percent by reducing equity exposure as prices declined below their moving averages (Faber, 2013). This asymmetric return profile represents the strategy's primary characteristic.
This implementation uses monthly closing prices retrieved via request.security() to calculate the ten-month simple moving average. This distinction matters, as approximations using daily data (such as a 200-day moving average) can generate different signals during volatile periods. Monthly data ensures the indicator produces signals consistent with published academic research.
The indicator provides position monitoring, automatic rebalancing detection on either the first or last trading day of each month, and share calculations based on user-defined capital. A dashboard displays current trend status for each asset class, target versus actual weightings, and trade instructions for rebalancing. Performance metrics including annualized volatility and Sharpe ratio provide ongoing risk assessment.
Several limitations warrant acknowledgment. First, the strategy rebalances monthly, meaning it cannot respond to intra-month market crashes. Second, transaction costs and taxes from monthly rebalancing may reduce net returns for taxable accounts. Third, the ten-month lookback period, while historically robust, offers no guarantee of future effectiveness. As Ilmanen (2011) notes in "Expected Returns", all timing strategies face the risk of regime change, where historical relationships break down.
This indicator serves educational purposes and portfolio monitoring. It does not constitute financial advice.
References:
Cambria Investment Management (2013). Global Tactical Asset Allocation: An Introduction to the Approach. Research Report, Los Angeles.
Faber, M.T. (2007). A Quantitative Approach to Tactical Asset Allocation. Journal of Wealth Management, Spring 2007, pp. 9-79.
Faber, M.T. (2013). Global Asset Allocation: A Survey of the World's Top Asset Allocation Strategies. Cambria Investment Management, Los Angeles.
Ilmanen, A. (2011). Expected Returns: An Investor's Guide to Harvesting Market Rewards. John Wiley and Sons, Chichester.
Jegadeesh, N. and Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. Journal of Finance, 48(1), pp. 65-91.
Ehlers Dominant Cycle Stochastic RSIEhlers Enhanced Cycle Stochastic RSI
OVERVIEW
The Ehlers Enhanced Cycle Stochastic RSI is a momentum oscillator that automatically adjusts its lookback periods based on the dominant market cycle. Unlike traditional Stochastic RSI which uses fixed periods, this indicator detects the current cycle length and scales its calculations—making it responsive in fast markets and stable in slow ones.
The indicator combines John Ehlers' digital signal processing research with the classic Stochastic RSI indicator, then adds a confirmation system to ensure cycle measurements are reliable.
THE THEORY
Traditional oscillators use fixed lookback periods (ie, 14-bar RSI). This creates a fundamental problem: markets don't move in fixed cycles. A 14-period RSI might capture the rhythm perfectly during one market phase, then completely miss it when conditions change.
Ehlers' research demonstrated that price data contains measurable cyclical components. If you can detect the dominant cycle length, you can tune your indicators to match it—like tuning a radio to the right frequency.
This indicator takes that concept further by using three independent cycle detection methods and only trusting the measurement when they agree:
Hilbert Transform — A mathematical technique from signal processing that extracts cycle period from the phase relationship between price and its derivative. It is fast but can be noisy.
Autocorrelation Periodogram — Measures how similar the price series is to lagged versions of itself. The lag with highest correlation reveals the dominant cycle. More stable than Hilbert, but slightly slower to adapt.
Goertzel Algorithm (DFT) — A frequency-domain approach that calculates spectral power at each candidate period. Identifies which frequencies contain the most energy.
When all three methods converge on similar period estimates, confidence is high. When they disagree, the market may be in a non-cyclical or in transition.
HOW IT CHANGES THE STOCHASTIC RSI
Standard Stochastic RSI:
1. Calculate RSI with fixed period (14 bars)
2. Apply Stochastic formula over fixed period (14 bars)
3. Smooth with fixed periods
Ehlers Enhanced Cycle Stochastic RSI:
1. Detect dominant cycle using three methods
2. Confirm cycle measurement (methods must agree)
3. Calculate RSI with period scaled to the detected cycle
4. Apply Stochastic formula with cycle-scaled lookback
5. Smooth adaptively
The result: when the market is cycling quickly (say, 15-bar cycles), the indicator uses shorter periods and responds faster. When the market stretches into longer cycles (such as 40-bar cycles), it automatically extends its lookback to avoid whipsaws.
The Period Multipliers let you fine-tune this relationship:
• 1.0 = Use the full detected cycle (smoother, fewer signals)
• 0.5 = Use half the cycle (more responsive, catches turns earlier)
INTERPRETATION
Reading the Oscillator:
• K Line (Blue) — The main signal line. Moves between 0 and 100.
• D Line (Orange) — Smoothed version of K. Use for confirmation.
• Above 80 — Overbought. Momentum stretched to upside.
• Below 20 — Oversold. Momentum stretched to downside.
• Crossovers — K crossing above D suggests bullish momentum shift; K crossing below D suggests bearish.
Spectral Dilation (optional):
When enabled, applies a bandpass filter before cycle detection. This isolates the frequency band of interest and reduces noise. Useful for:
• Very noisy instruments
• Lower timeframes
• When confidence stays persistently low
4H EMA 21/30 Cloud on 15mThis indicator displays the 4-hour EMA 21 and EMA 30 as a dynamic cloud directly on the 15-minute chart, providing a clean and reliable higher-timeframe trend filter for intraday and scalping setups.
The cloud turns:
Green when EMA21 > EMA30 → bullish HTF trend
Red when EMA21 < EMA30 → bearish HTF trend
Because the 4H EMA 21/30 combination tracks mid-term momentum and trend structure extremely well, this indicator helps traders avoid counter-trend trades, time pullbacks more effectively, and align entries with dominant higher-timeframe flow.
Perfect for traders using:
Price Action
FVG / Imbalance concepts
CHOCH/BOS structure
Liquidity-based models
ICT-style intraday execution
Use the 4H cloud as your HTF bias anchor, and execute trades using your own entry model on the 15m timeframe.
Kvng solzfx Gold StrategyThis indicator helps to find gold setups using kvng solz fx buy only strategy on gold
Gap-Up Momentum Screener (S.S)
ENGLISH-VERSION
1) TradingView Gap Screener (for US stocks)
➤ Conditions
Gap-Up ≥ +3% (large gaps indicate institutional pressure)
Pre-market volume ≥ 150% of the 20-day average
RS line > 50
Price > 50 SMA
Market cap ≥ 1 billion USD
No penny stocks
2) Minervini Gap-Entry Strategy (Swing Trading)
This is a variant specifically optimized for gaps + momentum.
A) Setup Criteria
The stock must meet the following conditions:
Gap-Up ≥ +3%
First retracement ≤ 30% of the gap
High relative strength (RS line rising)
Volume on the gap day > 2× average
Price above 20 EMA, 50 SMA, 150 SMA, 200 SMA
No immediate resistance within 2–5%
B) Entry Setups
Entry 1: First Pullback Entry (FPE)
Wait for the first 1–3 day consolidation.
Entry → Breakout of the small range.
Stop → Below the low of the pullback.
Rule: No entry on the gap day itself.
Entry 2: High Tight Flag above the Gap
Stock rises > 10% after the gap
Then forms a 3–8 day sideways phase
Entry → Break above the flag’s high
Stop → Below the flag base
Entry 3: ORB Entry (Opening Range Breakout, 30 minutes)
Very effective for strong gaps.
Wait 30 minutes after the market opens
Entry → Break above the high of these first 30 minutes
Stop → Below the 30-minute low
C) Stop Levels
For FPE: 4–8%
For ORB: 1–2 × ATR(14)
For flags: 3–5%
D) Add Rules
Only if the stock continues showing strong volume:
Add on every new 3–5 day high
Add only above half-range levels
Maximum 3 adds
3) Early-Warning Module (Setup forming but not ready for entry)
This module marks stocks that are forming a setup but are not yet buyable.
➤ Criteria
Gap-Up ≥ 3%
Strong volume
Stock pulls back and consolidates (1–5 bars)
BUT no breakout yet
4) Exact Entry Checklist (Minervini-style, optimized for gaps)
Checklist before entry:
Gap ≥ +3%
20 EMA rising
Volume > 2× average
RS line rising
Price > 50 SMA
Pullback not deeper than 30% of the gap
3+ green signals from the Early-Warning diamonds
If all 7 are fulfilled → green light.
5) How to apply the strategy in daily practice
Morning (08:00–09:00)
Check the screener
Build your watchlist
Identify gaps
US Market Open (15:30)
Monitor the Early-Warning module
Sort gap momentum opportunities
16:00–17:00
Enter: First Pullback / ORB / Flag
Set stops
Determine position size based on risk
After 20:00
Check volume strength
If momentum fades → no more adds
Key Levels: PDH/L, PMH/L, Oopening RangeBasic scrip that shows Previous Day High and Low, and also Pre-Market High Lows, and also the Opening Range. Everything is adjustable.
RSI Forecast Colorful [DiFlip]RSI Forecast Colorful
Introducing one of the most complete RSI indicators available — a highly customizable analytical tool that integrates advanced prediction capabilities. RSI Forecast Colorful is an evolution of the classic RSI, designed to anticipate potential future RSI movements using linear regression. Instead of simply reacting to historical data, this indicator provides a statistical projection of the RSI’s future behavior, offering a forward-looking view of market conditions.
⯁ Real-Time RSI Forecasting
For the first time, a public RSI indicator integrates linear regression (least squares method) to forecast the RSI’s future behavior. This innovative approach allows traders to anticipate market movements based on historical trends. By applying Linear Regression to the RSI, the indicator displays a projected trendline n periods ahead, helping traders make more informed buy or sell decisions.
⯁ Highly Customizable
The indicator is fully adaptable to any trading style. Dozens of parameters can be optimized to match your system. All 28 long and short entry conditions are selectable and configurable, allowing the construction of quantitative, statistical, and automated trading models. Full control over signals ensures precise alignment with your strategy.
⯁ Innovative and Science-Based
This is the first public RSI indicator to apply least-squares predictive modeling to RSI calculations. Technically, it incorporates machine-learning logic into a classic indicator. Using Linear Regression embeds strong statistical foundations into RSI forecasting, making this tool especially valuable for traders seeking quantitative and analytical advantages.
⯁ Scientific Foundation: Linear Regression
Linear regression is a fundamental statistical method that models the relationship between a dependent variable y and one or more independent variables x. The general formula for simple linear regression is:
y = β₀ + β₁x + ε
where:
y = predicted variable (e.g., future RSI value)
x = explanatory variable (e.g., bar index or time)
β₀ = intercept (value of y when x = 0)
β₁ = slope (rate of change of y relative to x)
ε = random error term
The goal is to estimate β₀ and β₁ by minimizing the sum of squared errors. This is achieved using the least squares method, ensuring the best linear fit to historical data. Once the coefficients are calculated, the model extends the regression line forward, generating the RSI projection based on recent trends.
⯁ Least Squares Estimation
To minimize the error between predicted and observed values, we use the formulas:
β₁ = Σ((xᵢ - x̄)(yᵢ - ȳ)) / Σ((xᵢ - x̄)²)
β₀ = ȳ - β₁x̄
Σ 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.
⯁ Linear Regression in Machine Learning
Linear regression is a foundational component of supervised learning. Its simplicity and precision in numerical prediction make it essential in AI, predictive algorithms, and time-series forecasting. Applying regression to RSI is akin to embedding artificial intelligence inside a classic indicator, adding a new analytical dimension.
⯁ Visual Interpretation
Imagine a time series of RSI values like this:
Time →
RSI →
The regression line smooths these historical values and projects itself n periods forward, creating a predictive trajectory. This projected RSI line can cross the actual RSI, generating sophisticated entry and exit signals. In summary, the RSI Forecast Colorful indicator provides both the current RSI and the forecasted RSI, allowing comparison between past and future trend behavior.
⯁ Summary of Scientific Concepts Used
Linear Regression: Models relationships between variables using a straight line.
Least Squares: Minimizes squared prediction errors for optimal fit.
Time-Series Forecasting: Predicts future values from historical patterns.
Supervised Learning: Predictive modeling based on known output values.
Statistical Smoothing: Reduces noise to highlight underlying trends.
⯁ Why This Indicator Is Revolutionary
Scientifically grounded: Built on statistical and mathematical theory.
First of its kind: The first public RSI with least-squares predictive modeling.
Intelligent: Incorporates machine-learning logic into RSI interpretation.
Forward-looking: Generates predictive, not just reactive, signals.
Customizable: Exceptionally flexible for any strategic framework.
⯁ Conclusion
By combining RSI and linear regression, the RSI Forecast Colorful allows traders to predict market momentum rather than simply follow it. It's not just another indicator: it's a scientific advancement in technical analysis technology. Offering 28 configurable entry conditions and advanced signals, this open-source indicator paves the way for innovative quantitative systems.
⯁ 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 RSI?
The RSI (Relative Strength Index) is a technical indicator developed by J. Welles Wilder. It measures the velocity and magnitude of recent price movements to identify overbought and oversold conditions. The RSI ranges from 0 to 100 and is commonly used to identify potential reversals and evaluate trend strength.
⯁ How RSI Works
RSI is calculated from average gains and losses over a set period (commonly 14 bars) and plotted on a 0–100 scale. It consists of three key zones:
Overbought: RSI above 70 may signal an overbought market.
Oversold: RSI below 30 may signal an oversold market.
Neutral Zone: RSI between 30 and 70, indicating no extreme condition.
These zones help identify potential price reversals and confirm trend strength.
⯁ Entry Conditions
All conditions below are fully customizable and allow detailed control over entry signal creation.
📈 BUY
🧲 Signal Validity: Signal remains valid for X bars.
🧲 Signal Logic: Configurable using AND or OR.
🧲 RSI > Upper
🧲 RSI < Upper
🧲 RSI > Lower
🧲 RSI < Lower
🧲 RSI > Middle
🧲 RSI < Middle
🧲 RSI > MA
🧲 RSI < MA
🧲 MA > Upper
🧲 MA < Upper
🧲 MA > Lower
🧲 MA < Lower
🧲 RSI (Crossover) Upper
🧲 RSI (Crossunder) Upper
🧲 RSI (Crossover) Lower
🧲 RSI (Crossunder) Lower
🧲 RSI (Crossover) Middle
🧲 RSI (Crossunder) Middle
🧲 RSI (Crossover) MA
🧲 RSI (Crossunder) MA
🧲 MA (Crossover)Upper
🧲 MA (Crossunder)Upper
🧲 MA (Crossover) Lower
🧲 MA (Crossunder) Lower
🧲 RSI Bullish Divergence
🧲 RSI Bearish Divergence
🔮 RSI (Crossover) Forecast MA
🔮 RSI (Crossunder) Forecast MA
📉 SELL
🧲 Signal Validity: Signal remains valid for X bars.
🧲 Signal Logic: Configurable using AND or OR.
🧲 RSI > Upper
🧲 RSI < Upper
🧲 RSI > Lower
🧲 RSI < Lower
🧲 RSI > Middle
🧲 RSI < Middle
🧲 RSI > MA
🧲 RSI < MA
🧲 MA > Upper
🧲 MA < Upper
🧲 MA > Lower
🧲 MA < Lower
🧲 RSI (Crossover) Upper
🧲 RSI (Crossunder) Upper
🧲 RSI (Crossover) Lower
🧲 RSI (Crossunder) Lower
🧲 RSI (Crossover) Middle
🧲 RSI (Crossunder) Middle
🧲 RSI (Crossover) MA
🧲 RSI (Crossunder) MA
🧲 MA (Crossover)Upper
🧲 MA (Crossunder)Upper
🧲 MA (Crossover) Lower
🧲 MA (Crossunder) Lower
🧲 RSI Bullish Divergence
🧲 RSI Bearish Divergence
🔮 RSI (Crossover) Forecast MA
🔮 RSI (Crossunder) Forecast MA
🤖 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: Keep signals active for X bars
Signal Logic: AND/OR configuration
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Chart Labels: BUY/SELL markers above price
Automation & Alerts: BUY/SELL
Background Colors: bgcolor
Fill Colors: fill
Linear Regression Forecast
Signal Validity: Keep signals active for X bars
Signal Logic: AND/OR configuration
Condition Table: BUY/SELL
Condition Labels: BUY/SELL
Chart Labels: BUY/SELL markers above price
Automation & Alerts: BUY/SELL
Background Colors: bgcolor
Fill Colors: fill
Visible RangeOverview This is a precision tool designed for quantitative traders and engineers who need exact control over their chart's visual scope. Unlike standard time calculations that fail in markets with trading breaks (like A-Shares, Futures, or Stocks), this indicator uses a loop-back mechanism to count the actual number of visible bars, ensuring your indicators (e.g., MA60, MA200) have sufficient sample data.
Why use this? If you use multi-timeframe layouts (e.g., Daily/Hourly/15s), it is critical to know exactly how much data is visible.
The Problem: In markets like the Chinese A-Share market (T+1, 4-hour trading day), calculating Time Range / Timeframe results in massive errors because it includes closed market hours (lunch breaks, nights, weekends).
The Solution: This script iterates through the visible range to count the true bar_index, providing 100% accurate data density metrics.
Key Features
True Bar Counting: Uses a for loop to count actual candles, ignoring market breaks. perfect for non-24/7 markets.
Integer Precision: Displays time ranges (Days, Hours, Mins, Secs) in clean integers. No messy decimals.
Compact UI: Displays information in a single line (e.g., View: 30 Days (120 Bars)), default to the Top Right corner to save screen space.
Fully Customizable: Adjustable position, text size, and colors to fit any dark/light theme.
Performance Optimized: Includes max_bars_back limits to prevent browser lag on deep history lookups.
Settings
Position: Default Top Right (can be moved to any corner).
Max Bar Count: Default 5000 (Safety limit for loop calculation).
Megvie Scalping C - Pullback EMA20/50 (3-5m) by Lynda//@version=5
indicator("Megvie Scalping C - Pullback EMA20/50 (3-5m)", overlay=true, max_labels_count=500, max_lines_count=500)
// === INPUTS ===
ema_fast_len = input.int(20, "EMA fast (pullback)")
ema_slow_len = input.int(50, "EMA slow (trend)")
rsi_len = input.int(14, "RSI length")
rsi_min = input.int(40, "RSI min for entry")
atr_len = input.int(14, "ATR length (for SL/TP)")
use_atr_for_sl = input.bool(true, "Use ATR for SL size")
atr_sl_mult = input.float(1.0, "SL = ATR * multiplier", step=0.1)
rr = input.float(1.8, "Risk:Reward (TP = SL * RR)", step=0.1)
max_signals_repeat = input.int(3, "Min bars between signals", minval=1)
// === INDICATORS ===
ema_fast = ta.ema(close, ema_fast_len)
ema_slow = ta.ema(close, ema_slow_len)
rsi = ta.rsi(close, rsi_len)
atr = ta.atr(atr_len)
plot(ema_fast, color=color.new(color.green, 0), title="EMA 20")
plot(ema_slow, color=color.new(color.red, 0), title="EMA 50")
// === TREND FILTER ===
trend_bull = ema_fast > ema_slow
trend_bear = ema_fast < ema_slow
// === PULLBACK CONDITION ===
// Consider a pullback when price traded at/under EMA20 within the last 3 bars and now shows a bullish/bearish confirmation
pullback_bull = ta.lowest(low, 3) <= ema_fast and close > ema_fast
pullback_bear = ta.highest(high, 3) >= ema_fast and close < ema_fast
// === CONFIRMATION CANDLE ===
// Bullish confirmation: current close > open AND close > high (strong close)
// Bearish confirmation: current close < open AND close < low
bullish_candle = close > open and close > high
bearish_candle = close < open and close < low
// === ENTRY SIGNALS (Version C logic) ===
buySignal = trend_bull and pullback_bull and rsi >= rsi_min and bullish_candle
sellSignal = trend_bear and pullback_bear and rsi <= (100 - rsi_min) and bearish_candle
// Prevent firing signals too often
var int lastSignalBar = na
ok_to_fire = na(lastSignalBar) ? true : (bar_index - lastSignalBar) > max_signals_repeat
buyFire = buySignal and ok_to_fire
sellFire = sellSignal and ok_to_fire
if buyFire
lastSignalBar := bar_index
if sellFire
lastSignalBar := bar_index
// === SL / TP CALCULATION ===
var float sl_price = na
var float tp_price = na
var line sl_line = na
var line tp_line = na
var label sig_label = na
if buyFire
if use_atr_for_sl
sl_price := close - atr * atr_sl_mult
else
sl_price := ta.lowest(low, 3) - syminfo.mintick * 5
tp_price := close + (close - sl_price) * rr
// draw lines and label
line.delete(sl_line )
line.delete(tp_line )
label.delete(sig_label )
sl_line := line.new(bar_index, sl_price, bar_index + 50, sl_price, color=color.new(color.red, 0), width=1, extend=extend.right)
tp_line := line.new(bar_index, tp_price, bar_index + 50, tp_price, color=color.new(color.green, 0), width=1, extend=extend.right)
sig_label := label.new(bar_index, low, "BUY SL:" + str.tostring(sl_price, format.mintick) + " TP:" + str.tostring(tp_price, format.mintick), style=label.style_label_up, color=color.new(color.green,0), textcolor=color.white, size=size.small)
if sellFire
if use_atr_for_sl
sl_price := close + atr * atr_sl_mult
else
sl_price := ta.highest(high, 3) + syminfo.mintick * 5
tp_price := close - (sl_price - close) * rr
// draw lines and label
line.delete(sl_line )
line.delete(tp_line )
label.delete(sig_label )
sl_line := line.new(bar_index, sl_price, bar_index + 50, sl_price, color=color.new(color.red, 0), width=1, extend=extend.right)
tp_line := line.new(bar_index, tp_price, bar_index + 50, tp_price, color=color.new(color.green, 0), width=1, extend=extend.right)
sig_label := label.new(bar_index, high, "SELL SL:" + str.tostring(sl_price, format.mintick) + " TP:" + str.tostring(tp_price, format.mintick), style=label.style_label_down, color=color.new(color.red,0), textcolor=color.white, size=size.small)
// === PLOT SIGNAL ARROWS ===
plotshape(buyFire, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.triangleup, size=size.small, text="BUY")
plotshape(sellFire, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.triangledown, size=size.small, text="SELL")
// === ALERTS ===
alertcondition(buyFire, title="BUY Signal", message="Megvie C: BUY signal. SL: {{plot_0}} TP: {{plot_1}}")
alertcondition(sellFire, title="SELL Signal", message="Megvie C: SELL signal. SL: {{plot_0}} TP: {{plot_1}}")
alertcondition(ta.cross(close, tp_price), title="TP Hit", message="Megvie C: TP reached")
alertcondition(ta.cross(close, sl_price), title="SL Hit", message="Megvie C: SL reached")
// === NOTES ===
// - Optimized for 3-5 minute charts.
// - Test in paper trading before using real capital.
// - Adjust ATR multiplier and RR to match your risk management.
ES-SPX Premium PlotThis Pine Script indicator calculates and plots the premium (basis) between the E-mini S&P 500 futures (ES) and the S&P 500 cash index (SPX). It displays the difference as a line chart in a separate pane, helping traders identify fair value discrepancies, arbitrage opportunities, or market sentiment shifts driven by interest rates, dividends, and time to expiry. Apply to ES1! charts for real-time analysis.
EMA Crossover + Angle + Candle Pattern + Breakout (Clean) finalmayank raj startegy of 9 15 ema with angle more th5 and bullish croosover or bearish crooswoveran 3
MTF RSI + MACD Bullish Confluencethis based on rsi more then 50 and macd line bullish crossover or above '0' and time frame 15 min, 1 hour, 4 hour , 1 day and 1 week






















