Early Reversal ProEarly Reversal Pro is a non-repainting, structure-first market context and early reversal detection tool designed to identify high-quality reversal zones before a trend potentially changes direction.
Instead of generating frequent signals based only on indicators, this script follows a market structure → exhaustion → confirmation workflow to evaluate whether the environment is suitable for a reversal or if the existing trend is still intact.
The goal is not to predict tops or bottoms, but to answer:
“Is the market showing objective structural evidence of a reversal — or not yet?”
Core Design Philosophy
This indicator is built around three principles:
Structure comes first – reversals are only considered after objective structural events appear.
Confirmation is layered – multiple independent conditions must align.
Selectivity over frequency – fewer signals, higher quality, lower noise.
All calculations are bar-close based and do not repaint.
What the Script Analyzes
The system evaluates three main layers:
1. Structural Shift Detection (Tier-1)
Reversal consideration begins only when one or more of the following appear:
Liquidity sweeps of recent highs/lows
Break of structure (BOS)
Change of character (CHoCH)
Extreme overshoot & snapback behavior
Climax + failure patterns
These define whether the prior trend is objectively weakening.
2. Confirmation & Exhaustion Layer (Tier-2)
Once structure is present, the script evaluates confirmation using:
VWAP reclaim / rejection
Volume + large wick behavior
RSI divergence using swing structure
ATR-based exhaustion
Micro-structure shift (HH/HL vs LH/LL)
Volatility squeeze → expansion
These conditions measure whether participation and momentum support a reversal attempt.
3. Confluence Layer (Tier-3)
Additional context signals:
Reversal candle patterns (hammer, engulfing, shooting star)
Wyckoff-style effort vs result failure
These do not trigger signals alone, but improve confidence when aligned.
Scoring + Tier Qualification
Two independent systems are used:
Score system – weighted aggregation of structural, exhaustion, and confirmation signals
Tier qualification system – strict rule set requiring: ≥ 2 Tier-1 conditions and ≥ 1 Tier-2 confirmation A setup may have a high score but still fail tier qualification. This is intentional and prevents weak reversals from being promoted.
Trading Modes
Trading modes adjust how sensitive the system is to volatility and structural thresholds:
Intraday
More sensitive to volatility changes
Designed for short-term trades
Swing
Balanced sensitivity (default)
Positional
Filters short-term noise
Designed for higher timeframes and wider swings
These modes affect exhaustion detection, volatility filters, and structure sensitivity.
Risk Profiles
Risk profiles adjust how strict the qualification thresholds are:
Aggressive Lower score requirements
Earlier signals
Higher frequency, higher risk Balanced
Default behavior Conservative Higher minimum score requirements
Fewer but higher-quality signals This allows traders to match the tool to their risk tolerance.
Higher-Timeframe Context
The script also integrates:
Higher-timeframe EMA trend bias
Premium / discount zones using HTF ranges
Higher-timeframe resistance proximity filters (buy-side safety) These are shown in the dashboard and used to qualify “execution-ready” states.
How to Use
Wait for structural events (sweep, BOS, CHoCH).
Observe tier qualification and score alignment.
Treat ER-B / ER-S labels as zones, not instant entries.
Use the execution panel to see whether conditions are: READY, FILTERED, WAIT or CAUTION
Always confirm with your own risk management and execution logic.
Fewer signals are intentional to reduce false reversals. Important Notes This script does not manage trades or position sizing.
Entries, exits, and risk remain fully discretionary.
Alerts trigger only when structural conditions are satisfied.
Designed for context and decision support, not automation. Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial or investment advice.
Göstergeler ve stratejiler
Laguerre RSI + SOTTThis indicator is designed to assist traders in identifying potential limit entry zones along with confirmation signals based on price behavior and technical conditions. It highlights areas where price may react, helping traders plan entries with a structured and disciplined approach.
The indicator provides both Buy Limit and Sell Limit levels, as well as confirmation signals to improve timing and trade confidence. Users can select from four different signal options, allowing flexibility for conservative or aggressive trading styles.
All signals are generated using predefined logic based on historical price data and market structure. This indicator does not predict future price movement and should be used as a decision-support tool, not as a standalone system.
Key features include multi-timeframe compatibility, customizable signal options, and broad market support including Forex, Crypto, Indices, and Stocks. It is suitable for scalping, day trading, and swing trading when combined with proper risk management.
⚠️ This indicator is intended for educational and analytical purposes only and does not provide financial advice. Trading involves risk, and users are responsible for their own trading decisions
Pitchfork Forge LITEPitchfork Forge LITE - The Strategy Forge Ecosystem
Not all pitchfork patterns are created equal.
Why do they work? There's no magic to them, their purpose is to identify natural price channels – which most traders draw subjectively. I built this to measure which patterns have proven reliable through actual price behaviour before risking money on them.
Besides who isn’t bored of fiddling around with the manual pitchforks to find the exact low of a wick?
*Note: Optimized for Daily timeframe. Works better on 6H and above.
*Important note: See Pattern Type Guide Section below for important information on how construct your pitchforks correctly
WHY QUALITY METRICS MATTER:
Drawing a pitchfork is easy. Knowing if it's reliable is hard. Without data, you're guessing whether price will respect the levels or ignore them. Do you include wicks? What about if targets are front-run – do they count? What about rejections?
How can you reliably tell if a pitchfork is being respected?
This tool answers that question with measurable criteria:
→ Touch Count: How many times price tested the levels
→ Rejection Rate: Percentage of touches that reversed direction
→ Pattern Age: Newer patterns need more confirmation
→ Trading Status: 🟢 READY / 🟡 MONITOR / 🔴 WAIT
→ Quality Rating: STRONG / MODERATE / WEAK
LITE VERSION FEATURES:
- 4 pitchfork types (Original, Schiff, Modified Schiff, Inside)
- Manual month selection for stable, reliable patterns
- Quality scoring for every detected pattern
- Standard levels (±0.5, ±1.0, ±1.5, ±2.0)
- Secondary Pitchfork for historical confluence
- Show Pivot Candidates to find strong pivot months
- Comprehensive info table with all metrics
📊 PATTERN TYPE GUIDE (IMPORTANT):
Select L-H-L or H-L-H based on your chart structure:
→ L-H-L (Bullish): Price formed Low → Rally → Higher Low
Use when: Rising structure, uptrend continuation, higher lows
→ H-L-H (Bearish): Price formed High → Drop → Lower High
Use when: Falling structure, downtrend, lower highs
If the opposite selection is made, you may run into a ‘No pattern found error’ or create an incorrectly drawn pitchfork. This is basically because the algo is, for example, looking for a low when you are looking for a high.
Fix: Switch L-H-L ↔ H-L-H or try different pivot months
💡 Pro tip: Enable "Show Pivot Candidates" to see all available pivots with month/year labels. Makes month selection much easier.
HOW TO USE IT:
Before entering any pitchfork trade, check the quality rating. STRONG patterns with 🟢 READY status are potentially ready to look for setups. WEAK patterns or those less than 30 days old could be skipped until they prove themselves.
This simple filter can help keep focus on high-probability setups.
WHAT MAKES THIS DIFFERENT:
Most pitchfork tools focus purely on visual analysis. This adds quantitative measurement - you can see objectively whether a pattern has proven reliable through price behaviour, not just appearance.
PERFECT FOR:
Swing and position traders who want objective data to validate pattern-based setups. Reduces subjective guesswork and helps identify which pitchforks are worth trading.
PRO VERSION (Part of the Strategy Forge Suite):
Extended levels (±2.5 to ±4.0), automation signals for Strategy Forge, confluence detection, and advanced metrics.
PAIRS WITH:
- Multi-TF Fibonacci Pivot Points - Multi-timeframe confluence validation
- Pivot Master LITE - Backtest pivot-based strategies
- More to come...
Part of The Forge Ecosystem - tools I built to bring objectivity to pattern and pivot analysis.
Real trader, real tools. Questions? DM me.
1H Candle AlertReads 1 hour candles if previous candle color is changed from buy to sell or sell to buy it will alert.
Force of Multi Strategy Bot: Backtest Webhook Alert Adaptive MTFForce of Multi Strategy - Innovative solution designed for crypto trading 📈
Overview:
Intraday algo trading bot with 29 strategies, up to 10 symbols, and multi-timeframe filters. Sends pre-configured Webhook Alerts (TTA format) to major crypto exchanges. Includes a live strategy Switcher that selects the best-performing strategy based on real-time backtest data
Key Features:
29 non-repaint strategies on up to 10 symbols
Buy/Sell signals based on TV Technical Rating, classic and adaptive indicators
Higher Timeframe filters (ADX, Volatility, Volume, ATR) with multipliers from chart TF
Advanced risk management and backtest metrics
Automated "Switcher” to pick the best-performing strategies from backtest data in real time
Webhook alerts in TTA format (tradingview to anywhere) pre-configured to major Crypto Exchanges: Binance, Bitget, BingX, Bybit, GateIO, KuCoin and OKX
Main Inputs:
"All Strategies" on/off - two base mode options, trading all strategies on chart symbol or one strategy for 10 symbols
HTF Mult 1/2 - multipliers for 2 higher timeframes filters
InitCap/Trade$/Leverage - position size of one trade and initial capital
Min ROI/WR/PF/SRP/MAR/Trades - minimal cutoff for key strategy performance metrics. When "All Strategies" is "on" switcher will open trades for strategies which occur this criteria
"Check Last" on/off - check performance metrics for a specified number of recent trades.
If the option is disabled, metrics are checked for the entire duration of the backtest
BacktestDays/MaxBars - set how long the script will perform backtests in days, with a limitation on the number of bars for acceptable calculation speed
How it works:
Just one trade can be opened at time for one symbol, strategies or symbols are calculates using their own setting initial capital
When "All strategies" is "off" - script executes trades, records backtest and send alerts from one selected strategy for each symbol This mode useful when you calibrate risk management options on different symbols, or if you find that one of 29 strategies is profitable on many symbols and want trade with many of them simultaneously. This opens up the possibility of mass diversification, for example, launching trading on 200 symbols with just 20 notifications
When "All strategies" is "on" - script executes trades and records backtest results continuously from all strategies for chart symbol In this mode, strategy switcher executes trades and send alerts only from strategies that meet your pre-defined performance criteria, based on backtest results of all strategies. This opens up opportunities, allowing you to not only test the performance of one or many strategies, but also test the logic behind switching them. What could become a new key way for adapt to changing markets
Interface:
Labels: on chart show open long/short and result in USD for closed trades, when "All strategies" is active - labels at bottom of indicator window show which exactly number of strategy opens a deal. The "No" label means that none of the strategies that meet the performance criteria have opened a trade at this time
Lines: indicator window contained equity line (aqua) and HTF Technical rating area, chart contain SL/TP (red/green) and open price (blue) lines for opened trades
Table 1 (all strategies or all symbols):
- TR: count of closed trading deals; WR: Winning Rate; PF: Profit Factor
- MDD: Max Draw Down for all calculated time from initial capital
- R$: trading Profit Result in USD
First row shows some of script settings, in published example: initial capital 100$, leverage 50L, 20 backtest days, 10$ is invest in one deal, 15m is chart timeframe, 60m is higher timeframe 1 and 120m is higher timeframe 2.
The exchange name in the second row determines the alert messages format
If strategy meet cutoff criteria you will see "Ok" label, if strategy meet criteria and have maximum from other reached ROI they labeled "Best". Chart strategy labeled "Chart", Chart and Ok labels in one time is "Chart+", "Chart" and "Best" is labeled "Best+"
Green or red color of strategy number/symbol means a long or short trade is currently active
Table 2 (chart symbol):
- PT: Result in USD Per one Trade; PW: Result Per Win, PL: Result Per Lose
- ROI: Return On Investment; SR: Sharpe Ratio, MR: CalMAR ration
- Tx: Commission Fee in $; R$: trading Profit Result in USD
There separate trade results of backtesting for longs and shorts. In first column you see how many USD were invested in one trade, taking into account possible position splitting
Update frequency: closed trades information updated every bar, but check "ok"/"best" labels in table 1 would be when chart have not open trade. Its need for calculation speed purpose
Risk management options:
When a buy or sell trade is opened, you'll see three lines on the chart: a red stop-loss line ( SL ), a green take-profit line ( TP ), and a blue line representing the entry price . The trade will be closed if the high price or low price reaches the line TP or SL (no wait for bar close) and alert will be triggered once per bar when script recalculates
Several options are available to control the behaviour of SL/TP lines, such as stop-loss by percent, ATR, Highest High (HH) and Lowest Low (LL) . Take Profit can be in percent, ATR, Risk Reward ratio . There some Trailing Stop with start trail trigger options - ATR, % or HH/LL
Additionally, implemented a function for adding a position when the breakeven level expressed in the current ROI is reached for opened trade (splitting). The position is added within the bar
Webhook alerts in TTA format with message contained next info : Buy / Sell or adding Quantity, Leverage, SL price, TP price and close trade Result in USD
(for easy forward tests and check difference between actual trade result and alerts logs)
Backtest Engine:
Profit or Loss is USD = close trade price * open trade quantity - open trade price * open trade quantity - open trade quantity * (open trade price + close trade price)/2 * commission
Possible slippage or alert sending delay needed to be include in commission % which you will set in risk management settings block, default settings is 0.15% (0,06% for open, 0,06% for close and 0,03% for possible slippage or additional fees)
Maximum Draw Down Drawdown = (peak - current equity) / peak * 100 ;
Drawdown > maxDrawdown ? maxDrawdown = Drawdown
ROI = profit result in USD / sum of all positions margin
CalMAR Ratio = ROI / (-MaxDrawDown)
Sharpe Ratio = ROI / standard deviation for (Sum of all results) / (Sum of all Position Margins)
Strategies:
You can enable or disable various Higher Timeframes Filters (ADX, volatility, technical rating). When filters enabled, trades will only open when the setting are reached for one of 2
Number 1, 2 and 3: is Higher Timeframe TradingView Technical Ratings, 1 is summary total rating, 2 is oscillators and 3 is moving averages. When TR filter cross filter levels trade will be open at chart bar close. By Default on chart you see Summary Technical Rating oscillator, but here the options for change it to Oscillator TR or Moving Average TR
Number 4, 5 and 6: is Chart TimeFrame TR. Trades will open when its values (Summary, Oscillators and Moving Averages) reached setting buy sell level
Number 7, 8 and 9: is Alternative buy sell logic for Chart TimeFrame TR, trades will open when counting rising or falling setting values will be reached
Number from 10 to 18: is chosen by user adaptive moving averages and oscillators indicators. In settings you will see many different adaptive length algorithms for trading and different types of moving averages and oscillators (more than 30 variations). All adaptive strategies have their options for calibrating and plotting. Default adaptive length algorithm is unique, developed by author and based on ADX: shorten the length of ma/osc when market detected as trending. Trades are opened when the user-defined buy/sell levels are crossed
Number from 19 to 29: its can't be calibrated for avoid overfitting, i try to found mostly time worked strategies and use its with standard settings. In future it's possible to changing current or adding additional strategies. At the time of publication this script uses :
- Dynamic Swing HH LL ( 19 ): trades opens when trend swing is determined by comparing the timing of the latest high vs. low within a 50-bar window;
- Composite indicator ( 20 ): 0.25 * smaNormalized + 0.15 * rsiNormalized + 0.25 * macdNormalized + 0.35 * rocNormalized, buy/sell when 0,8/-0,8 level is crossed;
-%R Exhausting with different signals ( 21,22 ): buy/sell when long term Williams %R (112) and short %R (21) cross centre line (-50) or -20/-80 levels;
- Pivot Point SuperTrend ( 23 ): ident 5 bars pivot point centreline with 3,5 ATR bands, buy/sell signal when trend direction is changed as usual supertrend (price crossing bands)
- Ichimoku Cloud ( 24 ): buy/sell when tenkan crossing kijun with trend confirmation (tenkan > or < then 25 bars back senkou A and B)
- TSI ( 25 ): trades opens when true strength index (26) crossing -0,5/0,5 levels
- Band Level RSI ( 26 ): ident bands based on wma(100) and close stdev(100), buy/sell signals when fast RSI(5) cross 25/75 with price out of bands
- RSI/MacD ( 27, 28 ): trades opens when macd crossing signal line if RSI was out of 37/69 level in last 5 bars, and open trades when signal line crossed zero macd level
-5 Bars UpDown( 29 ): trades opens when last 5 bars ups or downs.
For clarity , classic strategies are not plotted in this script
Why this mashup? No one single trading strategy can't works consistently in all conditions. Diverse of very different trend follow and reversal strategies needed to identify the best-performing ones at any given time
Originality and Value:
Diverse Strategy Suite: The indicator includes many strategies, each employing a different technical analysis techniques. This breadth of strategies allows the script to adapt and perform well across a wide range of market conditions
Adaptive Algorithms: Many of the strategies within the indicator utilize proprietary, adaptive algorithms that dynamically adjust the parameters of indicators and oscillators based on real-time market conditions, such as volatility and trend strength. This helps the strategies remain responsive even as market shifts
Advanced Risk Management: incorporates different sophisticated risk controls, including dynamic stop-loss and take-profit levels, position sizing. These help to preserve capital and optimize the risk-reward profile of the trading
Comprehensive Backtest Engine: provides detailed performance analysis, including P&L, ROI, Sharpe ratio, and maximum drawdown. This allows for comparison and identification the best of available strategies
Automated Strategy Switching: The author-developed “Switcher” unique feature allows traders to pick on the best-performing strategy in real-time, improving their chances of success
This combination, along with the developer’s extensive research and testing, sets the “Force of Multi Strategy” apart from many other trading solutions available on the market. Strategy switcher combines backtest with adaptive indicators to dynamically select top performers, enhancing adaptability in volatile markets—unlike standard strategies that rely on fixed rules. By providing adaptive, and risk-managed approach, the "FoMS" aims to potentially generate significant returns
Usage Example:
4 scripts was added to chart with different filters settings (No Filters, ADX, ATR, TV.TR)
All instances have same settings - Symbol:PEPE on BingX; Chart TF:15m, HTF Mult 1/2: 4/8; InitCap:100$;One trade: 10$/50Leverage; Strategies switches with same logic - choose strategy which for last 4 trades reached minimal ROI 0.4, with WR >=50%. As you can see results are different, best ROI received with ATR filters (No trade if ATR 5 / ATR 20 < 1.2)
Choose liked option and create New Alert with Webhook address given from TTA, that's all - and next signal from strategy who reach setting ROI and WR from last 4 trades with HTF filters will be opened by script and alert will be sends to Webhook address for opens position on exchange
Keep in mind , script open a market orders and alerts have slight delay, some negative or positive difference (usually 3-10%, L50) in close trade result between alert and actual trade results is possible, alert message example: Close 1000PEPEUSDT C=LINEAR +2.27$ Buy 1000PEPEUSDT Q=13276.2944 SL=0.006545 TP=0.010168 L=50 D=2 C=LINEAR St:21
Might be important, this script generates alerts for market orders that are then executed on pre-configured crypto exchanges via the TTA service, along with native SL/TP orders
Finally:
Usage example backtests demonstrate that Force of Multi Strategy could generate returns. In my testing across various configurations, I observed profitable backtest results for approximately 20-25% of crypto assets when using the strategy switcher
Currently there no universal instruction a "how to" be profitable in all markets and in any time. However, i continue research and will share some tips in the future. First one i found through many tests: last 4 trades say more about next one number 5, than 10 about 11
Invite-only access protects the script’s proprietary research and unique multi-strategy framework, not found in public scripts, ensuring users to have tailored tools without risk of imitation. To get access please see the Author's instructions!
Happy trading, and stay tuned for updates!
DISCLAIMER: No sharing, copying, reselling, modifying, or any other forms of use are authorized for this script, and the information published with them. This script is strictly for individual use. No one know future and Investments are always made at your own risk. I am not responsible for any losses you may incur. Before investment make sure that your logic is enough profitable on demo account
Bullrider | Volume Exhaustion & Protected LevelsThis is a proprietary volume-based indicator that identifies trend exhaustion. When volume decreases for 3 consecutive bars while price continues to move, it signals that the move lacks real strength. The indicator automatically marks the High/Low of the 3rd candle as a "Protected Level" where smart money is likely holding the range.
Momentum Map Script v1This script uses Relative Strength Momentum, Relative Strength Ratio to help identify below :
// Green : Leading and Expanding
// Blue : Early signs of strength
// yellow : Cooling down
// Red : Lagging ang Weak
Note and Disclaimer :
1. This script is an analytical, visualization tool and, not a buy/sell signal generator.
2. The script does not repaint and uses only confirmed bar data.
3. Past quadrant behavior does not guarantee future results.
4. Complies with Trading View’s open-source and originality guidelines.
Ghost Shadow [Bit2Billions]📌 Ghost Shadow — Adaptive Momentum & Divergence Engine
Ghost Shadow is a closed-source momentum intelligence system designed to evaluate trend pressure, swing transitions, exhaustion, and continuation using a normalized momentum framework.
Traditional momentum indicators (MACD, stochastic, candle patterns, divergence scripts) are usually applied independently. This often results in inconsistent behavior across markets, conflicting momentum signals, and excessive chart clutter.
Ghost Shadow replaces this fragmented approach with one synchronized momentum model where all components reference the same normalized momentum state.
📌 What Problem This Script Solves
Most traders encounter these momentum-related issues:
* MACD behaves differently on different assets and timeframes
* Fixed OB/OS levels fail during volatility shifts
* Divergence appears without momentum context or repaints
* Candle patterns are interpreted without momentum confirmation
* Multiple indicators overlap and contradict each other
Ghost Shadow solves these problems by classifying momentum into adaptive states, allowing traders to interpret momentum as context, not isolated signals.
📌 Reason for Mashup (Why Components Are Combined)
Ghost Shadow combines MACD-based momentum, stochastic pressure, divergence logic, candle behavior, and supply/demand scoring because momentum cannot be reliably interpreted using a single oscillator.
Momentum strength, swing structure, volatility, and price behavior are interdependent. When analyzed separately, they often produce misleading or contradictory conclusions.
This mashup is justified because:
* All components derive from the same normalized momentum baseline
* Divergence is only evaluated within valid momentum swings
* Candle and pressure analysis only contextualize momentum, not override it
* No module generates independent trade signals
The goal is not to merge oscillators, but to standardize momentum interpretation.
📌 How the Script Works (Operational Explanation)
Ghost Shadow operates through four dependent momentum layers, executed in sequence:
### 1. Normalized Adaptive Momentum Engine (Base Layer)
Instead of raw MACD values, the script:
* Normalizes momentum into percentage-scaled ranges
* Measures momentum expansion and compression relative to recent behavior
* Classifies momentum into impulsive, corrective, or neutral states
This allows momentum to behave consistently across all markets and timeframes.
### 2. Smoothed Momentum Structure (Swing Layer)
Using Heikin-Ashi-style MACD candles, the script:
* Filters short-term noise
* Defines internal momentum swings
* Establishes swing structure used by divergence and pressure logic
Momentum swings are evaluated structurally, not bar-by-bar.
### 3. Divergence Validation Engine (Exhaustion Layer)
Divergence is detected by comparing:
* Momentum swing structure vs price swing structure
* Strength and duration of momentum displacement
* Directional context from the base momentum state
Only past and confirmed data is used.
Divergence does not appear independently — it requires valid swing structure.
### 4. Contextual Confirmation & Aggregation (Context Layer)
Additional modules provide context, not signals:
* Stochastic pressure evaluates short-term momentum within the larger state
* Candle behavior and body/wick ratios contextualize momentum shifts
* Supply/demand scoring evaluates directional pressure
* The dashboard aggregates all states into a readable directional bias
This ensures momentum interpretation is filtered and contextual, not reactive.
📌 How Traders Use Ghost Shadow
Ghost Shadow is not a signal generator. It provides momentum context.
Typical usage:
1. Identify the active momentum state
(impulsive trend, corrective pullback, or equilibrium)
2. Observe divergence only within context
Divergence against impulsive momentum suggests exhaustion; divergence in equilibrium suggests range behavior.
3. Use adaptive OB/OS zones instead of fixed levels
Extremes are interpreted relative to volatility, not static thresholds.
4. Confirm momentum continuation or failure
Using pressure, candle behavior, and dashboard alignment.
This helps traders avoid reacting to isolated crosses or patterns.
📌 Why This Momentum Model Is Different From Standard Indicators
Standard momentum tools:
* Raw MACD values
* Fixed stochastic OB/OS levels
* Pivot-based divergence
* Candle patterns without momentum context
Ghost Shadow:
* Normalized momentum scaling
* Volatility-responsive zones
* Structure-based divergence validation
* Momentum-first candle interpretation
* Contextual aggregation instead of signals
This makes Ghost Shadow a momentum intelligence system, not a classic oscillator.
📌 Why This Script Is Worth Paying For
Ghost Shadow justifies paid access because it replaces multiple momentum tools with one closed-source system built on original normalization and integration logic.
It replaces:
* Multiple MACD variants
* Standalone stochastic indicators
* Divergence scripts
* Candle-pattern scanners
* Manual momentum bias assessment
* Multi-timeframe momentum comparisons
The value lies not in individual indicators, but in how momentum is normalized, filtered, and interpreted as a single system.
This level of consistency and clarity cannot be achieved by combining public indicators, which is why Ghost Shadow is offered as an invite-only, closed-source script.
📌 What This Script Is NOT
For clarity:
* This is not a standard MACD crossover tool
* This is not a repainting divergence indicator
* This is not an automated trading system
* This is not based on fixed OB/OS thresholds
All calculations use confirmed past and real-time data only.
📌 Key Features
• Normalized Adaptive MACD
Percentage-based MACD with dynamic overbought/oversold shading for stable momentum context across assets.
• Heikin-Ashi MACD Candles
Smooth, noise-reduced candle representation for clearer swing identification.
• Stochastic Candles & Signals
OB/OS highlights, adaptive zone shifts, and real-time divergence detection.
• Divergence Engine
Flexible detection of:
* Regular Divergence (bull & bear – dashed lines)
* Hidden Divergence (bull & bear – dotted lines)
* Live developing divergences using past-data only (no lookahead)
• Multi-Module Dashboard
A structured overview of everything happening on the chart in one place.
📌 Dashboard Metrics
📌 MACD Bias
Directional momentum & trend strength from the normalized MACD engine.
📌 Stochastic Bias
Short-term momentum read with OB/OS sensitivity.
📌 Candle Pattern Detection (70+ patterns)
Doji, Morning/Evening Star, Shooting Star, Hammer, Bearish/Bullish Engulfing, Harami, Piercing Line, Hanging Man, Spinning Top, Dark Cloud Cover, Raindrop/Doji, Tweezer Top/Bottom, Tower patterns, Inside/Outside Bar, Three Line Strike, Three White Soldiers, Three Black Crows, Marubozu, Tasuki patterns, Rising/Falling Three Methods — and many more.
📌 Body/Wick/Volume Ratios
Automatic interpretation of candle sentiment through proportional body/wick/volume analysis.
📌 Demand & Supply Strength
Real-time scoring of active candle pressure and MA-based supply/demand bias.
📌 Directional Bias
Aggregated long/short *lean* using combined momentum, divergence, and structure inputs.
*This is a contextual bias, not an automated signal.*
Higher-Timeframe Metrics
* HTF Trap Levels & Scoring
* HTF Volume Conditions
* HTF Price Action Alignment
* Quick HTF Bias Reads
📌 Market Summary
Consolidated sentiment, structure, and volatility status into one panel.
🔹 How Modules Work Together (Conceptual Overview)
Ghost Shadow uses a structured pipeline:
1. Normalized MACD builds the base momentum landscape.
2. Swing Structure is read internally to anchor divergences and zone shifts.
3. Divergence Engine compares MACD/Stoch swings vs price swings using past pivots only.
4. Adaptive OB/OS Zones adjust to volatility using dynamic scaling.
5. Dashboard aggregates all module outputs into a unified directional lean for interpretation.
This ensures each module references the same internal logic rather than acting as separate uncorrelated tools.
📌 Visual Design & Chart Clarity
* Only essential real-time labels shown.
* All historical/replayed labels disabled to maintain chart cleanliness.
* Consistent color-coded visuals for divergence, momentum zones, and pattern signals.
* Shapes, line-styles, and colors remain organized for fast interpretation.
📌 Divergence Lines
* Regular Divergence: Dashed Green/Red
* Hidden Divergence: Dotted Green/Red
📌 Inputs & Settings
* Clean layout with simple Show/Hide toggles
* Pre-configured defaults
* Minimal exposed fields for ease of use
* Designed to reduce setup time and improve workflow speed
📌 Recommended Timeframes & Markets
* Best on 15m, 1H, 4H, Daily, Weekly
* Works across forex, crypto, indices, commodities, equities
* Pivot-based structures may show noise on illiquid assets
📌 Performance & Limitations
* Heavy modules may draw many objects → disable unused sections
* If the chart stops loading objects, simply refresh
* All TradingView platform limitations handled internally
📌 License & Legal
* Proprietary © 2025
* Redistribution, resale, or sharing of internals is prohibited
* Independently developed; uses only public-domain trading concepts
* Any resemblance to other tools is coincidental and concept-based only
📌 Respect & Transparency
* Built fully on public, widely known trading concepts
* No code reused or copied; all logic developed independently
* If any similarity is noticed, it can be addressed constructively
📌 Disclaimer
* For education and analysis only
* Not financial advice
* Market risk is real — always backtest and manage risk properly
📌 FAQs
* Source code is not public
* Works best on 15m, 1H, 4H, Daily, Weekly
* All modules individually toggleable
* Alerts can be set manually
* Compatible with forex, crypto, indices, commodities, and equities
📌 About Ghost Trading Suite
Author: BIT2BILLIONS
Project: Ghost Trading Suite © 2025
Indicators: Ghost Matrix, Ghost Protocol, Ghost Cipher, Ghost Shadow
Strategies: Ghost Robo, Ghost Robo Plus
Pine Version: V6
The Ghost Trading Suite is designed to simplify and automate many aspects of chart analysis. It helps traders identify market structure, divergences, support and resistance levels, and momentum efficiently, reducing manual charting time.
The suite includes several integrated tools — such as Ghost Matrix, Ghost Protocol, Ghost Cipher, Ghost Shadow, Ghost Robo, and Ghost Robo Plus — each combining analytical modules for enhanced clarity in trend direction, volatility, pivot detection, and momentum tracking.
Together, these tools form a cohesive framework that assists in visualizing market behavior, measuring momentum, detecting pivots, and analyzing price structure effectively.
This project focuses on providing adaptable and professional-grade tools that turn complex market data into clear, actionable insights for technical analysis.
Crafted with 💖 by BIT2BILLIONS for Traders. That's All Folks!
📌 Changelog
v1.0 – Core Release
* Introduced Normalized Adaptive MACD with percentage-based zones and overbought/oversold shading.
* Added Heikin-Ashi style MACD candles for smoother swing visualization.
* Implemented Stochastic Candles with dynamic zones and divergence detection.
* Added Real-Time Divergence Engine for MACD and Stochastic (regular, hidden, live).
* Integrated Automated Candle Pattern Recognition with 70+ patterns.
* Added Body/Wick/Volume Ratio Metrics for long/short market analysis.
* Implemented Demand & Supply Strength Analysis (current candle & moving average-based).
* Added Directional Predictions for long and short positions.
* Developed Higher-Timeframe Analysis Modules with traps, volume, alignment, and quick signals.
* Added Comprehensive Dashboard summarizing momentum, patterns, HTF traps, and actionable market status.
Educational Rajat Silver MCX Premium or Discount ploting LineMCX–COMEX Silver Premium / Discount Line shows whether Indian MCX Silver is trading at a premium or discount compared to global COMEX Silver, after adjusting for USD/INR and unit conversion.
The indicator:
Converts MCX Silver (₹/kg) into $/oz
Compares it with COMEX Silver ($/oz)
Plots the premium / discount (%) as a line
How to read:
Red line (above 0) → MCX Silver trading at premium
Green line (below 0) → MCX Silver trading at discount
0 line → Fair value (MCX aligned with COMEX)
This tool helps identify:
Premium expansion (overheated local market)
Premium compression (mean reversion zones)
When MCX is moving independently of COMEX due to currency or local factors
Best used for:
MCX Silver futures traders
Spotting overbought / overstretched phases
Weekend gap-risk analysis
Relative value analysis between India and global markets
Recommended symbols
MCX Silver: apply indicator on MCX Silver chart
COMEX Silver: COMEX:SI1!
USD/INR: FX_IDC:USDINR
Flashpoint - MTF Multi FVG ZonesFlashpoint - Simple FVG (Multi-Timeframe Fair Value Gap)
A clean, efficient Fair Value Gap (FVG) indicator that automatically detects and displays imbalance zones across multiple timeframes on a single chart.
What is a Fair Value Gap?
A Fair Value Gap (FVG) is a three-candle price imbalance where the wick of the first candle doesn't overlap with the wick of the third candle, creating a "gap" in price. These zones often act as support/resistance areas where price tends to return to rebalance.
Key Features:
Dual FVG Timeframes - Display up to two different timeframe FVGs simultaneously (e.g., M15 + 1H, or 1H + 4H)
Accurate Zone Positioning - Uses time-based positioning to ensure FVG boxes appear at the correct location regardless of your chart timeframe
Auto-Fill Detection - Zones automatically disappear when price fully trades through them
Lookback Limit - Remove old zones after a configurable number of bars (M15+ timeframes)
Max Zones Control - Limit the number of displayed zones to keep your chart clean
Fully Customizable - Separate colors for bullish/bearish zones, border width, and label settings
Works on Any Chart Type - Uses standard OHLC data, so it works correctly even on Heikin Ashi charts
Settings:
FVG 1 (Primary)
Timeframe selection (leave empty for chart timeframe)
Max zones, lookback limit
Bullish/Bearish fill and border colors
Border width
FVG 2 (Secondary - Optional)
Enable/disable toggle
Independent timeframe, colors, and zone limits
Perfect for multi-timeframe confluence analysis
Labels
Show/hide timeframe labels
Customizable label size and colors
How to Use:
Set FVG 1 to your entry timeframe (e.g., M15)
Enable FVG 2 and set it to a higher timeframe (e.g., 1H or 4H)
Look for confluence where lower timeframe FVGs align with higher timeframe FVGs
Use unfilled FVG zones as potential support/resistance levels
Tips:
Bullish FVGs (green) tend to act as support - look for long entries
Bearish FVGs (gray/orange) tend to act as resistance - look for short entries
Higher timeframe FVGs carry more significance
Unfilled FVGs from the current session are more relevant than older ones
Market Structure HH, HL, LH and LL (MOONZOFF)📈 Market Structure HH, HL, LH and LL (Body-Based)
🔍 Description
The Market Structure HH, HL, LH and LL (Body-Based) indicator automatically identifies and plots market structure using candle body prices (open and close) instead of wicks.
This provides a more reliable structure reading by filtering out liquidity spikes, stop hunts, and volatility noise often caused by long wicks.
The indicator detects:
✅ Higher Highs (HH)
✅ Higher Lows (HL)
✅ Lower Highs (LH)
✅ Lower Lows (LL)
and connects swing points with a ZigZag structure line to visualize trend direction and swing flow clearly.
⚙️ How It Works
The indicator scans price using a customizable ZigZag Length to find swing points.
Instead of using candle highs and lows (wicks), it uses:
Body High = max(open, close)
Body Low = min(open, close)
A trend change occurs when price breaks the previous swing range using body prices.
Each new swing is classified automatically as:
HH / HL → Bullish structure
LH / LL → Bearish structure
Labels are plotted directly on the chart for easy visual confirmation.
🎯 Why Use Body-Based Structure?
Using candle bodies helps:
✔️ Reduce false breakouts caused by wick manipulation
✔️ Improve structure clarity during volatile sessions
✔️ Better reflect true market acceptance levels
✔️ Align more accurately with institutional price delivery concepts
This is especially useful for:
📊 Day trading and scalping
📉 Market structure trading (ICT, SMC, Wyckoff)
⚡ High-volatility instruments (Forex, Indices, Crypto, Gold)
🛠️ Inputs
ZigZag Length – Controls how sensitive swing detection is.
Show ZigZag – Enables or disables the swing lines.
ZigZag Line Color / Width – Visual customization.
Show Labels – Toggle HH, HL, LH, LL labels.
Text Size – Adjust label readability.
📌 Best Practice
Lower ZigZag Length → More signals (scalping).
Higher ZigZag Length → Cleaner structure (swing trading).
Combine with:
Liquidity levels
Sessions (London / NY)
Fair Value Gaps
Volume or momentum confirmation
lostsol TA v5The lostsol TA v5 is a comprehensive technical analysis toolkit that combines several institutional-grade trading concepts into a single overlay. It is designed to help you identify high-probability reversal zones, trend direction, and volume-weighted benchmarks.
Here is a breakdown of its four core systems:
1. Multi-Timeframe Order Blocks
The indicator automatically detects areas where institutional buying or selling occurred.
Smart Detection: It identifies "Order Blocks" by looking for significant volume pivots combined with specific price structures.
MTF View: You can see Order Blocks from higher timeframes (1H, 4H, and Daily) on your current chart.
Auto-Clean: The indicator automatically removes these zones once price "mitigates" them (passes through them), keeping your chart clean.
2. Adaptive Trend Channel
This is a highly sophisticated trend-following tool that uses Pearson's R correlation to find the most mathematically sound trend.
Self-Optimizing: Instead of you picking a fixed period, the indicator tests 19 different lookback lengths (from 100 to 1000 bars) and automatically selects the one that fits the current price action best.
Confidence HUD: A small table on your chart tells you how "Strong" or "Weak" the current linear trend is based on the math.
Logarithmic Calculation: It uses log-transformed price data, making it more accurate for assets like Crypto or Tech stocks that move exponentially.
3. Multi-Timeframe Moving Averages
You can plot up to 5 different moving averages from any timeframe (e.g., seeing a Daily EMA while on a 15m chart).
Multiple Types: Supports SMA, EMA, DEMA (Double EMA), VWMA, RMA, and WMA.
Auto-Labeling: Every line is automatically labeled at the price scale with its type, length, and timeframe so you never lose track of which line is which.
4. Advanced VWAP (Volume Weighted Average Price)
The indicator provides institutional benchmarks using volume data.
Triple Anchors: Displays standard Session VWAP, Weekly VWAP, and Monthly VWAP simultaneously.
Standard Deviation Bands: Includes optional volatility bands to help you identify when price is "overbought" or "oversold" relative to the volume-weighted average.
How to use this indicator
Find the Magnet: Look for price approaching a Higher Timeframe Order Block (like a 4H or Daily zone).
Confirm with Trend: Check the Adaptive Trend Channel confidence level; if it says "Strong," respect the channel boundaries.
Institutional Entry: Use the VWAP or Weekly/Monthly VWAP as your primary support/resistance for entries.
Identify Confluence: High-probability trades occur when an Order Block aligns exactly with a VWAP band or a high-timeframe EMA.
Sovereignty RS Blue Dot + VolThe Sovereignty RS Blue Dot + Vol indicator is a precision tool designed to identify "The Coiled Spring"—stocks showing institutional accumulation and market outperformance before the price breakout occurs.By filtering out market noise and focus specifically on relative strength confirmed by high-volume conviction, it helps you avoid "value traps" and "falling knives."How to Use the RS IndicatorThe indicator (located at the bottom of your panel) focuses on the relationship between your stock and the broader market ( AMEX:SPY $).The Blue Line (RS Line): This represents the stock's price divided by the AMEX:SPY $ price. If it is rising, the stock is beating the market.The Green "Blue Dot" (Top): This is your primary entry signal. It triggers when the RS Line hits a 50-day high while the price has NOT yet broken out. It signifies a "divergence" where the stock's relative value is outrunning its price.The Orange Triangles (Bottom): These indicate Volume Spikes (1.5x+ average). When these occur simultaneously with a Blue Dot, it confirms that institutions are the ones driving the strength.
Multi-Ticker Dashboard (20-Ticker % Change)Multi-Ticker Dashboard which updates based on the chart timeframe selected. Indicates a trend if it breaks previous day high or previous day low. You can add up to 20 tickers.
cg - Absorption + High VolumeThis indicator is designed to assist traders in identifying potential limit entry zones along with confirmation signals based on price behavior and technical conditions. It highlights areas where price may react, helping traders plan entries with a structured and disciplined approach.
The indicator provides both Buy Limit and Sell Limit levels, as well as confirmation signals to improve timing and trade confidence. Users can select from four different signal options, allowing flexibility for conservative or aggressive trading styles.
All signals are generated using predefined logic based on historical price data and market structure. This indicator does not predict future price movement and should be used as a decision-support tool, not as a standalone system.
Key features include multi-timeframe compatibility, customizable signal options, and broad market support including Forex, Crypto, Indices, and Stocks. It is suitable for scalping, day trading, and swing trading when combined with proper risk management.
HC HighCrew Intelligent RSI (Scout 1m-30m TF)HighCrew RSI Scout v2 extends the original RSI Scout framework by incorporating a 30-minute higher-timeframe view to provide deeper context around short-term momentum behavior.
While the standard RSI Scout focuses on short-term and intraday momentum, this extended version allows users to see further out, helping determine whether lower-timeframe reactions are occurring within a broader continuation environment or developing into a true shift in market control.
The addition of the 30-minute layer makes it easier to identify when pullbacks are structural and controlled versus when they are deep enough to threaten a full momentum transition. When both the 15-minute and 30-minute perspectives remain aligned, short-term weakness is more likely to represent a pullback rather than a reversal.
Rather than evaluating isolated price events, the system analyzes momentum behavior across time, emphasizing pressure, persistence, and response. This allows users to better understand how deep counter-moves can extend before higher-timeframe control begins to break.
This version maintains the same behavioral philosophy as the original RSI Scout while expanding its analytical scope to include longer-range momentum awareness.
This script does not provide buy/sell signals, thresholds, or execution instructions. It is designed for traders and analysts who prefer to study momentum behavior and market conditions through observation and contextual alignment rather than discrete signals.
Sri - Indian Sector-Based MACD 📊 Sri – Indian Sector-Based MACD (Closed Source)
Sri – Indian Sector-Based MACD is a sector-relative momentum framework for Indian equities that replaces traditional stock-based MACD with a dynamic sector-index MACD engine.
Unlike standard MACD indicators that calculate momentum directly from the chart symbol, this script introduces a sector-first analytical layer, allowing traders to evaluate whether a stock’s movement is supported by its parent sector’s trend strength.
🔬 What Makes This Indicator Original
1️⃣ Automatic Sector Intelligence Engine
The script uses a rule-based NSE stock-to-sector classification system covering Banking, Finance, IT, FMCG, Pharma, Auto, Metal, Energy, Infra, Realty, Defence, Telecom, Transportation, and more.
Each listed NSE stock is mapped in real time to its corresponding official NSE sector index, creating a contextual trading environment rather than an isolated price signal.
This sector-mapping logic and index-selection flow is custom-built and proprietary, which is why the source is protected.
2️⃣ Sector-Index MACD (Not Stock MACD)
Instead of applying MACD to the chart symbol:
The indicator fetches live sector-index data
Calculates Fast MA – Slow MA on the sector index
Generates MACD, Signal, and Histogram behavior derived from sector momentum
This allows traders to answer a critical question:
“Is this stock moving WITH its sector or AGAINST it?”
This structural shift—from stock-centric to sector-centric MACD—is the core originality of the script.
3️⃣ Adaptive Multi-Timeframe MACD Logic
The indicator uses an automatic timeframe translation model:
Intraday charts dynamically reference higher-timeframe sector data
Daily, weekly, and monthly charts maintain time-consistent sector momentum
Prevents noise caused by mismatched timeframes between stocks and indices
This adaptive logic is not part of standard MACD implementations.
4️⃣ Controlled Sensitivity & Structural Smoothing
To suit different market regimes, the script includes:
Sensitivity scaling of MACD output
Zero-line offset adjustment
Optional smoothed EMA of sector MACD for trend structure clarity
These controls allow traders to tune sector momentum strength, not just direction.
5️⃣ Manual Override for Advanced Users
While sector detection is automatic, users can manually override the sector index and apply the MACD engine to:
Any NSE index
Custom symbols
Macro or inter-market studies
This makes the indicator usable beyond predefined sector logic.
6️⃣ Visual Confirmation Layer
Filled MACD vs Signal zones highlight sector acceleration vs deceleration
A compact table confirms the active sector context on the chart
Color-coded background indicates whether sector detection is valid
🎯 How Traders Should Use This Indicator
This script is not a buy/sell signal generator.
It is intended for:
Trend confirmation
Sector alignment filtering
Avoiding trades against weak or reversing sectors
Sector rotation and relative strength analysis
Best used alongside:
Price action
Volume analysis
Stock-level indicators
⚠️ Important Notes
Designed for Indian NSE equities
Sector mappings are rule-based and maintained internally
Closed-source to protect custom sector-index MACD architecture
Momentum Intensity Angles Ever wanted to stick a protractor on screen to measure the angle of the momentum?
Well with this indicator, you can measure the degree of INTRADAY momentum on 5 mins timeframe (*works on all the charts, stock, commodity, forex, crypto, derivatives) , you can see on what angle the price is showing momentum. With this study you can get an estimate of the intensity of the momentum.
Note: Will work only on 5 mins timeframe, from very first candle of the intraday session. Also can change colors of the lines in indicator settings.
How to use:
0° to 30° (either side) = Sideways, no direction, avoid trading.
30° to 45°(either side) = Mild momentum.
45° to 60° (either side) = Picture Perfect 45° Momentum, respects 9 EMA.
60° to 75° (either side) = Extreme buying/Selling Pressure.
Above 75° (either side) = Extreme Momentum, one that breaks supports or resistances, Trade with caution, as sharp REVERSALS as expected.
Disclaimer/Warning: This indicator does not provide Buy/Sell signals or nor is an investment advice. This indicator solely for the purpose of study of price and its momentum. Users are responsible for their own actions, profit/loss of the users is not the liability of author.
TDL: Trendline Break Manipulation (Pivot + Trap Filter)Overview
This indicator draws pivot-based adaptive trendlines and highlights two events:
Breaks of the active trendline (“B”)
Failed breaks / trap-style reversals (“TRAP”) that often occur when price briefly breaks structure and then quickly reclaims.
How it works (concept-level)
Swing pivots: Trendlines anchor to confirmed swing highs/lows using the Swing Detection Lookback (pivot confirmation means historical placement can shift as new pivots form).
Adaptive slope: The trendline slope scales with volatility using your selected method (ATR / StDev / LinReg) multiplied by Slope, so the line adjusts to changing market conditions.
Break labels (“B”): A break prints when price crosses the active projected trendline.
Trap logic (“TRAP”): A TRAP prints only when a break is followed by a fast failure pattern:
-Pre-break compression (“chop”): the last Tight Range Lookback bars have a range smaller than ATR × Tight Range Threshold
- Reversal window: the failure occurs within Reversal Window bars after the break
Impulse confirmation: the reversal candle body is larger than Avg Body(20) × Impulse Candle Size in the opposite direction
Reclaim: price closes back through the break level (failed breakout / failed breakdown behavior)
Optional time filter: Signals can be limited to a specified ET session to reduce off-hours noise.
How to use it
Use the trendlines as a live structure guide.
Treat “B” as a structural event (breakout/breakdown) and wait for confirmation.
Treat “TRAP” as a warning that the break likely failed — helpful for avoiding late chase entries and spotting reversal risk.
Inputs
Swing Detection Lookback: fewer/stronger pivots vs more/faster pivots
Slope Calculation Method + Slope: controls volatility adaptation
Tight Range settings: controls how strict the pre-break compression filter is
Reversal Window + Impulse size: controls how selective TRAP signals are
Session filter: limits signals to chosen time window
Notes / limitations
Pivot confirmation and optional backpainting can change how historical lines/markers appear. Disable backpainting to view real-time placement.
(Not financial advice.)
Custom ATR Fast & Slow MTF + MultiplierChoose ATR Crossing and use Multi Time Frame on your chart.
Once again DYOR.
XABCD Harmonics [theUltimator5]This indicator automatically identifies common harmonic reversal structures (XABCD) directly on the chart using a pivot engine designed for real-world price action, with customizable entry, stop loss, and target points.
Visual Effects:
Point labels (X, A, B, C, D)
Ratio labels (leg-to-leg Fibonacci relationships)
A structured trade plan overlay: Entry, Stop, Target 1, Target 2 with dynamic horizontal levels that terminate when price touches them (including gap crosses)
It also supports forming pattern projections (XABC → projected D) so you can see likely completion zones before D is confirmed.
You can select between two distinct methods of pivot detection:
ATR Pivots - Average True Range (ATR) pivots use volatility to decide when a swing is “real.” Instead of waiting for a fixed number of bars, the pivot triggers when price reverses by a meaningful distance relative to current volatility.
Standard Pivots - Standard pivots behave more like a classic pivot/zigzag approach: they focus on structural highs/lows over a rolling window and register pivots when direction changes.
Your harmonic results depend heavily on pivot quality. ATR pivots are more effective in volatile and fast moving markets, while standard pivots are most effective at catching the more obvious highs and lows. Each method has strengths and weaknesses, and it is suggested that you test both to determine which best fits your trading style.
Pattern Length: Short vs Long (Sensitivity & scale)
Pattern Length controls how sensitive the pivot engine is, which changes the scale of patterns you’ll detect:
Short
More sensitive swing identification
More frequent patterns, tighter structures
Better for intraday or scalping-style harmonic setups
Long
More conservative swings
Fewer but larger patterns, cleaner legs
Better for higher timeframe swing/position setups
Harmonic Patterns
There are several hard coded harmonic patterns that this indicator identifies and plots. Each can be manually enabled or disabled.
Supported patterns are:
Butterfly, Gartley, Bat, Crab, Cypher, Shark, AB=CD, and 3-drives
All patterns are evaluated from five points: X → A → B → C → D.
Butterfly
AB/XA ≈ 0.786
BC/AB = 0.382 → 0.886
CD/BC = 1.618 → 2.618
AD/XA = 1.27 → 1.618
Gartley
AB/XA ≈ 0.618
BC/AB = 0.382 → 0.886
CD/BC = 1.272 → 1.618
AD/XA targets 0.786 (classic Gartley completion)
Bat
AB/XA = 0.382 → 0.50
BC/AB = 0.382 → 0.886
CD/BC = 1.618 → 2.618
AD/XA targets 0.886 (classic Bat completion)
Crab
AB/XA = 0.382 → 0.618
BC/AB = 0.382 → 0.886
CD/BC = 2.618 → 3.618
AD/XA targets 1.618 (deep/extreme completion)
Cypher
AB/XA = 0.382 → 0.618
BC/AB = 1.13 → 1.414
CD/BC = 1.272 → 1.618
AD/XA targets 0.786
Shark
AB/XA = 1.13 → 1.618
BC/AB = 1.618 → 2.618
CD/BC = 1.618 → 2.24
AD/XA = 0.886 → 1.13
Plus a structural rule: D must extend beyond X
(Rare pattern - no current examples)
AB=CD
AB/XA = 0.382 → 0.886 (structure filter)
BC/AB = 0.382 → 0.886
CD/AB = 0.90 → 1.10 (equality tolerance)
3-Drives
AB/XA = 0.618 → 0.786
BC/AB = 0.618 → 0.786
CD/BC = 1.27 → 1.618
Note: Some patterns are much more rare to see than other patterns due to their tight constraints. You will see a lot more AB=CD (off by default) and 3-drives patterns than anything else. This is normal. If you see too many of one pattern, you can turn it off to "de-clutter" your chart.
There are multiple labels that can be toggled on or off.
Pattern Names - (what the indicator is actually showing) are displayed below (bullish) or above (bearish) the chart pattern
Ratio Labels -
When ratio labels are enabled, the indicator prints these relationships on the chart:
XB label = AB / XA
AC label = BC / AB
BD label = CD / BC
For AB=CD, BD shows CD / AB (equality check)
XD label = AD / XA
These are computed from vertical price distance (absolute price moves), so they remain consistent regardless of time spacing.
Point Labels - These are the XABCD labels that appear on all patterns.
Custom Patterns
If you don't see a harmonic pattern that you are used to tracking, or want to try out a new harmonic ratio, you can create a custom pattern. The custom pattern uses user-defined harmonic rules for each segment.
XB Min/Max → AB/XA allowable range
AC Min/Max → BC/AB allowable range
BD Min/Max → CD/BC allowable range
XD Min/Max → AD/XA allowable range
Plus a Custom Pattern Name for labeling
You can make the pattern as crazy as you want, or keep it in line with existing theory.
When a pattern is currently forming, you can enable Show Harmonic Projections.
Showing harmonic projections uses XABC points that have already plotted and project forwards the "D" point to the ideal spot for the forming pattern.
When “Show Harmonic Projections” is OFF, the indicator only prints patterns when Point D is confirmed and structure rules validate direction:
When “Show Harmonic Projections” is ON, the indicator uses the most recent XABC structure to forwards project D.
This is meant to show “where D would be” if the structure finishes cleanly.
Trade Plan Overlay: Entry, Stop, Target 1, Target 2
Once a confirmed pattern completes at D, the indicator computes levels from the pattern’s total vertical range:
Pattern Range
The indicator defines pattern range as:
Highest price among X/A/B/C/D
minus
Lowest price among X/A/B/C/D
Level logic (bullish vs bearish)
All levels are calculated as a multiplier × pattern range offset from Point D:
Bullish
Entry is plotted above D
Stop is plotted below D
Targets are plotted above Entry
Bearish
Entry is plotted below D
Stop is plotted above D
Targets are plotted below Entry
You can fully customize entry, stop, T1, and T2 to meet your personal trading style and risk appetite.
Dynamic Level Lines (terminate-on-touch)
A core feature of this script is that Entry/SL/T1/T2 lines are not infinite.
Each horizontal level:
Extends forward from the pattern (up to your Max Number of Bars setting)
Terminates automatically when price touches it or crosses over it
Each line has outcome labels, which terminate with a check (✓) or and X (✗)
Each level receives a status label:
Entry ✓ when entry is touched
T1 ✓ / T2 ✓ when targets are achieved before a stop-out
T1 ✗ / T2 ✗ when price stops out before reaching the target
SL ✓ when the stop is actually hit
This creates a clean “story” on the chart: you can visually audit whether patterns historically reached targets or failed.
If a price move happens too quickly after a confirmed pattern and skips the entry point and first target within the same bar, the labels all turn orange and identify the pattern as a skipped pattern. If this occurs, the pattern is likely either too short to provide a wide enough range, or extreme volatility immediately preceded the pattern, giving insufficient reaction time.
Display Settings
Max extension length for Entry/Stop/Targets
Bullish/Bearish color theming
Optional historical plotting (so you can review past occurrences)
Info Table
A compact table (position configurable) displays:
Pivot Type (ATR vs Standard)
Pattern Length (Short vs Long)
Active Pattern (If there is an active pattern trading opportunity)
Alerts
The script supports alerts for:
New pattern detected
Entry touched
Stop touched
T1 touched
T2 touched
These alerts are designed to trigger at the moment the level is first interacted with (including gaps), so you can automate notifications without babysitting.
Practical tips
If you’re seeing too many patterns: switch to Long length or Standard Pivots
If you’re seeing too few patterns: switch to Short length or ATR Pivots
Use Projections when you want early warning / “PRZ watch zones”
Use the dynamic level lines for quick historical validation (targets vs failures)
Disclaimer
This indicator is a pattern-recognition and visualization tool. It does not predict the future and should not be used as financial advice. Always confirm with context (trend, structure, liquidity, higher timeframe levels, risk management).
Harmonic GridFor all Gann lovers out there!
Following on from my Harmonic Bloom indicator comes this symmetrical wonder! I have been very dissatisfied with all auto Gann indicators so i decided to build my own. Here you have a lot of flexibility to automatically plot the high and low pivots OR do it manually if you wish.
The entire thing is based on a 9 column grid. You can customise your own unique pattern and have it automatically updated.
NOTES: Due to Tradingview limitations, you might not see it always when in auto mode. There's by default a minimum number of bars required between the pivot (you can change) and this will reflect on the chart with 2 dots. You just need to match the timeframe range to display it correctly. There's also an added fib level in here that works on the grid.
The key thing to watch for here is where the angles intersect, these are called "Inflections" and represent a potential energy point where there's a strong possibility to reverse.
If you are interested in this, check out my other indicators!
Enjoy!
ELMEHDI VIP (v4.0) ABO SALTAN //@version=5
indicator(title = 'ELMEHDI VIP (v4.0) ABO SALTAN ', shorttitle = 'EL MEHDI KHEYI(v4.0)', overlay = true, max_boxes_count = 500, max_labels_count = 500, max_lines_count = 500, max_bars_back = 500, max_polylines_count = 100)
bullcolor = #339b44
bearcolor = #af3232
ema150 = ta.ema(close, 150)
ema250 = ta.ema(close, 250)
gr_customalert = "Custom Alerts"
gr_signal = "General Configurations"
gr_PullBacksignal = "Trading Assistants"
gr_RiskManage = "Risk Management"
gr_dash = "Dashboard Configurations"
//symbol info
symInfoCheck = false
symInfo = syminfo.ticker + ' | ' + timeframe.period + (timeframe.isminutes ? 'M' : na)
date = str.tostring(dayofmonth(time_close)) + '/' + str.tostring(month(time_close)) + '/' + str.tostring(year(time_close))
//text positioning
textVPosition = 'middle'
textHPosition = 'center'
//symbol info positioning
symVPosition = 'top'
symHPosition = 'left'
//cell size
width = 0
height1 = 0
//title settings
c_title = #b2b5be80
s_title = 'large'
a_title = 'center'
//subtitle settings
c_subtitle = #b2b5be80
s_subtitle = 'normal'
a_subtitle = 'center'
c_bg = color.new(color.blue, 100)
// Get user input
showSignals = input(true, "Show Signal's", group=gr_signal)
//showSignals = true
sensitivity = input.float(2.4, "Sensitivity", 0.1, step=0.1, group=gr_signal)
STuner = input.int(10, "Signal Tuner(1-25)", minval = 1, maxval = 25, group=gr_signal)
Presets = "All Signals"
//Presets = input.string("All Signals", "Presets", , group=gr_signal)
filterstyle = input.string("Trending Signals ", "Signal Mode / Filters", ["Trending Signals ", "Contrarian Signals ", "High Volume ", "Strong ", "Swing ", "Smooth ", "Scalping ", "Scalping+ "], group=gr_signal)
//TextStyle = input.string("Minimal", "Signal Style", , group=gr_signal)
//periodTrendCloud = input.string("Smooth", "Trend Cloud Style", , group=gr_Other_Settings)
TextStyle = "Minimal"
consSignalsFilter = filterstyle == "Trending Signals " ? true : false
StrongSignalsOnly = filterstyle == "Strong " ? true : false
highVolSignals = filterstyle == "High Volume " ? true : false
signalsTrendCloud = (filterstyle == "Smooth ") ? true : (filterstyle == "Scalping ") ? true : (filterstyle == "Scalping+ ") ? true : (filterstyle == "Swing ") ? true : false
ContrarianOnly = filterstyle == "Contrarian Signals " ? true : false
TrendMap = 'Trend Gradient'
momentumCandles = false
assistantenable = input(true,'', group=gr_PullBacksignal, inline = 'sexyshit')
assistantmode = input.string('Trend Assistant', 'Assistant | Mode', , group = gr_PullBacksignal, inline = 'sexyshit')
Show_PR = input.bool(true, title="", group = gr_PullBacksignal , inline = "Features1")
MSTuner = input.int(8, "Reversal Dot | Tuner(2-30)", minval = 2, maxval = 30, group=gr_PullBacksignal, inline = "Features1")
LongTrendAverage = assistantmode == 'Trend Tracker' and assistantenable == true ? true : false
analyscloud = assistantmode == 'Trend Assistant' and assistantenable == true ? true : false
showTrendCloud = (filterstyle == "Smooth ") ? true : (filterstyle == "Scalping ") ? true : (filterstyle == "Scalping+ ") ? true : (filterstyle == "Swing ") ? true : false
periodTrendCloud = (filterstyle == "Smooth ") ? "Smooth" : (filterstyle == "Scalping ") ? "Scalping" : (filterstyle == "Scalping+ ") ? "Scalping+" : (filterstyle == "Swing ") ? "Swing" : na
//ScalpingPlus = input(false, "Fast trend cloud", group=gr_Other_Settings)
//fastTrendCloudLen = input.int(55, "Fast trend cloud", 2, group=gr_Other_Settings)
fill(plot(showTrendCloud and periodTrendCloud == "Smooth" ? na : assistantenable == true and assistantmode == 'Trend Tracker' ? ema150 : na, "", na, editable=false), plot(showTrendCloud and periodTrendCloud == "Smooth" ? na : assistantenable == true and assistantmode == 'Trend Tracker' ? ema250 : na, "", na, editable=false), ema150 > ema250 ? color.new(bullcolor, 70) : ema150 < ema250 ? color.new(bearcolor, 70) : na)
showDashboard = input(true, "Smart Panel", group = gr_dash , inline = "Features1")
locationDashboard = input.string("Bottom Right", "Dashboard Location", , group = gr_dash , tooltip="Smart Panel")
sizeDashboard = input.string("Small", "Dashboard Size", , group = gr_dash , tooltip="Smart Panel")
tpLabels = input(true, "Dynamic Take Profit Lables", group=gr_RiskManage)
ShowTpSlAreas = input(true, "Show take Profit/Stop-loss Area", group=gr_RiskManage)
ShowTrailingSL = input(false, "Show trailing Stop-loss", group=gr_RiskManage)
usePercSL = input(false, "SL/TRAILING", inline="1", group=gr_RiskManage)
percTrailingSL = input.float(1, "", 0, step=0.1, inline="1", group=gr_RiskManage)
useTP1 = input(true, "", inline="1", group=gr_RiskManage)
multTP1 = input.float(1, "TP 1", 0, inline="1", group=gr_RiskManage)
useTP2 = input(true, "", inline="4", group=gr_RiskManage)
multTP2 = input.float(2, "TP 2", 0, inline="4", group=gr_RiskManage)
useTP3 = input(true, "", inline="4", group=gr_RiskManage)
multTP3 = input.float(3, "TP 3", 0, inline="4", group=gr_RiskManage)
ShowSwings = input(false, "Show Market Structure", inline="3", group=gr_RiskManage)
periodSwings = input.int(10, "", 2, inline="3", group=gr_RiskManage)
//showTS = input(title='Show Trend Shifter', defval=false, group='Contrarian SIGNALS')
// showsignals = input(title='Show Signals', defval=false, group='Contrarian SIGNALS')
// Alerts Managemnt
Normalbuy_alert = input.bool(title='Buy Signal', defval=false, inline = "NB", group=gr_customalert)
Strongbuy_alert = input.bool(title='Strong Buy', defval=true, inline = "NB", group=gr_customalert)
Normalsell_alert = input.bool(title='Sell Signal', defval=false , inline = "NS", group=gr_customalert)
Strongsell_alert = input.bool(title='Strong Sell', defval=true , inline = "NS", group=gr_customalert)
slalert = input.bool(title='Stop-Loss', defval=true , inline = "SLTP1", group=gr_customalert)
tp1alert = input.bool(title='Target 1', defval=true , inline = "SLTP1", group=gr_customalert)
tp2alert = input.bool(title='Target 2', defval=true , inline = "TP2TP3", group=gr_customalert)
tp3alert = input.bool(title='Target 3', defval=true , inline = "TP2TP3", group=gr_customalert)
bullcrosscloud_alert = input.bool(title='Bullish Cloud', defval=false, inline = "CD", group=gr_customalert)
bearcrosscloud_alert = input.bool(title='Bearish Cloud', defval=false, inline = "CD", group=gr_customalert)
showCons = false
paintCons = false
// Signal Text
SimpleBuy = "Buy"
StrongB = "Strong Buy"
SimpleSell = "Sell"
StrongS = "Strong Sell"
if TextStyle == "Normal"
SimpleBuy := "Buy"
StrongB := "BUY"
SimpleSell:= "Sell"
StrongS := "Strong Sell"
if TextStyle == "Minimal"
SimpleBuy := "⬆️"
StrongB := "⬆️⬆️"
SimpleSell:= "⬇️"
StrongS := "⬇️⬇️"
// Signal Text Color
// bullsignalcolor = #ffffff
// bearsignalcolor = color.rgb(255, 255, 255)
// if TextStyle == "Normal"
// bullsignalcolor := color.rgb(255, 255, 255)
// bearsignalcolor := color.rgb(255, 255, 255)
// if TextStyle == "Minimal"
// bullsignalcolor := color.rgb(255, 255, 255)
// bearsignalcolor := color.rgb(255, 255, 255)
src = close
RSII = ta.ema(ta.rsi(src, 50), 30)
TR = math.abs(RSII - RSII )
wwalpha = 1 / 50
WWMA = 0.0
WWMA := wwalpha * TR + (1 - wwalpha) * nz(WWMA )
ATRRSI = 0.0
ATRRSI := wwalpha * WWMA + (1 - wwalpha) * nz(ATRRSI )
TsFast = ta.ema(ta.rsi(src, 50), 30)
TsUP = TsFast + ATRRSI * 4.236
TsDN = TsFast - ATRRSI * 4.236
textWatermark = table.new(textVPosition + '_' + textHPosition, 1, 3)
TsSlow = 0.0
TsSlow := TsUP < nz(TsSlow ) ? TsUP : TsFast > nz(TsSlow ) and TsFast < nz(TsSlow ) ? TsDN : TsDN > nz(TsSlow ) ? TsDN : TsDN < nz(TsSlow ) and TsFast > nz(TsSlow ) ? TsUP : nz(TsSlow )
Colorh = TsFast > 55 ? color.rgb(255, 0, 0) : TsFast < 45 ? color.rgb(0, 255, 8) : #ffffff
//QQF = plot(TsFast, 'TS FAST', color=color.new(color.maroon, 100), linewidth=2, display=display.none, editable = false)
//QQS = plot(TsSlow, 'TS SLOW', color=color.new(color.white, 100), linewidth=2, display=display.none , editable = false)
//plot(TsFast, color=Colorh, linewidth=2, style=plot.style_area, histbase=50)
//BearLimit = hline(60, color=color.gray, linestyle=hline.style_dashed)
//BullLimt = hline(40, color=color.gray, linestyle=hline.style_dashed)
bulllim = 45
bearlim = 55
BullSignalr = ta.crossover(TsFast, TsSlow) and TsFast < bulllim
BearSignallr = ta.crossunder(TsFast, TsSlow) and TsFast > bearlim
/////////////////////////////////////////////////////////
// Trap Detector
////////////////////////////////////////////////////////
// Functions
wavetrend(src, chlLen, avgLen) =>
esa = ta.ema(src, chlLen)
d = ta.ema(math.abs(src - esa), chlLen)
ci = (src - esa) / (0.015 * d)
wt1 = ta.ema(ci, avgLen)
wt2 = ta.sma(wt1, 3)
f_top_fractal(src) => src < src and src < src and src > src and src > src
f_bot_fractal(src) => src > src and src > src and src < src and src < src
f_fractalize (src) => f_top_fractal(src) ? 1 : f_bot_fractal(src) ? -1 : 0
f_findDivs(src, topLimit, botLimit) =>
fractalTop = f_fractalize(src) > 0 and src >= topLimit ? src : na
fractalBot = f_fractalize(src) < 0 and src <= botLimit ? src : na
highPrev = ta.valuewhen(fractalTop, src , 0)
highPrice = ta.valuewhen(fractalTop, high , 0)
lowPrev = ta.valuewhen(fractalBot, src , 0)
lowPrice = ta.valuewhen(fractalBot, low , 0)
bearSignal = fractalTop and high > highPrice and src < highPrev
bullSignal = fractalBot and low < lowPrice and src > lowPrev
// Get components
= wavetrend(close, 5*MSTuner, 10*MSTuner)
= f_findDivs(wt2, 10, -35)
= f_findDivs(wt2, 40, -70)
wtDivBull = wtDivBull1 or wtDivBull2
wtDivBear = wtDivBear1 or wtDivBear2
plotshape(ta.crossover(wt1, wt2) and Show_PR and wt2 <= -60)
plotshape(ta.crossunder(wt1, wt2) and Show_PR and wt2 >= 60)
rsi = ta.rsi(close ,14)
// Functions
f_chartTfInMinutes() =>
float _resInMinutes = timeframe.multiplier * (
timeframe.isseconds ? 1. / 60 :
timeframe.isminutes ? 1. :
timeframe.isdaily ? 60. * 24 :
timeframe.isweekly ? 60. * 24 * 7 :
timeframe.ismonthly ? 60. * 24 * 30.4375 : na)
atr(len) =>
tr = ta.tr
atr = 0.0
atr := nz(atr + (tr - atr ) / len, tr)
supertrend(src, factor, len) =>
atr = ta.atr(len)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or close < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend
if prevSuperTrend == prevUpperBand
direction := close > upperBand ? 1 : -1
else
direction := close < lowerBand ? -1 : 1
superTrend := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
dchannel(len)=>
hh = ta.highest(len)
ll = ta.lowest (len)
trend = 0
trend := close > hh ? 1 : close < ll ? -1 : nz(trend )
trendScalper(show, len1, len2, len3, colorBull, colorBear, colorBarBull, colorBarBear) =>
avgOC = math.avg(open, close)
ha_o = 0.0, ha_o := na(ha_o ) ? avgOC : (ha_o + ohlc4 ) / 2
ema1 = ta.ema(ha_o, len1), ema2 = ta.ema(ha_o, len2), ema3 = ta.ema(ha_o, len3)
ris1 = ema1 > ema1 , ris2 = ema2 > ema2 , ris3 = ema3 > ema3
fal1 = ema1 < ema1 , fal2 = ema2 < ema2 , fal3 = ema3 < ema3
colorEma1 = ris1 ? colorBull : fal1 ? colorBear : na, colorEma2 = ris2 ? colorBull : fal2 ? colorBear : na, colorEma3 = ris3 ? colorBull : fal3 ? colorBear : na
fillEma1 = avgOC > ema1 ? colorBull : avgOC < ema1 ? colorBear : na, fillEma2 = ema1 > ema2 ? colorBull : ema1 < ema2 ? colorBear : na, fillEma3 = ema2 > ema3 ? colorBull : ema2 < ema3 ? colorBear : na
colorBar = close < ema1 and close < ema2 ? colorBarBear : colorBarBull
candlesMom() =>
= ta.macd(close, 2, 4, 3)
(macd > 10 and macd > macd ) or (macd < 10 and macd < macd )
trailingSL(buy, sell, factor, len, usePerc, perc) =>
atr = atr(len)
upperBand = high + (usePerc ? high * (perc / 100) : factor * atr)
lowerBand = low - (usePerc ? low * (perc / 100) : factor * atr)
prevLowerBand = nz(lowerBand )
prevUpperBand = nz(upperBand )
lowerBand := lowerBand > prevLowerBand or buy ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or sell ? upperBand : prevUpperBand
int direction = na
float stop = na
prevSuperTrend = stop
if prevSuperTrend == prevUpperBand
direction := buy ? 1 : -1
else
direction := sell ? -1 : 1
stop := direction == 1 ? lowerBand : direction == -1 ? upperBand : na
add_to_zz(zz, val, bi) =>
array.unshift(zz, bi)
array.unshift(zz, val)
if array.size(zz) > 12
array.pop(zz)
update_zz(zz, val, bi, dir) =>
if array.size(zz) == 0
add_to_zz(zz, val, bi)
else
if dir == 1 and val > array.get(zz, 0) or dir == -1 and val < array.get(zz, 0)
array.set(zz, 0, val)
array.set(zz, 1, bi)
0
// Get components
vosc = ta.obv - ta.ema(ta.obv, 20)
bs = ta.ema(nz(math.abs((open - close) / (high - low) * 100)), 3)
ema = ta.ema(close, 200)
emaBull = close > ema
equal_tf(res) => str.tonumber(res) == f_chartTfInMinutes()
higher_tf(res) => str.tonumber(res) > f_chartTfInMinutes()
too_small_tf(res) => (timeframe.isweekly and res=="1") or (timeframe.ismonthly and str.tonumber(res) < 10)
securityNoRep(sym, res, src) =>
bool bull = na
bull := equal_tf(res) ? src : bull
bull := higher_tf(res) ? request.security(sym, res, src, barmerge.gaps_off, barmerge.lookahead_off) : bull
bull_array = request.security_lower_tf(syminfo.tickerid, higher_tf(res) ? str.tostring(f_chartTfInMinutes()) : too_small_tf(res) ? (timeframe.isweekly ? "3" : "10") : res, src)
if array.size(bull_array) > 1 and not equal_tf(res) and not higher_tf(res)
bull := array.pop(bull_array)
array.clear(bull_array)
bull
//TF1Bull = securityNoRep(syminfo.tickerid, "1" , emaBull)
//TF3Bull = securityNoRep(syminfo.tickerid, "3" , emaBull)
TF5Bull = securityNoRep(syminfo.tickerid, "5" , emaBull)
//TF10Bull = securityNoRep(syminfo.tickerid, "10" , emaBull)
TF15Bull = securityNoRep(syminfo.tickerid, "15" , emaBull)
TF30Bull = securityNoRep(syminfo.tickerid, "30" , emaBull)
TF60Bull = securityNoRep(syminfo.tickerid, "60" , emaBull)
//TF120Bull = securityNoRep(syminfo.tickerid, "120" , emaBull)
TF240Bull = securityNoRep(syminfo.tickerid, "240" , emaBull)
//TF720Bull = securityNoRep(syminfo.tickerid, "720" , emaBull)
//TFDBull = securityNoRep(syminfo.tickerid, "1440", emaBull)
hma55 = ta.hma(close, 55 )
= ta.macd(close, 12, 26, 9)
supertrend = supertrend(close, sensitivity, STuner)
maintrend = dchannel(30)
confBull = (ta.crossover (close, supertrend) or (ta.crossover (close, supertrend) and maintrend < 0)) and macd > 0 and macd > macd and ema150 > ema250 and hma55 > hma55 and maintrend > 0
confBear = (ta.crossunder(close, supertrend) or (ta.crossunder(close, supertrend) and maintrend > 0)) and macd < 0 and macd < macd and ema150 < ema250 and hma55 < hma55 and maintrend < 0
trendcloud = supertrend(ohlc4, periodTrendCloud == "Swing" ? 7 : 4, 10)
hma = periodTrendCloud == "Scalping+" ? ta.hma(close, 55) : na
none = close > 0
= ta.dmi(14, 14)
consFilter = adx > 20
ContBear = TsFast > 65
ContBull = TsFast < 35
StrongFilter = ta.ema(close, 200)
//volFilter = (ta.ema(volume, 25) - ta.ema(volume, 26)) / ta.ema(volume, 26) > 0
volFilter = (ta.ema(volume, 15) - ta.ema(volume, 20)) / ta.ema(volume, 25) > 0
trendFilter = trendcloud
bull = (Presets == "All Signals" ? ta.crossover (close, supertrend) : confBull and not confBull ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close > StrongFilter : none) and (ContrarianOnly ? ContBull : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 > ema250 : close > trendFilter) : none)
bear = (Presets == "All Signals" ? ta.crossunder(close, supertrend) : confBear and not confBear ) and Presets != "Trend Scalper" and (StrongSignalsOnly ? close < StrongFilter : none) and (ContrarianOnly ? ContBear : none) and (consSignalsFilter ? consFilter : none) and (highVolSignals ? volFilter : none) and (signalsTrendCloud ? (periodTrendCloud == "Smooth" ? ema150 < ema250 : close < trendFilter) : none)
countBull = ta.barssince(bull)
countBear = ta.barssince(bear)
trigger = nz(countBull, bar_index) < nz(countBear, bar_index) ? 1 : 0
= trendScalper(Presets == "Trend Scalper" ? true : false, 5, 9, 21, bullcolor, bearcolor, bullcolor, bearcolor)
trailingStop = trailingSL(bull, bear, 2.2, 14, usePercSL, percTrailingSL)
float _ph = ta.highestbars(high, periodSwings) == 0 ? high : na
float _pl = ta.lowestbars (low, periodSwings) == 0 ? low : na
var _dir = 0, dir_ = _pl and na(_ph) ? -1 : _dir, _dir := _ph and na(_pl) ? 1 : dir_, dirChg = ta.change(_dir)
var zz = array.new_float(0), zzOld = array.copy(zz)
float zzLive = _ph or _pl ? (dirChg ? add_to_zz(zz, _dir == 1 ? _ph : _pl, bar_index) : update_zz(zz, _dir == 1 ? _ph : _pl, bar_index, _dir)) : na
float hb_ = ta.highestbars(10) == 0 ? high : na
float lb_ = ta.lowestbars (10) == 0 ? low : na
var int dir = 0
float zz_ = na
float pp = na
var int consCnt = 0
var float condHi = na
var float condLo = na
float H_ = ta.highest(5)
float L_ = ta.lowest (5)
var line lineUp = na
var line lineDn = na
bool breakUp = false
bool breakDn = false
var float pvh1_price = array.new_float(1000, na)
var int pvh1_time = array.new_int (1000, na)
var float pvl1_price = array.new_float(1000, na)
var int pvl1_time = array.new_int (1000, na)
var float pvh2_price = array.new_float(1000, na)
var int pvh2_time = array.new_int (1000, na)
var float pvl2_price = array.new_float(1000, na)
var int pvl2_time = array.new_int (1000, na)
var float htcmrll_price = na
var int htcmrll_time = na
var float ltcmrhh_price = na
var int ltcmrhh_time = na
var box long_boxes = array.new_box()
var box short_boxes = array.new_box()
var float temp_pv_0 = na
var float temp_pv_1 = na
var float temp_pv_2 = na
bool pvh = high < high and high > high
bool pvl = low > low and low < low
int pv1_time = bar_index
float pv1_high = high
float pv1_low = low
var buyBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(buyBars, i))
var sellBars = array.new_box(365, na)
for i = 0 to 364
box.delete(array.get(sellBars, i))
// Colors
green = bullcolor, green50 = color.new(green, 50), green20 = color.new(green, 80)
red = bearcolor, red50 = color.new(red, 50), red20 = color.new(red, 80)
silver = #B2B5BE, silver50 = color.new(silver, 50), silver20 = color.new(silver, 80)
// Plots
atrBand = usePercSL ? (trigger ? low : high) * (percTrailingSL / 100) : ta.atr(14) * 2.2
atrStop = trigger ? low - atrBand : high + atrBand
lastTrade(src) => ta.valuewhen(bull or bear, src, 0)
entry_y = lastTrade(close)
stop_y = lastTrade(atrStop)
tp1_y = (entry_y-lastTrade(atrStop))*multTP1 + entry_y
tp2_y = (entry_y-lastTrade(atrStop))*multTP2 + entry_y
tp3_y = (entry_y-lastTrade(atrStop))*multTP3 + entry_y
labelTpSl(cond, y, txt, color) =>
label labelTpSl = ShowTpSlAreas and cond ? label.new(bar_index + 1, y, txt, xloc.bar_index, yloc.price, color, label.style_label_left, color.white, size.normal) : na
label.delete(labelTpSl )
labelTpSl(none, entry_y, "Entry : " + str.tostring(math.round_to_mintick(entry_y)), #089981)
labelTpSl(none, stop_y , "Stop loss : " + str.tostring(math.round_to_mintick(atrStop)), bearcolor)
labelTpSl(useTP1 and multTP1 != 0, tp1_y, "TP 1 : " + str.tostring(math.round_to_mintick(tp1_y)), #089981)
labelTpSl(useTP2 and multTP2 != 0, tp2_y, "TP 2 : " + str.tostring(math.round_to_mintick(tp2_y)), #089981)
labelTpSl(useTP3 and multTP3 != 0, tp3_y, "TP 3 : " + str.tostring(math.round_to_mintick(tp3_y)), #089981)
lineTpSl(cond, y, color, style) =>
line lineTpSl = ShowTpSlAreas and cond ? line.new(bar_index - (trigger ? countBull : countBear), y, bar_index + 1, y, xloc.bar_index, extend.none, color, style) : na
line.delete(lineTpSl )
lineTpSl(none, entry_y, #089981, line.style_dashed)
lineTpSl(none, stop_y , bearcolor , line.style_solid )
lineTpSl(useTP1 and multTP1 != 0, tp1_y, bullcolor, line.style_dotted)
lineTpSl(useTP2 and multTP2 != 0, tp2_y, bullcolor, line.style_dotted)
lineTpSl(useTP3 and multTP3 != 0, tp3_y, bullcolor, line.style_dotted)
//buy = showSignals and bull ? label.new(bar_index, low , close > StrongFilter ? StrongB : SimpleBuy , xloc.bar_index, yloc.belowbar, bullcolor, label.style_label_up , color.rgb(255, 255, 255), size.normal) : na
//sell = showSignals and bear ? label.new(bar_index, high, close < StrongFilter ? StrongS : SimpleSell , xloc.bar_index, yloc.abovebar, bearcolor , label.style_label_down, color.rgb(255, 255, 255), size.normal) : na
buy = (showSignals and bull ? label.new(bar_index, low , close > StrongFilter ? StrongB : SimpleBuy , xloc.bar_index, yloc.belowbar, bullcolor, label.style_label_up , color.rgb(255, 255, 255), size.normal) : na)
sell = showSignals and bear ? label.new(bar_index, high, close < StrongFilter ? StrongS : SimpleSell , xloc.bar_index, yloc.abovebar, bearcolor , label.style_label_down, color.rgb(255, 255, 255), size.normal) : na
tpLabels(tp) =>
tp1Bull = ta.crossover (rsi, 70), tp2Bull = ta.crossover (rsi, 75), tp3Bull = ta.crossover (rsi, 80)
tp1Bull := tp1Bull and (nz(ta.barssince(tp1Bull) , 9999) > countBull), tp2Bull := tp2Bull and (ta.barssince(tp1Bull) <= countBull), tp2Bull := tp2Bull and (nz(ta.barssince(tp2Bull) , 9999) > countBull), tp3Bull := tp3Bull and (ta.barssince(tp2Bull) <= countBull), tp3Bull := tp3Bull and (nz(ta.barssince(tp3Bull) , 9999) > countBull)
tp1Bear = ta.crossunder(rsi, 30), tp2Bear = ta.crossunder(rsi, 25), tp3Bear = ta.crossunder(rsi, 20)
tp1Bear := tp1Bear and (nz(ta.barssince(tp1Bear) , 9999) > countBear), tp2Bear := tp2Bear and (ta.barssince(tp1Bear) <= countBear), tp2Bear := tp2Bear and (nz(ta.barssince(tp2Bear) , 9999) > countBear), tp3Bear := tp3Bear and (ta.barssince(tp2Bear) <= countBear), tp3Bear := tp3Bear and (nz(ta.barssince(tp3Bear) , 9999) > countBear)
if Presets != "Trend Scalper" and tpLabels
trigger ? (tp == 1 ? tp1Bull : tp == 2 ? tp2Bull : tp3Bull) : (tp == 1 ? tp1Bear : tp == 2 ? tp2Bear : tp3Bear)
plotshape(tpLabels(1), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 1", trigger ? green : na , true)
plotshape(tpLabels(2), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 2", trigger ? green : na , false)
plotshape(tpLabels(3), "", shape.xcross, location.abovebar, trigger ? green : na , 0, "TP 3", trigger ? green : na , false)
plotshape(tpLabels(1), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 1", trigger ? na : red, true)
plotshape(tpLabels(2), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 2", trigger ? na : red, false)
plotshape(tpLabels(3), "", shape.xcross, location.belowbar, trigger ? na : red, 0, "TP 3", trigger ? na : red, false)
var label zzLabel = na
if array.size(zz) > 12 and ShowSwings
if array.get(zz, 0) != array.get(zzOld, 0) or array.get(zz, 1) != array.get(zzOld, 1)
if array.get(zz, 2) == array.get(zzOld, 2) and array.get(zz, 3) == array.get(zzOld, 3)
label.delete(zzLabel)
zzLabel := label.new(math.round(array.get(zz, 1)), array.get(zz, 0), _dir == 1 ? array.get(zz, 0) > array.get(zz, 4) ? ((array.get(zz, 4) < array.get(zz, 8)) ? "High" : "HH") : "LH" : array.get(zz, 0) < array.get(zz, 4) ? ((array.get(zz, 4) > array.get(zz, 8)) ? "Low" : "LL") : "HL", xloc.bar_index, yloc.price, color.new(color.white, 100), _dir == 1 ? label.style_label_down : label.style_label_up, _dir == 1 ? bullcolor : bearcolor)
if showCons and barstate.isconfirmed
dir := hb_ and na(lb_) ? 1 : lb_ and na(hb_) ? -1 : dir
if hb_ and lb_
if dir == 1
zz_ := hb_
else
zz_ := lb_
else
zz_ := hb_ ? hb_ : lb_ ? lb_ : na
for x = 0 to 1000
if na(close) or dir != dir
break
if zz_
if na(pp)
pp := zz_
else
if dir == 1 and zz_ > pp
pp := zz_
if dir == -1 and zz_ < pp
pp := zz_
if pp != pp
if consCnt > 5
if pp > condHi
breakUp := true
if pp < condLo
breakDn := true
if consCnt > 0 and pp <= condHi and pp >= condLo
consCnt += 1
else
consCnt := 0
else
consCnt += 1
if consCnt >= 5
if consCnt == 5
condHi := H_
condLo := L_
else
line.delete(lineUp)
line.delete(lineDn)
condHi := math.max(condHi, high)
condLo := math.min(condLo, low )
lineUp := line.new(bar_index, condHi , bar_index - consCnt, condHi , color=bearcolor , style=line.style_dashed)
lineDn := line.new(bar_index, condLo , bar_index - consCnt, condLo , color=color.lime, style=line.style_dashed)
fill(plot(condHi, "", na, 1, plot.style_stepline, editable=false), plot(condLo, "", na, 1, plot.style_stepline, editable=false), paintCons and consCnt > 5 ? color.white : na, "", false)
//buy_col = color.new(#0ac20a,0)
//sell_col = color.new(#fd1605,0)
//text_col = color.new(#FFFFFF,0)
// -------- Bearish trend (blue) color selection --------
// getSellColor(count) =>
// if count == 1
// color.new(#11e7f2,0)
// else
// if count == 2
// color.new(#11d9f2,0)
// else
// if count == 3
// color.new(#11cbf2,0)
// else
// if count == 4
// color.new(#11aff2,0)
// else
// if count == 5
// color.new(#1193f2,0)
// else
// if count == 6
// color.new(#1176f2,0)
// else
// if count == 7
// color.new(#105df4,0)
// else
// if count == 8
// color.new(#1051f5,0)
// else
// if count == 9
// color.new(#0f44f5,0)
// else
// if count == 10
// color.new(#0c3de0,0)
// else
// if count == 11
// color.new(#0935ca,0)
// else
// if count == 12
// color.new(#062eb4,0)
// else
// if count == 13
// color.new(#02269e,0)
// -------- Bullish trend (blue) color selection --------
// getBuyColor(count) =>
// if count == 1
// color.new(#eef211,0)
// else
// if count == 2
// color.new(#efdc11,0)
// else
// if count == 3
// color.new(#f0c511,0)
// else
// if count == 4
// color.new(#f1af11,0)
// else
// if count == 5
// color.new(#f29811,0)
// else
// if count == 6
// color.new(#f28811,0)
// else
// if count == 7
// color.new(#f27811,0)
// else
// if count == 8
// color.new(#f26811,0)
// else
// if count == 9
// color.new(#f25811,0)
// else
// if count == 10
// color.new(#ea420d,0)
// else
// if count == 11
// color.new(#e12c09,0)
// else
// if count == 12
// color.new(#d81605,0)
// else
// if count == 13
// color.new(#cf0000,0)
// -------- Calculate bearish trend sequence --------
buySetup = 0
buySetup := close < close ? buySetup == 13 ? 1 : buySetup + 1 : 0
// -------- Calculate bullish trend sequence --------
sellSetup = 0
sellSetup := close > close ? sellSetup == 13 ? 1 : sellSetup + 1 : 0
// -------- Paint bars --------
//barColour = buySetup >= 1 ? getBuyColor(buySetup) : sellSetup >= 1 ? getSellColor(sellSetup) : na
// Candle Coloring
// Input
FastteyLength = 12
SjlowLeyLength = 26
srrrc = close
signalXLength = 9
// Data reference
= ta.macd(srrrc, FastteyLength, SjlowLeyLength, signalXLength)
// 4 level of green
greenHigh = #7bff00
greenMidHigh = #7bff00
greenMidLow = #7bff00
greenLow = #7bff00
// Yellow
yellowLow = #693d8e
// 4 level of red
redHigh = #ff0000
redMidHigh = #ff0000
redMidLow = #ff0000
redLow = #ff0000
// Default color
candleBody = yellowLow
// Ranging trend
if histX > 0
if histX > histX and histX > 0
candleBody := greenLow
if histX < 0
if histX < histX and histX < 0
candleBody := redLow
// Bullish trend
if MacdX > 0 and histX > 0
candleBody := greenMidLow
if histX > histX and MacdX > 0 and histX > 0
candleBody := greenMidHigh
if histX > histX and MacdX > 0 and histX > 0
candleBody := greenHigh
// Bearish trend
if MacdX < 0 and histX < 0
candleBody := redMidLow
if histX < histX and MacdX < 0 and histX < 0
candleBody := redMidHigh
if histX < histX and MacdX < 0 and histX < 0
candleBody := redHigh
barcolor(candleBody)
//barcolor(TrendMap == 'RSI Gradient' ? barColour : na, title='Bar colors (heatmap)',editable=false)
//barcolor(momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false)
//plotcandle(open, high, low, close , color = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , wickcolor = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , bordercolor = momentumCandles and candlesMom() ? color.rgb(187, 187, 187) : TrendMap == 'Signal Based' ? (Presets == "Trend Scalper" ? colorBar : na(countBull) and na(countBear) ? color.gray : trigger ? bullcolor : bearcolor) : TrendMap == 'RSI Gradient' ? barColour : TrendMap == 'Trend Gradient' ? candleBody : na , editable=false , editable = false)
fill(plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema150 : na, "", na, editable=false), plot(showTrendCloud and periodTrendCloud == "Smooth" ? ema250 : na, "", na, editable=false), ema150 > ema250 ? color.new(bullcolor, 70) : ema150 < ema250 ? color.new(bearcolor, 70) : na)
plot(ShowTrailingSL and trigger and nz(ta.barssince(low < trailingStop), bar_index) > countBull ? trailingStop : na, "", green, 1, plot.style_linebr, editable=false)
plot(ShowTrailingSL and not trigger and nz(ta.barssince(high > trailingStop), bar_index) > countBear ? trailingStop : na, "", red , 1, plot.style_linebr, editable=false)
p0 = plot(avgOC, "", na , editable=false)
p1 = plot(ema5 , "", colorEma5 , editable=false)
p2 = plot(ema9 , "", colorEma9 , editable=false)
p3 = plot(ema21, "", colorEma21, editable=false)
plot(LongTrendAverage ? ta.ema(close, 250) : na, 'Trend Tracer', linewidth=2, color=close > ta.ema(close, 250) ? color.new(bullcolor, 45) : color.new(bearcolor, 45))
fill(p0, p1, fillEma5 )
fill(p1, p2, fillEma9 )
fill(p2, p3, fillEma21)
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close > trendcloud ? trendcloud : na, "", bullcolor, 1, plot.style_linebr, editable=false), p0, color.new(bullcolor, 90))
fill(plot(showTrendCloud and periodTrendCloud != "Smooth" and periodTrendCloud != "Scalping+" and trendcloud != 0 and close < trendcloud ? trendcloud : na, "", bearcolor , 1, plot.style_linebr, editable=false), p0, color.new(bearcolor , 90))
//fill(plot(hma, "", hma > hma ? green : hma < hma ? red : na, editable=false), plot(hma , "", hma > hma ? green : hma < hma ? red : na, editable=false), hma > hma ? green : hma < hma ? red : na)
////////////////////////////////////////////////////////////////////////////////////////////////
// Get user input
indicatorTF = "Chart"
// Functions
sqz(bbLen, bbMult, kcLen, kcMult, source) =>
upperBB = ta.sma(source, bbLen) + ta.stdev(source, bbLen) * bbMult
lowerBB = ta.sma(source, bbLen) - ta.stdev(source, bbLen) * bbMult
upperKC = ta.sma(source, kcLen) + ta.sma(ta.tr, kcLen) * kcMult
lowerKC = ta.sma(source, kcLen) - ta.sma(ta.tr, kcLen) * kcMult
sqzOn = lowerBB > lowerKC and upperBB < upperKC
sqzOff = lowerBB < lowerKC and upperBB > upperKC
qqe(rsiLen, rsiSmooth, factor, source, bbLen, bbMult) =>
rsiMa = ta.ema(ta.rsi(source, rsiLen), rsiSmooth)
delta = ta.ema(ta.ema(math.abs(ta.mom(rsiMa, 1)), rsiLen * 2 - 1), rsiLen * 2 - 1) * factor
longBand = 0.0, longBand := rsiMa > longBand and rsiMa > longBand ? math.max(longBand , rsiMa - delta) : rsiMa - delta
shortBand = 0.0, shortBand := rsiMa < shortBand and rsiMa < shortBand ? math.min(shortBand , rsiMa + delta) : rsiMa + delta
cross1 = ta.cross(rsiMa, shortBand )
cross2 = ta.cross(rsiMa, longBand )
trend = 0.0, trend := cross1 ? 1 : cross2 ? -1 : nz(trend , 1)
fastDelta = trend == 1 ? longBand : shortBand
_hist = rsiMa - 50
_line = fastDelta - 50
= ta.bb(_line, bbLen, bbMult)
// Get components
cond(_offset) =>
top = ta.highest(high, 10)
bot = ta.lowest(low, 10)
osc = ta.ema(hlc3, 5) - ta.ema(ohlc4, 20)
oscRis = osc > osc
oscFal = osc < osc
oscA0 = osc > 0
oscB0 = osc < 0
oscTop = oscFal and oscRis
oscBot = oscRis and oscFal
bullR = oscB0 and oscBot and ((osc > ta.valuewhen(oscB0 and oscBot, osc, 1) and bot < ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearR = oscA0 and oscTop and ((osc < ta.valuewhen(oscA0 and oscTop, osc, 1) and top > ta.valuewhen(oscA0 and oscTop, top, 1)))
bullH = oscB0 and oscBot and ((osc < ta.valuewhen(oscB0 and oscBot, osc, 1) and bot > ta.valuewhen(oscB0 and oscBot, bot, 1)))
bearH = oscA0 and oscTop and ((osc > ta.valuewhen(oscA0 and oscTop, osc, 1) and top < ta.valuewhen(oscA0 and oscTop, top, 1)))
= sqz(20, 2, 20, 2, close)
= qqe(6, 6, 3, close, 50, 0.001)
= qqe(6, 5, 1.618, close, 50, 1)
= ta.dmi(14, 14)
[osc , oscRis , oscFal , oscA0 , oscB0 , oscTop , oscBot , bullR , bearR , bullH , bearH , sqzOn , sqzOff , _hist1 , upper1 , lower1 , _hist2 , _line2 , tvr ]
tf = indicatorTF == "Chart" ? timeframe.period : indicatorTF == "1 minute" ? "1" : indicatorTF == "3 minutes" ? "3" : indicatorTF == "5 minutes" ? "5" : indicatorTF == "10 minutes" ? "10" : indicatorTF == "15 minutes" ? "15" : indicatorTF == "30 minutes" ? "30" : indicatorTF == "45 minutes" ? "45" : indicatorTF == "1 hour" ? "60" : indicatorTF == "2 hours" ? "120" : indicatorTF == "3 hours" ? "180" : indicatorTF == "4 hours" ? "240" : indicatorTF == "12 hours" ? "720" : indicatorTF == "1 day" ? "1D" : indicatorTF == "1 week" ? "1W" : indicatorTF == "1 month" ? "1M" : na
= request.security(syminfo.tickerid, tf, cond(indicatorTF != "Chart" and barstate.isrealtime ? 1 : 0))
//colorTVR = tvr < 15 ? #F6525F : tvr > 15 and tvr < 25 ? #B2B5BE : #66BB6A
// Plots
//plot(Presets == "Money Moves TrendVR" ? tvr : na, "", colorTVR, editable=false)
TrendText = "Trending"
if tvr < 15 and tvr < 25
TrendText := "No trend"
if tvr > 15 and tvr < 25
TrendText := "Ranging"
//------------------------------------------------------------------------------------------------------- Volatitiry
//Calculates Volatility for Dashboard
atrr = 3 * ta.atr(10)
stdAtr = 2 * ta.stdev(atrr, 20)
smaAtr = ta.sma(atrr, 20)
topAtrDev = smaAtr + stdAtr
bottomAtrDev = smaAtr - stdAtr
calcDev = (atrr - bottomAtrDev) / (topAtrDev - bottomAtrDev)
percentVol = 40 * calcDev + 30
AvrLength = 21
PercentFilter = 144
xAavrVolume = ta.rma(volume, AvrLength)
nResLess = volume * 100 / xAavrVolume < PercentFilter ? 0 : volume
nRes = nResLess
clr = close < open ? #b2b5be : #00dbff
//plot(nRes, color=clr, style=plot.style_columns, title='Volume Filter', transp=20)
VolitiText = "Inactive"
if nRes
VolitiText := "Active"
//////////////////////////////////////////
ema69 = ta.ema(close, 9)
totalSentTxt = ema69 > ema69 ? 'Bullish' : ema69 < ema69 ? 'Bearish' : 'Flat'
// INputs
//Timezones
tz_incr = 0
use_exchange = false
//------------------------------------------------------------------------------
//Settings
//-----------------------------------------------------------------------------{
//Session A
NYSes = true
NYTxt = 'New York'
NYTime = '1300-2200'
//Session B
LDSes = true
sesb_txt = 'London'
sesb_ses = '0700-1600'
//Session C
show_sesc = true
sesc_txt = 'Tokyo'
sesc_ses = '0000-0900'
//Session D
show_sesd = true
sesd_txt = 'Sydney'
sesd_ses = '2100-0600'
//-----------------------------------------------------------------------------}
//Sessions
//-----------------------------------------------------------------------------{
tff = timeframe.period
var tz = use_exchange ? syminfo.timezone :
str.format('UTC{0}{1}', tz_incr >= 0 ? '+' : '-', math.abs(tz_incr))
is_sesa = math.sign(nz(time(tff, NYTime, tz)))
is_sesb = math.sign(nz(time(tff, sesb_ses, tz)))
is_sesc = math.sign(nz(time(tff, sesc_ses, tz)))
is_sesd = math.sign(nz(time(tff, sesd_ses, tz)))
////////////////////////////////////////////
SessionText = "Default"
if is_sesd
SessionText := sesd_txt
if is_sesc
SessionText := sesc_txt
if is_sesb
SessionText := sesb_txt
if is_sesa
SessionText := NYTxt
if is_sesd and is_sesc
SessionText := "Sydney/Tokyo"
if is_sesb and is_sesc
SessionText := "Tokyo/London"
if is_sesb and is_sesa
SessionText := "London/Newyork"
if is_sesa and is_sesd
SessionText := "Newyork/Sydney"
//-----------------------------------------------------------------------------}
//Overlays color.green : color.red
//
var dashboard_loc = locationDashboard == "Top Right" ? position.top_right : locationDashboard == "Middle Right" ? position.middle_right : locationDashboard == "Bottom Right" ? position.bottom_right : locationDashboard == "Top Center" ? position.top_center : locationDashboard == "Middle Center" ? position.middle_center : locationDashboard == "Bottom Center" ? position.bottom_center : locationDashboard == "Top Left" ? position.top_left : locationDashboard == "Middle Left" ? position.middle_left : position.bottom_left
var dashboard_size = sizeDashboard == "Large" ? size.large : sizeDashboard == "Normal" ? size.normal : sizeDashboard == "Small" ? size.small : size.tiny
var dashboard = showDashboard ? table.new(dashboard_loc, 3, 7, color.rgb(0, 0, 0, 60), #3d384300, 2, color.rgb(30, 34, 45 , 60), 1) : na
dashboard_cell(column, row, txt, signal=false) => table.cell(dashboard, column, row, txt, 0, 0, signal ? #000000 : color.white, text_size=dashboard_size)
dashboard_cell_bg(column, row, col) => table.cell_set_bgcolor(dashboard, column, row, col)
if barstate.islast and showDashboard
// MTF Trend
dashboard_cell(0, 0 , "MTF")
dashboard_cell(0, 2 , "M5") , dashboard_cell_bg(0, 2 , TF5Bull ? color.rgb(70, 153, 67) : #880000)
dashboard_cell(0, 3 , "M15") , dashboard_cell_bg(0, 3 , TF15Bull ? color.rgb(70, 153, 67) : #880000)
dashboard_cell(0, 4 , "M30") , dashboard_cell_bg(0, 4 , TF30Bull ? color.rgb(70, 153, 67) : #880000)
dashboard_cell(0, 5 , "1H") , dashboard_cell_bg(0, 5 , TF60Bull ? color.rgb(70, 153, 67) : #880000)
dashboard_cell(0, 6 , "4H") , dashboard_cell_bg(0, 6 , TF240Bull ? color.rgb(70, 153, 67) : #880000)
// Middel part
dashboard_cell(1, 0 , "PoseidonPips")
dashboard_cell(1, 2 , "Market State")
dashboard_cell(1, 3 , "Volatility")
dashboard_cell(1, 4 , "Institutional Activity")
dashboard_cell(1, 5 , "Current Session (UTC)")
dashboard_cell(1, 6 , "Trend Pressure")
// End part
dashboard_cell(2, 0 , "")
dashboard_cell(2, 2 , TrendText)
dashboard_cell(2, 3 , str.tostring(percentVol, '##.##') + '%')
dashboard_cell(2, 4 , VolitiText)
dashboard_cell(2, 5 , SessionText)
dashboard_cell(2, 6 , totalSentTxt)
// Alerts
// Cross Functions for SL and TP
f_sl_crossed() =>
ret = false
crossBull = low >= ta.lowest(low, 5) and low < ta.lowest(low, 5)
crossBear = high <= ta.highest(high, 5) and high > ta.highest(high, 5)
ret := trigger ? crossBull : crossBear
ret
f_tp_crossed(tp) =>
ret = false
crossBull = high <= tp and high > tp
crossBear = low >= tp and low < tp
ret := trigger ? crossBull : crossBear
ret
// Alert Conditions
alert04 = bull and close <= StrongFilter
alert07 = bull and close > StrongFilter
alert09 = f_sl_crossed()
alert11 = f_tp_crossed(60.0)
alert12 = f_tp_crossed(80.0)
alert13 = f_tp_crossed(100.0)
alert14 = periodTrendCloud == "Smooth" ? ta.crossunder(ema150, ema250) : (close < trendcloud) and (close > trendcloud )
alert15 = periodTrendCloud == "Smooth" ? ta.crossover(ema150, ema250) : (close > trendcloud) and (close < trendcloud )
// Signal Alerts
if alert04 and Normalbuy_alert
alert('Buy Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert07 and Strongbuy_alert
alert('Strong Buy Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close >= StrongFilter) and Normalsell_alert
alert('Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if (bear and close < StrongFilter) and Strongsell_alert
alert('Strong Sell Signal Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Risk Management Alerts
if alert09 and slalert
alert('SL Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert11 and tp1alert
alert('Target 1 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert12 and tp2alert
alert('Target 2 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert13 and tp3alert
alert('Target 3 Alert !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Cloud Alerts
if alert15 and bullcrosscloud_alert
alert('Cloud Turned Bullish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
if alert14 and bearcrosscloud_alert
alert('Cloud Turned Bearish !!!', alert.freq_once_per_bar_close)
alert(syminfo.tickerid)
// Alert Conditions for TradingView
alertcondition(alert04, "Normal Buy Alert", "Normal Buy Signal")
alertcondition(alert07, "Strong Buy Alert", "Strong Buy Signal")
alertcondition((bear and close >= StrongFilter), "Normal Sell Alert", "Normal Sell Signal")
alertcondition((bear and close < StrongFilter), "Strong Sell Alert", "Strong Sell Signal")
alertcondition(alert09, "SL Crossed Alert", "Stop Loss Crossed")
alertcondition(alert11, "TP1 Crossed Alert", "Target 1 Crossed")
alertcondition(alert12, "TP2 Crossed Alert", "Target 2 Crossed")
alertcondition(alert13, "TP3 Crossed Alert", "Target 3 Crossed")
// Input
fastLength = 12
slowLength = 26
srcceed = close
signalLength = 9
// Data reference
= ta.macd(srcceed, fastLength, slowLength, signalLength)
// 4 level of green
greenHighh = #7bff00
greenMidHighh = #7bff00
greenMidLowh = #7bff00
greenLowh = #7bff00
// Yellow
yellowLowh = #693d8e
// 4 level of red
redHighh = #ff0000
redMidHighh = #ff0000
redMidLowh = #ff0000
redLowh = #ff0000
// Default color
candleBodyd = yellowLowh
// Ranging trend
if hist > 0
if hist > hist and hist > 0
candleBodyd := greenLowh
if hist < 0
if hist < hist and hist < 0
candleBodyd := redLowh
// Bullish trend
if macdda > 0 and hist > 0
candleBodyd := greenMidLowh
if hist > hist and macd > 0 and hist > 0
candleBodyd := greenMidHighh
if hist > hist and macd > 0 and hist > 0
candleBodyd := greenHighh
// Bearish trend
if macdda < 0 and hist < 0
candleBodyd := redMidLowh
if hist < hist and macd < 0 and hist < 0
candleBodyd := redMidHighh
if hist < hist and macd < 0 and hist < 0
candleBodyd := redHighh
barcolor(candleBodyd) // Include suggestion by Shaheen204
//
tenkan_len = 365
tenkan_mult = 3
kijun_len = 365
kijun_mult = 7
spanB_len = 365
spanB_mult = 10
offset = 1
//------------------------------------------------------------------------------
avg(src,length,mult)=>
atr = ta.atr(50)*mult
up = hl2 + atr
dn = hl2 - atr
upper = 0.,lower = 0.
upper := src < upper ? math.min(up,upper ) : up
lower := src > lower ? math.max(dn,lower ) : dn
os = 0,max = 0.,min = 0.
os := src > upper ? 1 : src < lower ? 0 : os
spt = os == 1 ? lower : upper
max := ta.cross(src,spt) ? math.max(src,max ) : os == 1 ? math.max(src,max ) : spt
min := ta.cross(src,spt) ? math.min(src,min ) : os == 0 ? math.min(src,min ) : spt
math.avg(max,min)
//------------------------------------------------------------------------------
tenkan = avg(close,tenkan_len,tenkan_mult)
kijun = avg(close,kijun_len,kijun_mult)
senkouA = math.avg(kijun,tenkan)
senkouB = avg(close,spanB_len,spanB_mult)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//Smart Money Concept
settings = "Settings"
zigzag_len = input.int(9, "ZigZag Length", group=settings)
show_zigzag = input.bool(false, "Show Zigzag", group=settings)
fib_factor = input.float(0.33, "Fib Factor for breakout confirmation", 0, 1, 0.01, group=settings)
text_size = input.string(size.tiny, "Text Size", , group=settings)
delete_boxes = input.bool(true, "Delete Old/Broken Boxes", group=settings)
bu_ob_inline_color = "Bu-OB Colors"
be_ob_inline_color = "Be-OB Colors"
bu_bb_inline_color = "Bu-BB Colors"
be_bb_inline_color = "Be-BB Colors"
bu_ob_display_settings = "Bu-OB Display Settings"
bu_ob_color = input.color(color.new(color.green, 70), "Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
bu_ob_border_color = input.color(color.green, "Border Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
bu_ob_text_color = input.color(color.green, "Text Color", group=bu_ob_display_settings, inline=bu_ob_inline_color)
be_ob_display_settings = "Be-OB Display Settings"
be_ob_color = input.color(color.new(color.red, 70), "Color", group=be_ob_display_settings, inline=be_ob_inline_color)
be_ob_border_color = input.color(color.red, "Border Color", group=be_ob_display_settings, inline=be_ob_inline_color)
be_ob_text_color = input.color(color.red, "Text Color", group=be_ob_display_settings, inline=be_ob_inline_color)
bu_bb_display_settings = "Bu-BB & Bu-MB Display Settings"
bu_bb_color = input.color(color.new(color.green, 70), "Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
bu_bb_border_color = input.color(color.green, "Border Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
bu_bb_text_color = input.color(color.green, "Text Color", group=bu_bb_display_settings, inline=bu_bb_inline_color)
be_bb_display_settings = "Be-BB & Be-MB Display Settings"
be_bb_color = input.color(color.new(color.red, 70), "Color", group=be_bb_display_settings, inline=be_bb_inline_color)
be_bb_border_color = input.color(color.red, "Border Color", group=be_bb_display_settings, inline=be_bb_inline_color)
be_bb_text_color = input.color(color.red, "Text Color", group=be_bb_display_settings, inline=be_bb_inline_color)
var float high_points_arr = array.new_float(5)
var int high_index_arr = array.new_int(5)
var float low_points_arr = array.new_float(5)
var int low_index_arr = array.new_int(5)
var box bu_ob_boxes = array.new_box(5)
var box be_ob_boxes = array.new_box(5)
var box bu_bb_boxes = array.new_box(5)
var box be_bb_boxes = array.new_box(5)
to_up = high >= ta.highest(zigzag_len)
to_down = low <= ta.lowest(zigzag_len)
trend = 1
trend := nz(trend , 1)
trend := trend == 1 and to_down ? -1 : trend == -1 and to_up ? 1 : trend
last_trend_up_since = ta.barssince(to_up )
low_val = ta.lowest(nz(last_trend_up_since > 0 ? last_trend_up_since : 1, 1))
low_index = bar_index - ta.barssince(low_val == low)
last_trend_down_since = ta.barssince(to_down )
high_val = ta.highest(nz(last_trend_down_since > 0 ? last_trend_down_since : 1, 1))
high_index = bar_index - ta.barssince(high_val == high)
if ta.change(trend) != 0
if trend == 1
array.push(low_points_arr, low_val)
array.push(low_index_arr, low_index)
if trend == -1
array.push(high_points_arr, high_val)
array.push(high_index_arr, high_index)
f_get_high(ind) =>
f_get_low(ind) =>
f_delete_box(box_arr) =>
if delete_boxes
box.delete(array.shift(box_arr))
else
array.shift(box_arr)
0
= f_get_high(0)
= f_get_high(1)
= f_get_low(0)
= f_get_low(1)
if ta.change(trend) != 0 and show_zigzag
if trend == 1
line.new(h0i, h0, l0i, l0)
if trend == -1
line.new(l0i, l0, h0i, h0)
market = 1
market := nz(market , 1)
// market := market == 1 and close < l0 and low < l0 - math.abs(h0 - l0) * fib_factor ? -1 : market == -1 and close > h0 and high > h0 + math.abs(h0 - l0) * fib_factor ? 1 : market
last_l0 = ta.valuewhen(ta.change(market) != 0, l0, 0)
last_h0 = ta.valuewhen(ta.change(market) != 0, h0, 0)
market := last_l0 == l0 or last_h0 == h0 ? market : market == 1 and l0 < l1 and l0 < l1 - math.abs(h0 - l1) * fib_factor ? -1 : market == -1 and h0 > h1 and h0 > h1 + math.abs(h1 - l0) * fib_factor ? 1 : market
bu_ob_index = bar_index
bu_ob_index := nz(bu_ob_index , bar_index)
for i=h1i to l0i
index = bar_index - i
if open > close
bu_ob_index := bar_index
bu_ob_since = bar_index - bu_ob_index
be_ob_index = bar_index
be_ob_index := nz(be_ob_index , bar_index)
for i=l1i to h0i
index = bar_index - i
if open < close
be_ob_index := bar_index
be_ob_since = bar_index - be_ob_index
be_bb_index = bar_index
be_bb_index := nz(be_bb_index , bar_index)
for i=h1i - zigzag_len to l1i
index = bar_index - i
if open > close
be_bb_index := bar_index
be_bb_since = bar_index - be_bb_index
bu_bb_index = bar_index
bu_bb_index := nz(bu_bb_index , bar_index)
for i=l1i - zigzag_len to h1i
index = bar_index - i
if open < close
bu_bb_index := bar_index
bu_bb_since = bar_index - bu_bb_index
if ta.change(market) != 0
if market == 1
line.new(h1i, h1, h0i, h1, color=color.green, width=1)
label.new(int(math.avg(h1i, l0i)), h1, "BoS", color=color.new(color.black, 100), style=label.style_label_down, textcolor=color.green, size=size.small)
bu_ob = box.new(bu_ob_index, high , bar_index + 10, low , bgcolor=bu_ob_color, border_color=bu_ob_border_color, text="Bu-OB", text_color=bu_ob_text_color, text_halign=text.align_right, text_size=text_size)
bu_bb = box.new(bu_bb_index, high , bar_index + 10, low , bgcolor=bu_bb_color, border_color=bu_bb_border_color, text=l0 < l1 ? "Bu-BB" : "Bu-MB", text_color=bu_bb_text_color, text_halign=text.align_right, text_size=text_size)
array.push(bu_ob_boxes, bu_ob)
array.push(bu_bb_boxes, bu_bb)
if market == -1
line.new(l1i, l1, l0i, l1, color=color.red, width=1)
label.new(int(math.avg(l1i, h0i)), l1, "BoS", color=color.new(color.black, 100), style=label.style_label_up, textcolor=color.red, size=size.small)
be_ob = box.new(be_ob_index, high , bar_index + 10, low , bgcolor=be_ob_color, border_color=be_ob_border_color, text="Be-OB", text_color=be_ob_text_color, text_halign=text.align_right, text_size=text_size)
be_bb = box.new(be_bb_index, high , bar_index + 10, low , bgcolor=be_bb_color, border_color=be_bb_border_color, text=h0 > h1 ? "Be-BB" : "Be-MB", text_color=be_bb_text_color, text_halign=text.align_right, text_size=text_size)
array.push(be_ob_boxes, be_ob)
array.push(be_bb_boxes, be_bb)
for bull_ob in bu_ob_boxes
bottom = box.get_bottom(bull_ob)
top = box.get_top(bull_ob)
if close < bottom
f_delete_box(bu_ob_boxes)
else if close < top
alert("Price in the BU-OB zone")
else
box.set_right(bull_ob, bar_index + 10)
for bear_ob in be_ob_boxes
top = box.get_top(bear_ob)
bottom = box.get_bottom((bear_ob))
if close > top
f_delete_box(be_ob_boxes)
if close > bottom
alert("Price in the BE-OB zone")
else
box.set_right(bear_ob, bar_index + 10)
for bear_bb in be_bb_boxes
top = box.get_top(bear_bb)
bottom = box.get_bottom(bear_bb)
if close > top
f_delete_box(be_bb_boxes)
else if close > bottom
alert("Price in the BE-BB zone")
else
box.set_right(bear_bb, bar_index + 10)
for bull_bb in bu_bb_boxes
bottom = box.get_bottom(bull_bb)
top = box.get_top(bull_bb)
if close < bottom
f_delete_box(bu_bb_boxes)
else if close < top
alert("Price in the BU-BB zone")
else
box.set_right(bull_bb, bar_index + 10)
alertcondition(ta.change(market) != 0, "MSB", "MSB")
enableAutoTrend = input(true, "Enable Auto Trendlines", group="AUTO TRENDLINES SETTINGS")
srcTrendChannel = input(close, "Trend channel source", group="AUTO TRENDLINES SETTINGS")
lenTrendChannel = input.int(50, "Trend channel loopback", 2, group="AUTO TRENDLINES SETTINGS")
a = ta.wma(srcTrendChannel, lenTrendChannel), b = ta.sma(srcTrendChannel, lenTrendChannel)
A = 4 * b - 3 * a, B = 3 * a - 2 * b
m = (A - B) / (lenTrendChannel - 1)
d = 0., for i = 0 to lenTrendChannel - 1 by 1
l = B + m * i
d += math.pow(srcTrendChannel - l, 2)
rmse = math.sqrt(d / (lenTrendChannel - 1)) * 2
l(css, k) =>
line lr = enableAutoTrend ? line.new(bar_index - lenTrendChannel + 1, A + k, bar_index, B + k, extend=extend.right, color=css) : na
line.delete(lr )
l(#808080, rmse), l(#808080, 0), l(#808080,-rmse)
// ==========================================================================================
// === Dashboard with Telegram Link ===
var table myTable = table.new(position.top_center, 1, 1, border_width=1, frame_color=color.black, bgcolor=color.white)
// Add Telegram Message to Dashboard
table.cell(myTable, 0, 0, "Join Telegram @ABOSALTAN", bgcolor=color.blue, text_color=color.white, text_size=size.normal)






















