DZ/SZ 🔱BrahmastraDemand and Supply Zones:
Demand Zone:
A demand zone is a price area on a chart where buying interest is strong enough to prevent the price from falling further. It is typically formed when price drops to a level and then reverses upward with strong momentum. Traders consider it as an area where institutions or big players are likely to place buy orders.
👉 It represents support.
Supply Zone:
A supply zone is a price area where selling pressure exceeds buying pressure, causing the price to stop rising and reverse downward. It is created when price rallies to a level and then falls back sharply. This indicates the presence of sellers or institutional sell orders.
👉 It represents resistance.
🔑 Key Points:
Demand = potential buying area (support).
Supply = potential selling area (resistance).
These zones help traders identify entry and exit points.
The stronger and fresher the zone (untouched recently), the more reliable it tends to be.
Multitimeframe
RSI Divergence + MTF PanelRSI Divergence + MTF Panel
📊 Short Description
A powerful indicator for detecting RSI divergences with a multi-timeframe panel that helps traders find high-quality trading opportunities across different time intervals.
✨ Key Features
🎯 Automatic Divergence Detection
- **Bullish Divergence**: Price makes lower lows while RSI makes higher lows
- **Bearish Divergence**: Price makes higher highs while RSI makes lower highs
- Visual divergence marking with lines on the chart
- Customizable colors and line styles
📈 Multi-Timeframe Panel (MTF)
- Displays RSI from 4 fixed timeframes simultaneously (5m, 15m, 1H, 4H)
- Color-coded RSI levels:
- 🔴 Red: RSI > 70 (overbought)
- 🟢 Green: RSI < 30 (oversold)
- ⚪ White: RSI between 30-70 (neutral zone)
⚙️ Flexible Settings
- RSI period (default 14)
- Divergence detection threshold
- Data source selection (close, hl2, hlc3, ohlc4)
- Color and transparency customization
- Enable/disable indicator components
📋 How to Use
1. **Add the indicator to your chart** - it will automatically start scanning for divergences
2. **Adjust parameters** to match your trading style
3. **Monitor the MTF panel** for overall market condition overview
4. **Look for divergences** combined with other signals for confirmation
🎯 Perfect for:
- Swing trading
- Intraday trading
- Finding reversal points
- Confirming trading signals
- Multi-timeframe analysis
⚡ Advantages
- **Automation**: No need to manually search for divergences
- **Multi-functionality**: RSI analysis + MTF overview in one indicator
- **Visual clarity**: Clear signals and color coding
- **Performance**: Optimized code for fast operation
- **Flexibility**: Wide customization options
📊 Technical Details
- Uses standard RSI with customizable period
- Divergence detection algorithm based on peaks and valleys
- MTF panel updates in real-time
- Supports all asset types (stocks, forex, crypto, commodities)
🔧 Usage Recommendations
- Combine with other indicators for signal confirmation
- Consider overall market trend
- Use risk management rules
- Test settings on historical data
👥 Suitable for:
- Beginners (easy to use)
- Experienced traders (flexible settings)
- All trading styles and timeframes
---
*This indicator is designed to enhance trading efficiency and help make informed trading decisions. Always follow risk management rules and don't rely on just one indicator.*
[KINGS TREND STRATEGY] – Kings Trend + Heikin Ashi Dynamic Tool
Category: Trend-Following / Swing Trading
Timeframes: Works on all timeframes (Intraday to Swing)
Markets: Stocks, Futures, Crypto, Forex
What is this Indicator?
is a trend-following indicator that combines the Half Trend algorithm with optional Heikin Ashi smoothing.
It clearly shows the direction of the trend (Uptrend / Downtrend).
It highlights Buy and Sell signals at high-probability zones.
Optionally, you can color-code the candles based on trend direction.
Key Features
Half Trend Algorithm:
Removes price noise to clearly display the direction of the trend.
Amplitude (sensitivity) can be adjusted manually.
Heikin Ashi Mode (Optional):
Uses Heikin Ashi candles to smooth trend calculations.
Displays Trend Strength (%) to gauge how strong or weak the trend is.
Auto Buy / Sell Signals:
Up (▲) and Down (▼) arrows are plotted whenever a trend reversal occurs.
Signal colors:
#17DFAD (Aqua Green) → Uptrend Signal
#DD326B (Magenta Red) → Downtrend Signal
Dynamic Candle Coloring:
Candles can be colored automatically according to the trend.
In an uptrend, candles appear greenish; in a downtrend, reddish.
On-Chart Dashboard:
Ticker, Timeframe, and Trend Info are displayed live on the chart.
In Heikin Ashi mode, Trend Strength % is also shown.
How to Use
Add to Chart → Select Timeframe → Adjust “Amplitude”:
Low amplitude → more frequent signals (scalping).
High amplitude → fewer but more reliable signals (swing trading).
Watch Buy/Sell Arrows:
▲ Up Arrow: Indicates potential long entry (trend reversal up).
▼ Down Arrow: Indicates potential short entry (trend reversal down).
Optional Enhancements:
Enable trend candles for a cleaner chart view.
Enable Heikin Ashi mode for smoother signals.
Best Practices
Confirm signals using support/resistance levels, volume indicators, or momentum oscillators (RSI / MACD).
Higher timeframes (1H / 4H / 1D) tend to produce more reliable results.
Do not trade solely based on this indicator — risk management is essential.
Disclaimer
This indicator is for educational purposes only.
Past performance does not guarantee future results.
Always use stop-loss and proper risk control when trading.
LUCID LION TRINITY V1The LUCID LION TRINITY V1 is a precision trading tool designed to simplify decision-making and enhance trade execution through clear entry, stop-loss, and multi-target profit zones.
This indicator combines a dynamic EMA trend filter with ATR-based risk management, giving traders a structured approach to spotting setups and managing trades effectively.
Core Features
• Automatic Buy & Sell Signals
• Buy signals appear when price crosses above the EMA.
• Sell signals appear when price crosses below the EMA.
• Risk Management Built In
• ATR-based Stop Loss ensures volatility-adjusted protection.
• Fully configurable ATR length & multiplier.
• Multi-Level Take Profits (TP1, TP2, TP3)
• TP1 aligns with your chosen Risk:Reward ratio.
• TP2 & TP3 extend profits for trend continuation.
• Adjustable multipliers to fit your style.
• Visual Trade Levels
• EMA trend confirmation.
• Stop Loss and TP levels plotted on chart.
• Clear entry markers for easy reference.
• Alerts Ready
• Instant notifications for Buy and Sell setups.
How to Use
1. Watch for a BUY or SELL signal.
2. Manage the trade using the plotted Stop Loss and TP zones.
3. Scale out at TP1, TP2, and TP3 to secure profits.
4. Always combine with your own analysis for best results.
Important Note
The LUCID LION TRINITY V1 does not guarantee profitable trades. It highlights potential entry and exit areas, but proper risk management and additional analysis are required.
📩 To gain access, email: lucidlionllc@icloud.com
Disclaimer
The LUCID LION TRINITY V1 indicator is provided strictly for educational and informational purposes only. It is not financial advice and should not be considered a recommendation to buy or sell any financial instrument.
Trading financial markets involves significant risk. Past performance does not guarantee future results. Use this tool at your own risk and always apply proper risk management.
Terms of Use
By purchasing or gaining access to the LUCID LION TRINITY V1, you agree to the following:
1. Educational Use Only – This tool is for educational purposes and not investment advice.
2. No Profit Guarantee – Results are not guaranteed. Market conditions vary.
3. User Responsibility – You are solely responsible for your trading decisions. Lucid Lion LLC is not liable for outcomes.
4. Non-Transferable Access – Access is for personal use only; redistribution is prohibited.
5. Risk Disclosure – Trading carries risk. Trade only with money you can afford to lose.
6. Refund Policy – All purchases are final. No refunds will be issued.
ExoCloudGet a clearer market perspective with ExoCloud, a lightweight indicator that visualizes the interplay between two adaptive moving averages as a color‑shaded cloud. **Green clouds** signal bullish momentum when the faster average is above the slower one, while **red clouds** highlight bearish pressure when the faster average drops below. Built for traders who prefer simplicity without sacrificing precision.
---
🔑 Key Features
Immediate Trend Visualization – The cloud instantly reveals market bias.
Multi‑Timeframe Mode– Overlay higher‑TF clouds on lower‑TF charts for confluence.
Adaptive Alerts– Real‑time notifications when bullish or bearish shifts occur.
Configurable Color Theme – Align cloud and baseline hues with your chart style.
---
🔔 Alerts
Cloud Bounce (Buy / Sell) – Price pulls back into the cloud and then rebounds in the prevailing trend, offering high‑probability continuation entries.
Cloud Flip (Bullish / Bearish) – The cloud color flips when momentum decisively changes sides, flagging early trend reversals once structure confirms.
Cloud Storm (Multi‑TF) – A lower‑time‑frame cloud crosses a higher one, creating cross‑time‑frame “storm” alerts that capture volatility expansions and breakout conditions.
---
🧩 Strategy Edge
1. Trend Filter – Execute longs only during green clouds and shorts during red clouds.
2. Pullback Entries – Wait for price to revisit the cloud, then trade in the prevailing direction.
3. Early Reversals – Watch for cloud color flips combined with volume expansion.
Hourly High/Low Sweep Lines – Fixed HorizontalMarks out the hourly high and lows for levels of liquidity for take profits
Separators + MTF Box with Sessions
Indicator Description
Professional Multi-Timeframe Analysis Tool with Session Visualization
This comprehensive trading indicator combines advanced multi-timeframe analysis with session visualization, providing traders with a complete market structure visualization toolkit.
🚀 Key Features
Multi-Timeframe Separators
· Smart vertical lines marking period beginnings across 7 timeframes (5min to Weekly)
· Customizable colors, styles, and visibility ranges for each timeframe
· 30-minute separator option for enhanced precision
· Automatic visibility based on your current chart timeframe
Dynamic MTF Box
· Displays higher timeframe support/resistance levels as clear visual lines
· Two operating modes: Automatic (smart selection) or Manual (user-defined)
· Customizable colors for High/Low lines and Open/Close lines
· Optional Open/Close level display
Session Visualization
· Visualizes key market sessions with customizable time ranges
· Customizable session colors and labels
· Automatic high/low detection within each session
· Professional box displays with session labels
🎯 How It Works
The indicator automatically:
1. Draws timeframe separators based on your chart's current timeframe
2. Displays higher-timeframe structure through the MTF box
3. Identifies and marks sessions with their respective ranges
4. Provides clean visual representation of multi-timeframe market structure
⚙ Customization Options
· Separators: Enable/disable individual timeframes, adjust colors, styles, and visibility
· MTF Box:
· Choose between Automatic or Manual mode
· Select timeframes
· Customize colors for High/Low and Open/Close lines
· Toggle Open/Close display
· Sessions: Customize session times, colors, and toggle individual phases
· General: Overall on/off controls for separators
📊 Ideal For
· Multi-Timeframe Analysis: Perfect for traders who analyze across different timeframes
· Session-Based Trading: Identify key market sessions and their ranges
· Market Structure Traders: Clear visualization of support/resistance levels
· Swing & Day Traders: Suitable for various trading styles and timeframes
💡 Pro Tips
1. Use the Automatic mode for smart timeframe selection
2. Adjust separator visibility to avoid clutter on your preferred chart timeframes
3. Combine the MTF box with session visualization for comprehensive market analysis
4. Use different colors for quick visual recognition of various timeframes
⚠ Note
This indicator uses multiple security calls for MTF functionality. Performance may vary on very low timeframes with many enabled features.
Elevate your trading analysis with this all-in-one market structure tool that combines the power of multi-timeframe analysis with session visualization!
---
How to Use
1. Apply the indicator to any chart
2. Configure separator settings in the "Separators" groups
3. Set MTF Box preferences (mode, timeframe, colors)
4. Customize session times and colors in the "Sessions" group
5. The indicator will automatically display relevant market structure information
Compatibility
· Works on all chart types (candlestick, bar, line, etc.)
· Compatible with all TradingView instruments (stocks, forex, crypto, indices)
· Responsive design works on all timeframes from 1 minute to monthly
Transform your chart analysis with this powerful combination of timeframe separators, MTF structure visualization, and session analysis!
cd_SMT_Sweep_CISD_CxGeneral
This indicator is designed to show trading opportunities after sweeps of higher timeframe (HTF) highs/lows and, if available, Smart Money Technique (SMT) divergence with a correlated asset, followed by confirmation from a lower timeframe change in state delivery (CISD).
Users can track SMT, Sweep, and CISD levels across nine different timeframes.
________________________________________
Usage and Details
Commonly correlated timeframes are available in the menu by default. Users can also enter other compatible timeframes manually if necessary.
The indicator output is presented as:
• A summary table
• Display on HTF candles
• CISD levels shown as lines
Users can disable any of these from the menu.
Presentations of selected timeframes are displayed only if they are greater than or equal to the active chart timeframe.
From the Show/Hide section, you can control the display of:
• SMT table
• Sweep table
• HTF candles
• CISD levels
• HTF boxes aligned with the active timeframe
________________________________________
SMT Analysis
To receive analysis, users must enter correlated assets in the menu (or adjust them as needed).
If asset X is paired with correlated asset Y, then a separate entry for Y correlated with X is not required.
Four correlation pairs are included by default. Users should check them according to their broker/exchange or define new ones.
Checkboxes at the beginning of each row allow activation/deactivation of pairs.
SMT analysis is performed on the last three candles of each selected HTF.
If one asset makes a new high while the correlated one does not (or one makes a new low while the other does not), this is considered SMT and will be displayed both in the table and on the chart.
Charts without defined correlated assets will not display an SMT table.
________________________________________
Sweep Analysis
For the selected timeframes, the current candle is compared with the previous one.
If price violates the previous level and then pulls back behind it, this is considered a sweep. It is displayed in both the table and on the chart.
Within correlated pairs, the analysis is done separately and shown only in the table.
Example with correlated and non-correlated pairs:
• In the table, X = false, ✓ = true.
• The Sweep Table has two columns for Bullish and Bearish results.
• For correlated pairs, both values appear side by side.
• For undefined pairs, only the active asset is shown.
Example 1: EURUSD and GBPUSD pair
• If both sweep → ✓ ✓
• If one sweeps, the other does not → ✓ X
• If neither sweeps → X X
Example 2: AUDUSD with no correlated pair defined
• If sweep → ✓
• If no sweep → X
________________________________________
HTF Candles
For every HTF enabled by the user, the last three candles (including the current one) are shown on the chart.
SMT and sweep signals are marked where applicable.
________________________________________
CISD Levels
For the selected timeframes, bullish and bearish CISD levels are plotted on the chart.
________________________________________
HTF Boxes
HTF boxes aligned with the active timeframe are displayed on the chart.
Box border colors change according to whether the active HTF candle is bullish or bearish.
________________________________________
How to Read the Chart?
Let’s break down the example below:
• Active asset: Nasdaq
• Correlated asset: US500 (defined in the menu, confirmed in the table bottom row)
• Active timeframe: H1 → therefore, the HTF box is shown for Daily
• Since a correlated pair is defined, the indicator runs both SMT and Sweep analysis for the selected timeframes. Without correlation, only Sweep analysis would be shown.
Table is prepared for H1 and higher timeframes (as per user selection and active TF).
Observations:
• SMT side → H1 timeframe shows a bearish warning
• Sweep side → Bearish column shows X and ✓
o X → no sweep on Nasdaq
o ✓ → sweep on US500
Meaning: US500 made a new high (+ sweep) while Nasdaq did not → SMT formed.
The last column of the table shows the compatible LTF for confirmation.
For H1, it suggests checking the 5m timeframe.
On the chart:
• CISD levels for selected timeframes are drawn
• SMT line is marked on H1 candles
• Next step: move to 5m chart for CISD confirmation before trading (with other confluences).
Similarly, the Daily row in the table shows a Bullish Sweep on US500.
________________________________________
Alerts
Two alert options are available:
1. Activate Alert (SMT + Sweep):
Triggers if both SMT and Sweep occur in the selected timeframes. (Classic option)
2. Activate Alert (Sweep + Sweep):
Triggers if sweeps occur in both assets of a correlated pair at the same timeframe.
Interpretation:
If SMT + Sweep are already present on higher timeframes, and simultaneous sweeps appear on lower timeframes, this may indicate a strong directional move.
Of course, this must be validated with CISD and other confluences.
________________________________________
HTF CISD Levels
Although CISD levels act as confirmation levels in their own timeframe, observing how price reacts to HTF CISD levels can provide valuable insights for intraday analysis.
POIs overlapping with these levels may be higher priority.
________________________________________
What’s Next in Future Versions?
• Completed CISD confirmations
• Additional alert options
• Plus your feedback and suggestions
________________________________________
Final Note
I’ll be happy to hear your opinions and feedback.
Happy trading!
Super Candle Indicator (Mark Alex Tucker)Going to be free for a limited time. I would like to know what everyone thinks of this. A candle indicator where the settings can be changed to find the right fit for the timeframe or the symbol you are trading. Please post any success you found with this.
Multi-Timeframe RSI Heat Map with NW EnvelopeMulti-Timeframe RSI Stochastic Heat Map with Nadaraya-Watson Envelope
This indicator combines multi-timeframe RSI and Stochastic RSI analysis with adaptive envelope calculations to provide comprehensive momentum assessment across multiple time horizons.
Core Features
Multi-Timeframe Analysis: Displays RSI and Stochastic RSI values across up to 17 configurable timeframes in a color-coded table format. Users can select from preset timeframe collections or create custom configurations with individual enable/disable controls.
Visual Heat Map System: Values are displayed using a temperature-based color coding system ranging from cold (oversold) to hot (overbought) conditions, enabling quick visual assessment of momentum extremes across timeframes.
Nadaraya-Watson Integration: Includes adaptive envelope functionality with both repainting and non-repainting modes. The envelope system uses kernel regression to identify dynamic support and resistance zones.
Configuration Options
The indicator offers extensive customization including timeframe selection, table positioning (9 locations), layout orientation (vertical/horizontal), color scheme modification, and envelope parameter adjustment. Users can fine-tune RSI periods, Stochastic smoothing, and bandwidth settings to match their analytical preferences.
Technical Implementation
Built using Pine Script v6 with optimized multi-timeframe data handling and efficient table management. The system balances comprehensive analysis capabilities with chart performance considerations.
Practical Applications
Suitable for momentum analysis, trend confirmation, extreme condition identification, and multi-timeframe alignment assessment. The combination of heat map visualization and envelope boundaries provides traders with both momentum context and dynamic price level references.
Usage Considerations
Multi-timeframe analysis may experience data delays during low-liquidity periods. Performance optimization features allow users to balance detail level with system responsiveness. The indicator works across all timeframes and instruments with adequate historical data.
Disclaimer: This indicator is for educational and analytical purposes only. Multi-timeframe momentum analysis does not guarantee future price movements. Users should conduct thorough testing and validation before incorporating this tool into their trading approach. Past performance of momentum patterns does not predict future results.
Time-Based Manipulation ProjectionsThis indicator automatically plots custom projection levels based on session and timeframe opening prices, utilizing the AMD/PO3 concept (Accumulation, Manipulation, Distribution / Power of Three). The theory suggests that price typically opens, creates an initial manipulation move to hunt liquidity, then reverses for distribution.
By measuring the distance from the open to the initial high/low manipulation, the indicator projects potential targets and reversal zones at customizable ratios, with the 2-2.5x and 4-4.5x extensions often serving as key areas.
Features:
Session-Based Projections: 4 custom session-based projections with full control over the opening time and the time when the projections stop updating with new manipulation highs/lows (Midnight, Daily, NY Open, etc)
Timeframe-Based Projections: 4 custom timeframe-based projections (H1, H4, Daily, Weekly, etc.)
Dynamic Anchoring: In line with AMD/PO3 logic, the indicator automatically locks to the correct manipulation leg (high or low) based on price position relative to the open
Custom Projections: Define your own projection levels
Custom Labels: Assign your own names to each projection, making it easy to identify and organize levels on the chart
Historical Levels: Option to display past projections
Styling Options: Choose line style, thickness, colors, label size, font, and positioning
Extend Lines: Option to extend projections forward to current price
Delayed Plotting: Set a delay (in minutes) after open before projections appear, useful to avoid false early swings
Note: These projections are most effective when the manipulation leg is clean and well-defined. If the manipulation is shallow, standard projections like 2–2.5x or 4–4.5x may not provide useful levels. In such cases, try experimenting with larger custom projections.
Multi-Symbol Options Trading IndicatorSymbol Configuration: User can input three different symbols (INDEX, CE, PE) with individual timeframes
Customizable Settings: Fully editable MACD and Stochastic parameters
Signal Generation:
BUY CE: When INDEX shows bullish signals AND CE option shows bullish signals
BUY PE: When INDEX shows bearish signals AND PE option shows bullish signals
Signal Conditions:
BUY CE Signal (all must be true):
INDEX: Stochastic %K > %D
INDEX: MACD line > Signal line
INDEX: Histogram shows bullish trend over specified bars
CE: Stochastic %K > %D
CE: MACD line > Signal line
CE: Histogram shows bullish trend over specified bars
BUY PE Signal (all must be true):
INDEX: Stochastic %K < %D
INDEX: MACD line < Signal line
INDEX: Histogram shows bearish trend over specified bars
PE: Stochastic %K > %D
PE: MACD line > Signal line
PE: Histogram shows bullish trend over specified bars
Visual Elements:
Green triangle up with "BUY CE" text when CE signal triggers
Red triangle down with "BUY PE" text when PE signal triggers
Background coloring on signal candles
Conditions table showing real-time status of all conditions
Alerts for both signal types
Usage Instructions:
Add the indicator to your chart
Configure your three symbols (INDEX, CE option, PE option)
Set timeframes for each symbol
Adjust MACD and Stochastic parameters as needed
Set the number of histogram bars for trend analysis
Enable/disable the conditions table and choose its position
The table will show you exactly which conditions are met (✓) or not met (✗) for both signal types, making it easy to monitor the setup in real-time.
Bias & Rules ChecklistThis script provides a clean trading checklist panel:
Bias calculation on a selectable timeframe (e.g., 1H, 4H, Daily)
Up to 5 fully customizable rules with individual scores
Automatic total score and percentage calculation
Designed and developed by ValieTrades
Confluence Dashboard V3This dashboard puts everything you need in one place, trend direction, momentum, and entry/exit signals, so you can focus on executing trades with confidence instead of juggling multiple charts. Built to help you see the market clearly and move with discipline.
TCLC - Multi TimeFrame VWAPVWAP :
VWAP, or Volume Weighted Average Price, is a trading indicator that represents the average price of a security over a specific period, weighted by the volume of trades at each price level. It is calculated by taking the sum of the product of price and volume and dividing it by the total volume for the period. Essentially, VWAP shows the average price at which most trades occurred, giving more weight to prices with higher trading volumes.
The Indicator Plots the VWAP in Daily, WEEKLY , MONTHLY , YEARLY which helps to gauage the trend where the Volume vs Price exists....
MTF Trend Analyzer + Option SignalThis Pine Script indicator, titled "MTF Trend Analyzer + Option Signal", is a comprehensive multi-timeframe trend analysis tool designed for TradingView to assist traders in identifying market trends and generating potential option trade signals. It overlays the chart and provides visual labels, a detailed trend table, and option strike suggestions based on trend conditions.
Detailed Description for Publishing on TradingView
Overview
The MTF Trend Analyzer + Option Signal indicator is designed to help traders make informed decisions by analyzing trend strength and direction across the current and a higher timeframe using Exponential Moving Averages (EMAs) and the Average Directional Index (ADX). Alongside trend analysis, it generates actionable option signals (Call or Put options) for instruments like NIFTY or BANKNIFTY by suggesting strikes based on the current trend and user input.
Key Features
- Multi-Timeframe Trend Analysis: Compares trend indicators on both the current chart’s timeframe and a user-selected higher timeframe to confirm trend direction and strength.
- Trend Identification Using EMAs and ADX:
- Calculates fast and slow EMA crossovers.
- Uses ADX to determine trend strength (with values above 20 indicating strong trends).
- Visual Labels for Trend Changes:
- Displays "BUY" or "SELL" labels on the chart when the trend shifts, based on EMA and ADX conditions.
- Option Trade Signal Suggestions:
- Based on the identified trend and option action type (Buy or Sell), suggests corresponding Call or Put option strike prices.
- Strike prices are calculated dynamically using the current price and user-defined strike gap (e.g., 50 for NIFTY, 100 for BANKNIFTY).
- Trend Score: A cumulative score from 0 to 100 reflecting the alignment of EMA and ADX conditions across both timeframes, helping quantify trend reliability.
- Trend Summary Table: A dynamic table positioned on the chart displaying key metrics including EMA values, ADX values, trend direction, score, and option signals for quick reference.
Inputs
- Fast EMA Length: Length for the fast EMA used to detect short-term trend signals (default 20).
- Slow EMA Length: Length for the slow EMA used as a baseline trend filter (default 50).
- ADX Length: Length for the ADX calculation to assess trend strength (default 14).
- Show Trend Table: Toggle to display or hide the trend summary table on the chart.
- Higher Timeframe for Confirmation: The timeframe used for higher timeframe validation (default 60 minutes).
- Option Action: Choose the desired option trading action: "Buy" or "Sell".
- Strike Gap: Defines the interval between option strikes, e.g., 50 for NIFTY or 100 for BANKNIFTY.
How It Works
1. Current Timeframe Calculations: The indicator computes EMAs and ADX on the current chart timeframe to identify short-term trends.
2. Higher Timeframe Validation: It concurrently fetches corresponding values on the selected higher timeframe to confirm trend strength and direction.
3. Trend Determination:
- A BUY trend is confirmed when:
- Fast EMA > Slow EMA on both timeframes.
- ADX > 20 on both timeframes (signifying strong trend).
- A SELL trend occurs when:
- Fast EMA < Slow EMA on both timeframes.
- ADX > 20 on both timeframes.
- Any other condition results in a NEUTRAL trend.
4. Trend Score: Adds points (25 each) for each condition met (fast EMA relation and ADX threshold on both timeframes), totaling up to 100 points.
5. Trend Change Labels: When the trend shifts from previous bars, a label ("BUY" in green or "SELL" in red) is plotted to visually alert traders.
6. Option Strike Suggestions: The indicator rounds the current price to the nearest strike based on strike gap and suggests buying or selling Calls/Puts aligned with the trend and user's option action preference.
7. Trend Table: Displays a comprehensive snapshot of EMA and ADX values on both timeframes, the detected trend, trend score, and option signal for easy monitoring.
Practical Usage
- Trend Confirmation: Use the combined signals from current and higher timeframes to avoid false signals during choppy or sideways markets.
- Option Trading Guidance: The option strike recommendations ease decision-making for options traders by suggesting actionable strikes aligned with the trend.
- Visual Alerts: The labels and table provide quick, on-chart updates without requiring constant monitoring of multiple indicators.
- Customization: Adapt the EMA lengths, ADX window, higher timeframe, and strike gap as per specific market instruments or trading style.
Who Should Use This Indicator?
- Swing and intraday traders seeking robust trend validation across multiple timeframes.
- Options traders looking for timely strike price signals based on technical conditions.
- Traders who prefer a visual and quantitative summary of trend behavior over manual analysis.
- Market participants trading indices or stocks with available options, especially in markets similar to NIFTY or BANKNIFTY.
Summary
The MTF Trend Analyzer + Option Signal is an all-in-one tool for comprehensive trend analysis and options trade signal generation. Its multi-timeframe approach combined with EMA and ADX indicators delivers reliable trend direction and strength insights. The dynamic visual labels, scoring mechanism, and detailed trend table empower traders to make informed market entries and option strike selections effectively.
This script is a powerful yet user-friendly assistant for improving timing and precision in trading decisions, making it an invaluable addition to TradingView’s indicator library.
If needed, customisation or integration support is available upon request.
Sources
Ichimoku + SuperTrend + Oscillator + Divergence + SMC Lite//@version=5
indicator("Ichimoku + SuperTrend + Oscillator + Divergence + SMC Lite", overlay=true, max_labels_count=500, max_lines_count=500, max_boxes_count=500, max_bars_back=1000)
// ====================
// === CODE BLOCK 1: Ichimoku + SuperTrend + Oscillator Monitor + Divergence ===
// ====================
// --- User Inputs ---
lowerTF = input.timeframe("5", "Lower Timeframe (Ichimoku + SuperTrend)")
higherTF = input.timeframe("60", "Higher Timeframe (Tenkan/Kijun check)")
tenkanLength = input.int(9, "Tenkan-sen Length (Lower TF)")
kijunLength = input.int(26, "Kijun-sen Length (Lower TF)")
senkouSpanBLength = input.int(52, "Senkou Span B Length (Lower TF)")
displacement = input.int(26, "Displacement (Lower TF)")
showCloud = input.bool(true, "Show Kumo Cloud (Lower TF)")
buyColor = input.color(color.new(color.green, 0), "Buy Candle Color")
sellColor = input.color(color.new(color.red, 0), "Sell Candle Color")
crossCandleColor = input.color(color.new(color.yellow, 0), "Cross Candle Color")
bodyFilterColor = input.color(color.new(color.lime,0), "Body Filter Active Color")
htfCrossColor = input.color(color.new(color.orange,0), "HTF Cross Signal Color")
stopColor = input.color(color.new(color.red,0), "Stop Line Color")
targetColor = input.color(color.new(color.blue,0), "Target Line Color")
cooldownBars = input.int(5, "Cooldown Bars After Signal")
// --- Higher TF Ichimoku ---
tenkanLengthHTF = input.int(36, "Tenkan Length (Higher TF)")
kijunLengthHTF = input.int(103, "Kijun Length (Higher TF)")
showTenkanHTF = input.bool(true, "Show Tenkan (HTF)")
showKijunHTF = input.bool(true, "Show Kijun (HTF)")
tenkanHTFValue = request.security(syminfo.tickerid, higherTF, (ta.highest(high, tenkanLengthHTF)+ta.lowest(low, tenkanLengthHTF))/2)
kijunHTFValue = request.security(syminfo.tickerid, higherTF, (ta.highest(high, kijunLengthHTF)+ta.lowest(low, kijunLengthHTF))/2)
plot(showTenkanHTF ? tenkanHTFValue : na, color=color.blue, linewidth=2, title="Tenkan HTF")
plot(showKijunHTF ? kijunHTFValue : na, color=color.red, linewidth=2, title="Kijun HTF")
// --- Lower TF Ichimoku ---
tenkan = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, tenkanLength) + ta.lowest(low, tenkanLength)) / 2)
kijun = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, kijunLength) + ta.lowest(low, kijunLength)) / 2)
senkouA = request.security(syminfo.tickerid, lowerTF, (tenkan + kijun) / 2)
senkouB = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, senkouSpanBLength) + ta.lowest(low, senkouSpanBLength)) / 2)
plot(tenkan, color=color.blue, title="Tenkan-sen (LTF)", linewidth=2)
plot(kijun, color=color.red, title="Kijun-sen (LTF)", linewidth=2)
sA = plot(senkouA , display=display.none)
sB = plot(senkouB , display=display.none)
cloudColor = showCloud ? (senkouA > senkouB ? color.new(color.green, 80) : color.new(color.red, 80)) : na
fill(sA, sB, color=cloudColor)
// --- Detect Crosses ---
crossUp = ta.crossover(tenkan, kijun)
crossDown = ta.crossunder(tenkan, kijun)
crossUpHTF = ta.crossover(tenkanHTFValue, kijunHTFValue)
crossDownHTF = ta.crossunder(tenkanHTFValue, kijunHTFValue)
candle2AboveCloud = close > math.max(senkouA , senkouB )
candle2BelowCloud = close < math.min(senkouA , senkouB )
// --- SuperTrend Lower TF ---
atrPeriodLTF = 12
multiplierLTF = 3.0
atrValueLTF = ta.atr(atrPeriodLTF)
upLTF = hl2 - multiplierLTF * atrValueLTF
dnLTF = hl2 + multiplierLTF * atrValueLTF
var int trendLTF = 1
trendLTF := trendLTF == -1 and close > dnLTF ? 1 : trendLTF == 1 and close < upLTF ? -1 : trendLTF
// --- SuperTrend Higher TF ---
useHTFST = input.bool(true, "Use HTF SuperTrend")
atrPeriodHTF = input.int(12, "HTF SuperTrend ATR")
multiplierHTF = input.float(3.0, "HTF SuperTrend Multiplier")
hl2HTF = request.security(syminfo.tickerid, higherTF, hl2)
atrHTF = request.security(syminfo.tickerid, higherTF, ta.atr(atrPeriodHTF))
upHTF = hl2HTF - multiplierHTF * atrHTF
dnHTF = hl2HTF + multiplierHTF * atrHTF
var int trendHTF = 1
trendHTF := trendHTF == -1 and close > dnHTF ? 1 : trendHTF == 1 and close < upHTF ? -1 : trendHTF
// --- Body Filter ---
useBodyFilter = input.bool(true, "Use Body Filter")
bodyMinPerc = input.float(20, "Min Body %")
bodyMaxPerc = input.float(100, "Max Body %")
bodyLen = math.abs(close - open)
candleLen = high - low
bodyPerc = (bodyLen / candleLen) * 100
bodyFilterPass = not useBodyFilter or (bodyPerc >= bodyMinPerc and bodyPerc <= bodyMaxPerc)
// --- Reward Filter ---
useReward = input.bool(true, "Use Reward 1:1 Filter")
stopLossPerc = input.float(1.5, "Stop Loss %")
reward1 = input.float(1.0, "Target 1 R/R")
reward2 = input.float(2.0, "Target 2 R/R")
reward3 = input.float(3.0, "Target 3 R/R")
rewardPass = not useReward or ((math.abs(close - tenkanHTFValue) * reward1) <= math.abs(kijunHTFValue - close))
// --- TSI Higher TF ---
tsiLong = input.int(25, "TSI Long")
tsiShort = input.int(13, "TSI Short")
tsiHTF = ta.tsi(request.security(syminfo.tickerid, higherTF, close), tsiLong, tsiShort)
// --- Lower TF Signals ---
buySignalLTF = (crossUp and candle2AboveCloud) and trendLTF == 1
sellSignalLTF = (crossDown and candle2BelowCloud) and trendLTF == -1
plotshape(crossUpHTF, title="HTF Buy Cross", location=location.belowbar, color=htfCrossColor, style=shape.triangleup, size=size.small)
plotshape(crossDownHTF, title="HTF Sell Cross", location=location.abovebar, color=htfCrossColor, style=shape.triangledown, size=size.small)
buyConfirmedRaw = (buySignalLTF and close > tenkanHTFValue and (not useHTFST or trendHTF==1)) and rewardPass and (tsiHTF > 0)
sellConfirmedRaw = (sellSignalLTF and close < tenkanHTFValue and (not useHTFST or trendHTF==-1)) and rewardPass and (tsiHTF < 0)
// --- Cooldown ---
var int barsSinceSignal = cooldownBars
barsSinceSignal += 1
buyConfirmed = buyConfirmedRaw and barsSinceSignal >= cooldownBars
sellConfirmed = sellConfirmedRaw and barsSinceSignal >= cooldownBars
if buyConfirmed or sellConfirmed
barsSinceSignal := 0
// --- Plot Final Signals ---
plotshape(buyConfirmed and bodyFilterPass, title="Buy Signal", location=location.belowbar, color=buyColor, style=shape.triangleup, size=size.small)
plotshape(sellConfirmed and bodyFilterPass, title="Sell Signal", location=location.abovebar, color=sellColor, style=shape.triangledown, size=size.small)
plotshape(buyConfirmed and not bodyFilterPass, title="Buy Signal (Filtered)", location=location.belowbar, color=bodyFilterColor, style=shape.triangleup, size=size.tiny)
plotshape(sellConfirmed and not bodyFilterPass, title="Sell Signal (Filtered)", location=location.abovebar, color=bodyFilterColor, style=shape.triangledown, size=size.tiny)
barcolor(crossUp or crossDown ? crossCandleColor : na)
barcolor(buyConfirmed and bodyFilterPass ? buyColor : sellConfirmed and bodyFilterPass ? sellColor : na)
// --- Stop & Targets ---
var float lastBuyPrice = na
var float lastSellPrice = na
var bool buyActive = false
var bool sellActive = false
f_drawLine(_price) =>
line.new(bar_index, _price, bar_index+3, _price, color=targetColor, width=2, style=line.style_dotted)
if buyConfirmed and not buyActive and not sellActive
buyActive := true
lastBuyPrice := close
line.new(bar_index, close*(1-stopLossPerc/100), bar_index+3, close*(1-stopLossPerc/100), color=stopColor, width=2, style=line.style_dotted)
f_drawLine(close*(1+reward1/100))
f_drawLine(close*(1+reward2/100))
f_drawLine(close*(1+reward3/100))
if buyActive
if low <= lastBuyPrice*(1-stopLossPerc/100) or high >= lastBuyPrice*(1+reward1/100)
buyActive := false
if sellConfirmed and not sellActive and not buyActive
sellActive := true
lastSellPrice := close
line.new(bar_index, close*(1+stopLossPerc/100), bar_index+3, close*(1+stopLossPerc/100), color=stopColor, width=2, style=line.style_dotted)
f_drawLine(close*(1-reward1/100))
f_drawLine(close*(1-reward2/100))
f_drawLine(close*(1-reward3/100))
if sellActive
if high >= lastSellPrice*(1+stopLossPerc/100) or low <= lastSellPrice*(1-reward1/100)
sellActive := false
// --- Oscillator Panel ---
showPanel = input.bool(true, "Show Oscillator Panel")
panelX = input.int(20, "Panel X Offset (Bars)")
panelY = input.int(50, "Panel Y Offset (Pixels)")
panelBgColor = input.color(color.new(color.black, 85), "Panel Background Color")
panelTextSize = input.string("normal", "Text Size", options= )
// MACD
macdFast = input.int(12)
macdSlow = input.int(26)
macdSignal= input.int(9)
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdBull = macdLine > signalLine
// RSI
rsiLen = input.int(14)
rsiVal = ta.rsi(close, rsiLen)
rsiBull = rsiVal > 50
// TSI
tsiVal = ta.tsi(close, 25, 13)
tsiBull = tsiVal > 0
// Divergence detection (RSI, MACD, TSI)
leftBars = input.int(2)
rightBars = input.int(2)
rsiLow = ta.pivotlow(rsiVal, leftBars, rightBars)
rsiHigh = ta.pivothigh(rsiVal, leftBars, rightBars)
bullDivRSI = not na(rsiLow) and low < low and rsiVal > rsiVal
bearDivRSI = not na(rsiHigh) and high > high and rsiVal < rsiVal
macdLow = ta.pivotlow(macdLine, leftBars, rightBars)
macdHigh = ta.pivothigh(macdLine, leftBars, rightBars)
bullDivMACD = not na(macdLow) and low < low and macdLine > macdLine
bearDivMACD = not na(macdHigh) and high > high and macdLine < macdLine
tsiLow = ta.pivotlow(tsiVal, leftBars, rightBars)
tsiHigh = ta.pivothigh(tsiVal, leftBars, rightBars)
bullDivTSI = not na(tsiLow) and low < low and tsiVal > tsiVal
bearDivTSI = not na(tsiHigh) and high > high and tsiVal < tsiVal
// Plot divergence on chart
plotshape(bullDivRSI, style=shape.labelup, text="R d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivRSI, style=shape.labeldown, text="R d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
plotshape(bullDivMACD, style=shape.labelup, text="M d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivMACD, style=shape.labeldown, text="M d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
plotshape(bullDivTSI, style=shape.labelup, text="T d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivTSI, style=shape.labeldown, text="T d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
// Panel
var label panelLabel = label.new(bar_index + panelX, close, "", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=panelBgColor, size=panelTextSize)
if showPanel
label.set_xy(panelLabel, bar_index + panelX, close + panelY * syminfo.mintick)
label.set_text(panelLabel, "MACD: " + (macdBull ? "↑" : "↓") + (bullDivMACD ? " d+" : bearDivMACD ? " d-" : "") + " " +
"RSI : " + (rsiBull ? "↑" : "↓") + (bullDivRSI ? " d+" : bearDivRSI ? " d-" : "") + " " +
"TSI : " + (tsiBull ? "↑" : "↓") + (bullDivTSI ? " d+" : bearDivTSI ? " d-" : "") + " " +
"ST : " + (trendLTF==1 ? "↑" : "↓"))
label.set_textcolor(panelLabel, color.white)
// ====================
// === CODE BLOCK 2: FluidTrades - SMC Lite (Light) ===
// ====================
// === SETTINGS ===
swing_length = input.int(10, "Swing High/Low Length", minval=1, maxval=50)
history_keep = input.int(20, "History To Keep", minval=5, maxval=50)
box_width = input.float(2.5, "Supply/Demand Box Width", minval=1, maxval=10, step=0.5)
show_labels = input.bool(false, "Show Price Action Labels")
supply_color = input.color(color.new(#EDEDED,70), "Supply Color")
supply_outline = input.color(color.new(color.white,75), "Supply Outline")
demand_color = input.color(color.new(#00FFFF,70), "Demand Color")
demand_outline = input.color(color.new(color.white,75), "Demand Outline")
bos_color = input.color(color.white, "BOS Label Color")
poi_color = input.color(color.white, "POI Label Color")
label_color = input.color(color.black, "Swing Label Color")
// === FUNCTIONS ===
f_add_pop(arr, val) =>
array.unshift(arr, val)
array.pop(arr)
f_draw_swing_label(values, swing_type) =>
var string txt = na
if swing_type == 1
txt := array.get(values,0) >= array.get(values,1) ? "HH" : "LH"
label.new(bar_index - swing_length, array.get(values,0), txt, style=label.style_label_down, textcolor=label_color, color=color.new(label_color,100), size=size.tiny)
else
txt := array.get(values,0) >= array.get(values,1) ? "HL" : "LL"
label.new(bar_index - swing_length, array.get(values,0), txt, style=label.style_label_up, textcolor=label_color, color=color.new(label_color,100), size=size.tiny)
f_check_overlap(new_poi, box_arr, atr) =>
ok = true
for i=0 to array.size(box_arr)-1
b = array.get(box_arr,i)
top = box.get_top(b)
bot = box.get_bottom(b)
mid = (top+bot)/2
threshold = atr*2
if new_poi >= mid - threshold and new_poi <= mid + threshold
ok := false
break
ok
f_create_box(vals, bn_arr, box_arr, label_arr, type_box, atr) =>
atr_buf = atr*(box_width/10)
left = array.get(bn_arr,0)
right = bar_index
var float top=0.0
var float bottom=0.0
var float poi=0.0
if type_box==1
top := array.get(vals,0)
bottom := top - atr_buf
else
bottom := array.get(vals,0)
top := bottom + atr_buf
poi := (top+bottom)/2
if f_check_overlap(poi, box_arr, atr)
box.delete(array.get(box_arr,array.size(box_arr)-1))
f_add_pop(box_arr, box.new(left, top, right, bottom, border_color=type_box==1?supply_outline:demand_outline,
bgcolor=type_box==1?supply_color:demand_color, extend=extend.right, text=type_box==1?"SUPPLY":"DEMAND",
text_halign=text.align_center, text_valign=text.align_center, text_color=poi_color, text_size=size.small, xloc=xloc.bar_index))
box.delete(array.get(label_arr,array.size(label_arr)-1))
f_add_pop(label_arr, box.new(left, poi, right, poi, border_color=color.new(poi_color,90),
bgcolor=color.new(poi_color,90), extend=extend.right, text="POI", text_halign=text.align_left, text_valign=text.align_center, text_color=poi_color, text_size=size.small, xloc=xloc.bar_index))
f_to_bos(box_arr, bos_arr, label_arr, type_box) =>
for i=0 to array.size(box_arr)-1
b = array.get(box_arr,i)
lvl = type_box==1? box.get_top(b) : box.get_bottom(b)
cond = type_box==1? close>=lvl : close<=lvl
if cond
cbox = box.copy(b)
f_add_pop(bos_arr, cbox)
mid = (box.get_top(b)+box.get_bottom(b))/2
box.set_top(cbox, mid)
box.set_bottom(cbox, mid)
box.set_extend(cbox, extend.none)
box.set_right(cbox, bar_index)
box.set_text(cbox, "BOS")
box.set_text_color(cbox, bos_color)
box.set_text_size(cbox, size.small)
box.set_text_halign(cbox, text.align_center)
box.set_text_valign(cbox, text.align_center)
box.delete(b)
box.delete(array.get(label_arr,i))
f_extend(box_arr) =>
for i=0 to array.size(box_arr)-1
box.set_right(array.get(box_arr,i), bar_index+100)
// === CALCULATIONS ===
atr = ta.atr(50)
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)
var swing_high_vals = array.new_float(5,0.0)
var swing_low_vals = array.new_float(5,0.0)
var swing_high_bn = array.new_int(5,0)
var swing_low_bn = array.new_int(5,0)
var supply_boxes = array.new_box(history_keep, na)
var demand_boxes = array.new_box(history_keep, na)
var supply_poi = array.new_box(history_keep, na)
var demand_poi = array.new_box(history_keep, na)
var bos_supply = array.new_box(5, na)
var bos_demand = array.new_box(5, na)
// NEW SWING HIGH
if not na(swing_high)
f_add_pop(swing_high_vals, swing_high)
f_add_pop(swing_high_bn, bar_index )
if show_labels
f_draw_swing_label(swing_high_vals,1)
f_create_box(swing_high_vals, swing_high_bn, supply_boxes, supply_poi, 1, atr)
// NEW SWING LOW
if not na(swing_low)
f_add_pop(swing_low_vals, swing_low)
f_add_pop(swing_low_bn, bar_index )
if show_labels
f_draw_swing_label(swing_low_vals,-1)
f_create_box(swing_low_vals, swing_low_bn, demand_boxes, demand_poi, -1, atr)
f_to_bos(supply_boxes, bos_supply, supply_poi, 1)
f_to_bos(demand_boxes, bos_demand, demand_poi, -1)
f_extend(supply_boxes)
f_extend(demand_boxes)
//@version=6
length = input.int(9, minval=1)
src = input(close, title="Source")
e1 = ta.ema(src, length)
e2 = ta.ema(e1, length)
dema = 2 * e1 - e2
plot(dema, "DEMA", color=#43A047)
Ichimoku + SuperTrend + Oscillator + Divergence + SMC Lite//@version=5
indicator("Ichimoku + SuperTrend + Oscillator + Divergence + SMC Lite", overlay=true, max_labels_count=500, max_lines_count=500, max_boxes_count=500, max_bars_back=1000)
// ====================
// === CODE BLOCK 1: Ichimoku + SuperTrend + Oscillator Monitor + Divergence ===
// ====================
// --- User Inputs ---
lowerTF = input.timeframe("5", "Lower Timeframe (Ichimoku + SuperTrend)")
higherTF = input.timeframe("60", "Higher Timeframe (Tenkan/Kijun check)")
tenkanLength = input.int(9, "Tenkan-sen Length (Lower TF)")
kijunLength = input.int(26, "Kijun-sen Length (Lower TF)")
senkouSpanBLength = input.int(52, "Senkou Span B Length (Lower TF)")
displacement = input.int(26, "Displacement (Lower TF)")
showCloud = input.bool(true, "Show Kumo Cloud (Lower TF)")
buyColor = input.color(color.new(color.green, 0), "Buy Candle Color")
sellColor = input.color(color.new(color.red, 0), "Sell Candle Color")
crossCandleColor = input.color(color.new(color.yellow, 0), "Cross Candle Color")
bodyFilterColor = input.color(color.new(color.lime,0), "Body Filter Active Color")
htfCrossColor = input.color(color.new(color.orange,0), "HTF Cross Signal Color")
stopColor = input.color(color.new(color.red,0), "Stop Line Color")
targetColor = input.color(color.new(color.blue,0), "Target Line Color")
cooldownBars = input.int(5, "Cooldown Bars After Signal")
// --- Higher TF Ichimoku ---
tenkanLengthHTF = input.int(36, "Tenkan Length (Higher TF)")
kijunLengthHTF = input.int(103, "Kijun Length (Higher TF)")
showTenkanHTF = input.bool(true, "Show Tenkan (HTF)")
showKijunHTF = input.bool(true, "Show Kijun (HTF)")
tenkanHTFValue = request.security(syminfo.tickerid, higherTF, (ta.highest(high, tenkanLengthHTF)+ta.lowest(low, tenkanLengthHTF))/2)
kijunHTFValue = request.security(syminfo.tickerid, higherTF, (ta.highest(high, kijunLengthHTF)+ta.lowest(low, kijunLengthHTF))/2)
plot(showTenkanHTF ? tenkanHTFValue : na, color=color.blue, linewidth=2, title="Tenkan HTF")
plot(showKijunHTF ? kijunHTFValue : na, color=color.red, linewidth=2, title="Kijun HTF")
// --- Lower TF Ichimoku ---
tenkan = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, tenkanLength) + ta.lowest(low, tenkanLength)) / 2)
kijun = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, kijunLength) + ta.lowest(low, kijunLength)) / 2)
senkouA = request.security(syminfo.tickerid, lowerTF, (tenkan + kijun) / 2)
senkouB = request.security(syminfo.tickerid, lowerTF, (ta.highest(high, senkouSpanBLength) + ta.lowest(low, senkouSpanBLength)) / 2)
plot(tenkan, color=color.blue, title="Tenkan-sen (LTF)", linewidth=2)
plot(kijun, color=color.red, title="Kijun-sen (LTF)", linewidth=2)
sA = plot(senkouA , display=display.none)
sB = plot(senkouB , display=display.none)
cloudColor = showCloud ? (senkouA > senkouB ? color.new(color.green, 80) : color.new(color.red, 80)) : na
fill(sA, sB, color=cloudColor)
// --- Detect Crosses ---
crossUp = ta.crossover(tenkan, kijun)
crossDown = ta.crossunder(tenkan, kijun)
crossUpHTF = ta.crossover(tenkanHTFValue, kijunHTFValue)
crossDownHTF = ta.crossunder(tenkanHTFValue, kijunHTFValue)
candle2AboveCloud = close > math.max(senkouA , senkouB )
candle2BelowCloud = close < math.min(senkouA , senkouB )
// --- SuperTrend Lower TF ---
atrPeriodLTF = 12
multiplierLTF = 3.0
atrValueLTF = ta.atr(atrPeriodLTF)
upLTF = hl2 - multiplierLTF * atrValueLTF
dnLTF = hl2 + multiplierLTF * atrValueLTF
var int trendLTF = 1
trendLTF := trendLTF == -1 and close > dnLTF ? 1 : trendLTF == 1 and close < upLTF ? -1 : trendLTF
// --- SuperTrend Higher TF ---
useHTFST = input.bool(true, "Use HTF SuperTrend")
atrPeriodHTF = input.int(12, "HTF SuperTrend ATR")
multiplierHTF = input.float(3.0, "HTF SuperTrend Multiplier")
hl2HTF = request.security(syminfo.tickerid, higherTF, hl2)
atrHTF = request.security(syminfo.tickerid, higherTF, ta.atr(atrPeriodHTF))
upHTF = hl2HTF - multiplierHTF * atrHTF
dnHTF = hl2HTF + multiplierHTF * atrHTF
var int trendHTF = 1
trendHTF := trendHTF == -1 and close > dnHTF ? 1 : trendHTF == 1 and close < upHTF ? -1 : trendHTF
// --- Body Filter ---
useBodyFilter = input.bool(true, "Use Body Filter")
bodyMinPerc = input.float(20, "Min Body %")
bodyMaxPerc = input.float(100, "Max Body %")
bodyLen = math.abs(close - open)
candleLen = high - low
bodyPerc = (bodyLen / candleLen) * 100
bodyFilterPass = not useBodyFilter or (bodyPerc >= bodyMinPerc and bodyPerc <= bodyMaxPerc)
// --- Reward Filter ---
useReward = input.bool(true, "Use Reward 1:1 Filter")
stopLossPerc = input.float(1.5, "Stop Loss %")
reward1 = input.float(1.0, "Target 1 R/R")
reward2 = input.float(2.0, "Target 2 R/R")
reward3 = input.float(3.0, "Target 3 R/R")
rewardPass = not useReward or ((math.abs(close - tenkanHTFValue) * reward1) <= math.abs(kijunHTFValue - close))
// --- TSI Higher TF ---
tsiLong = input.int(25, "TSI Long")
tsiShort = input.int(13, "TSI Short")
tsiHTF = ta.tsi(request.security(syminfo.tickerid, higherTF, close), tsiLong, tsiShort)
// --- Lower TF Signals ---
buySignalLTF = (crossUp and candle2AboveCloud) and trendLTF == 1
sellSignalLTF = (crossDown and candle2BelowCloud) and trendLTF == -1
plotshape(crossUpHTF, title="HTF Buy Cross", location=location.belowbar, color=htfCrossColor, style=shape.triangleup, size=size.small)
plotshape(crossDownHTF, title="HTF Sell Cross", location=location.abovebar, color=htfCrossColor, style=shape.triangledown, size=size.small)
buyConfirmedRaw = (buySignalLTF and close > tenkanHTFValue and (not useHTFST or trendHTF==1)) and rewardPass and (tsiHTF > 0)
sellConfirmedRaw = (sellSignalLTF and close < tenkanHTFValue and (not useHTFST or trendHTF==-1)) and rewardPass and (tsiHTF < 0)
// --- Cooldown ---
var int barsSinceSignal = cooldownBars
barsSinceSignal += 1
buyConfirmed = buyConfirmedRaw and barsSinceSignal >= cooldownBars
sellConfirmed = sellConfirmedRaw and barsSinceSignal >= cooldownBars
if buyConfirmed or sellConfirmed
barsSinceSignal := 0
// --- Plot Final Signals ---
plotshape(buyConfirmed and bodyFilterPass, title="Buy Signal", location=location.belowbar, color=buyColor, style=shape.triangleup, size=size.small)
plotshape(sellConfirmed and bodyFilterPass, title="Sell Signal", location=location.abovebar, color=sellColor, style=shape.triangledown, size=size.small)
plotshape(buyConfirmed and not bodyFilterPass, title="Buy Signal (Filtered)", location=location.belowbar, color=bodyFilterColor, style=shape.triangleup, size=size.tiny)
plotshape(sellConfirmed and not bodyFilterPass, title="Sell Signal (Filtered)", location=location.abovebar, color=bodyFilterColor, style=shape.triangledown, size=size.tiny)
barcolor(crossUp or crossDown ? crossCandleColor : na)
barcolor(buyConfirmed and bodyFilterPass ? buyColor : sellConfirmed and bodyFilterPass ? sellColor : na)
// --- Stop & Targets ---
var float lastBuyPrice = na
var float lastSellPrice = na
var bool buyActive = false
var bool sellActive = false
f_drawLine(_price) =>
line.new(bar_index, _price, bar_index+3, _price, color=targetColor, width=2, style=line.style_dotted)
if buyConfirmed and not buyActive and not sellActive
buyActive := true
lastBuyPrice := close
line.new(bar_index, close*(1-stopLossPerc/100), bar_index+3, close*(1-stopLossPerc/100), color=stopColor, width=2, style=line.style_dotted)
f_drawLine(close*(1+reward1/100))
f_drawLine(close*(1+reward2/100))
f_drawLine(close*(1+reward3/100))
if buyActive
if low <= lastBuyPrice*(1-stopLossPerc/100) or high >= lastBuyPrice*(1+reward1/100)
buyActive := false
if sellConfirmed and not sellActive and not buyActive
sellActive := true
lastSellPrice := close
line.new(bar_index, close*(1+stopLossPerc/100), bar_index+3, close*(1+stopLossPerc/100), color=stopColor, width=2, style=line.style_dotted)
f_drawLine(close*(1-reward1/100))
f_drawLine(close*(1-reward2/100))
f_drawLine(close*(1-reward3/100))
if sellActive
if high >= lastSellPrice*(1+stopLossPerc/100) or low <= lastSellPrice*(1-reward1/100)
sellActive := false
// --- Oscillator Panel ---
showPanel = input.bool(true, "Show Oscillator Panel")
panelX = input.int(20, "Panel X Offset (Bars)")
panelY = input.int(50, "Panel Y Offset (Pixels)")
panelBgColor = input.color(color.new(color.black, 85), "Panel Background Color")
panelTextSize = input.string("normal", "Text Size", options= )
// MACD
macdFast = input.int(12)
macdSlow = input.int(26)
macdSignal= input.int(9)
= ta.macd(close, macdFast, macdSlow, macdSignal)
macdBull = macdLine > signalLine
// RSI
rsiLen = input.int(14)
rsiVal = ta.rsi(close, rsiLen)
rsiBull = rsiVal > 50
// TSI
tsiVal = ta.tsi(close, 25, 13)
tsiBull = tsiVal > 0
// Divergence detection (RSI, MACD, TSI)
leftBars = input.int(2)
rightBars = input.int(2)
rsiLow = ta.pivotlow(rsiVal, leftBars, rightBars)
rsiHigh = ta.pivothigh(rsiVal, leftBars, rightBars)
bullDivRSI = not na(rsiLow) and low < low and rsiVal > rsiVal
bearDivRSI = not na(rsiHigh) and high > high and rsiVal < rsiVal
macdLow = ta.pivotlow(macdLine, leftBars, rightBars)
macdHigh = ta.pivothigh(macdLine, leftBars, rightBars)
bullDivMACD = not na(macdLow) and low < low and macdLine > macdLine
bearDivMACD = not na(macdHigh) and high > high and macdLine < macdLine
tsiLow = ta.pivotlow(tsiVal, leftBars, rightBars)
tsiHigh = ta.pivothigh(tsiVal, leftBars, rightBars)
bullDivTSI = not na(tsiLow) and low < low and tsiVal > tsiVal
bearDivTSI = not na(tsiHigh) and high > high and tsiVal < tsiVal
// Plot divergence on chart
plotshape(bullDivRSI, style=shape.labelup, text="R d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivRSI, style=shape.labeldown, text="R d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
plotshape(bullDivMACD, style=shape.labelup, text="M d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivMACD, style=shape.labeldown, text="M d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
plotshape(bullDivTSI, style=shape.labelup, text="T d+", color=color.lime, textcolor=color.white, location=location.belowbar, size=size.tiny)
plotshape(bearDivTSI, style=shape.labeldown, text="T d-", color=color.red, textcolor=color.white, location=location.abovebar, size=size.tiny)
// Panel
var label panelLabel = label.new(bar_index + panelX, close, "", xloc=xloc.bar_index, yloc=yloc.price, style=label.style_label_left, color=panelBgColor, size=panelTextSize)
if showPanel
label.set_xy(panelLabel, bar_index + panelX, close + panelY * syminfo.mintick)
label.set_text(panelLabel, "MACD: " + (macdBull ? "↑" : "↓") + (bullDivMACD ? " d+" : bearDivMACD ? " d-" : "") + " " +
"RSI : " + (rsiBull ? "↑" : "↓") + (bullDivRSI ? " d+" : bearDivRSI ? " d-" : "") + " " +
"TSI : " + (tsiBull ? "↑" : "↓") + (bullDivTSI ? " d+" : bearDivTSI ? " d-" : "") + " " +
"ST : " + (trendLTF==1 ? "↑" : "↓"))
label.set_textcolor(panelLabel, color.white)
// ====================
// === CODE BLOCK 2: FluidTrades - SMC Lite (Light) ===
// ====================
// === SETTINGS ===
swing_length = input.int(10, "Swing High/Low Length", minval=1, maxval=50)
history_keep = input.int(20, "History To Keep", minval=5, maxval=50)
box_width = input.float(2.5, "Supply/Demand Box Width", minval=1, maxval=10, step=0.5)
show_labels = input.bool(false, "Show Price Action Labels")
supply_color = input.color(color.new(#EDEDED,70), "Supply Color")
supply_outline = input.color(color.new(color.white,75), "Supply Outline")
demand_color = input.color(color.new(#00FFFF,70), "Demand Color")
demand_outline = input.color(color.new(color.white,75), "Demand Outline")
bos_color = input.color(color.white, "BOS Label Color")
poi_color = input.color(color.white, "POI Label Color")
label_color = input.color(color.black, "Swing Label Color")
// === FUNCTIONS ===
f_add_pop(arr, val) =>
array.unshift(arr, val)
array.pop(arr)
f_draw_swing_label(values, swing_type) =>
var string txt = na
if swing_type == 1
txt := array.get(values,0) >= array.get(values,1) ? "HH" : "LH"
label.new(bar_index - swing_length, array.get(values,0), txt, style=label.style_label_down, textcolor=label_color, color=color.new(label_color,100), size=size.tiny)
else
txt := array.get(values,0) >= array.get(values,1) ? "HL" : "LL"
label.new(bar_index - swing_length, array.get(values,0), txt, style=label.style_label_up, textcolor=label_color, color=color.new(label_color,100), size=size.tiny)
f_check_overlap(new_poi, box_arr, atr) =>
ok = true
for i=0 to array.size(box_arr)-1
b = array.get(box_arr,i)
top = box.get_top(b)
bot = box.get_bottom(b)
mid = (top+bot)/2
threshold = atr*2
if new_poi >= mid - threshold and new_poi <= mid + threshold
ok := false
break
ok
f_create_box(vals, bn_arr, box_arr, label_arr, type_box, atr) =>
atr_buf = atr*(box_width/10)
left = array.get(bn_arr,0)
right = bar_index
var float top=0.0
var float bottom=0.0
var float poi=0.0
if type_box==1
top := array.get(vals,0)
bottom := top - atr_buf
else
bottom := array.get(vals,0)
top := bottom + atr_buf
poi := (top+bottom)/2
if f_check_overlap(poi, box_arr, atr)
box.delete(array.get(box_arr,array.size(box_arr)-1))
f_add_pop(box_arr, box.new(left, top, right, bottom, border_color=type_box==1?supply_outline:demand_outline,
bgcolor=type_box==1?supply_color:demand_color, extend=extend.right, text=type_box==1?"SUPPLY":"DEMAND",
text_halign=text.align_center, text_valign=text.align_center, text_color=poi_color, text_size=size.small, xloc=xloc.bar_index))
box.delete(array.get(label_arr,array.size(label_arr)-1))
f_add_pop(label_arr, box.new(left, poi, right, poi, border_color=color.new(poi_color,90),
bgcolor=color.new(poi_color,90), extend=extend.right, text="POI", text_halign=text.align_left, text_valign=text.align_center, text_color=poi_color, text_size=size.small, xloc=xloc.bar_index))
f_to_bos(box_arr, bos_arr, label_arr, type_box) =>
for i=0 to array.size(box_arr)-1
b = array.get(box_arr,i)
lvl = type_box==1? box.get_top(b) : box.get_bottom(b)
cond = type_box==1? close>=lvl : close<=lvl
if cond
cbox = box.copy(b)
f_add_pop(bos_arr, cbox)
mid = (box.get_top(b)+box.get_bottom(b))/2
box.set_top(cbox, mid)
box.set_bottom(cbox, mid)
box.set_extend(cbox, extend.none)
box.set_right(cbox, bar_index)
box.set_text(cbox, "BOS")
box.set_text_color(cbox, bos_color)
box.set_text_size(cbox, size.small)
box.set_text_halign(cbox, text.align_center)
box.set_text_valign(cbox, text.align_center)
box.delete(b)
box.delete(array.get(label_arr,i))
f_extend(box_arr) =>
for i=0 to array.size(box_arr)-1
box.set_right(array.get(box_arr,i), bar_index+100)
// === CALCULATIONS ===
atr = ta.atr(50)
swing_high = ta.pivothigh(high, swing_length, swing_length)
swing_low = ta.pivotlow(low, swing_length, swing_length)
var swing_high_vals = array.new_float(5,0.0)
var swing_low_vals = array.new_float(5,0.0)
var swing_high_bn = array.new_int(5,0)
var swing_low_bn = array.new_int(5,0)
var supply_boxes = array.new_box(history_keep, na)
var demand_boxes = array.new_box(history_keep, na)
var supply_poi = array.new_box(history_keep, na)
var demand_poi = array.new_box(history_keep, na)
var bos_supply = array.new_box(5, na)
var bos_demand = array.new_box(5, na)
// NEW SWING HIGH
if not na(swing_high)
f_add_pop(swing_high_vals, swing_high)
f_add_pop(swing_high_bn, bar_index )
if show_labels
f_draw_swing_label(swing_high_vals,1)
f_create_box(swing_high_vals, swing_high_bn, supply_boxes, supply_poi, 1, atr)
// NEW SWING LOW
if not na(swing_low)
f_add_pop(swing_low_vals, swing_low)
f_add_pop(swing_low_bn, bar_index )
if show_labels
f_draw_swing_label(swing_low_vals,-1)
f_create_box(swing_low_vals, swing_low_bn, demand_boxes, demand_poi, -1, atr)
f_to_bos(supply_boxes, bos_supply, supply_poi, 1)
f_to_bos(demand_boxes, bos_demand, demand_poi, -1)
f_extend(supply_boxes)
f_extend(demand_boxes)
//@version=6
length = input.int(9, minval=1)
src = input(close, title="Source")
e1 = ta.ema(src, length)
e2 = ta.ema(e1, length)
dema = 2 * e1 - e2
plot(dema, "DEMA", color=#43A047)
Crypto Breakout Buy/Sell Sequence
⚙️ Components & Sequence Multiple Timeframe (What It Does)
1. Bollinger Bands – Form the foundation by measuring volatility and creating the dynamic range where squeezes and breakouts occur.
2. Squeeze Dots – Show when price compresses inside the bands, signaling reduced volatility before expansion.
3. Breakout Event (Brk Dot) – Fires when price expands beyond the squeeze zone, confirming volatility expansion. (This paints Intra, before candle close)
4. Buy Signal – Confirms entry after a breakout is validated. (This paints at candle close)
5. Pump Signal – Flags sudden surges that extend sharply from the bands, often linked to strong inflows.
6. Momentum Stream – Tracks the strength of movement following the breakout, from continuation (🟢) to slowing (🟡) to exhaustion (🔴). (Resets at Pump Signal)
7. Overbought Indicator – Confirms when momentum has reached overheated conditions, often aligning with band extremes.
8. Sell Signal – Prints when exhaustion/reversal conditions are met, closing the trade cycle.
The Crypto Breakout Buy/Sell Sequence is a no-repaint event indicator that maps a full trade cycle using Bollinger-band-based volatility states: Bollinger Bands → Squeeze → Breakout → Buy → Pump → Momentum → Top Test → Overbought → Sell. Each stage is rule-based and designed to be read on standard candlesticks.
How It Works (System Logic)
Volatility framework: Bollinger Bands define dynamic range and compression/expansion.
Initiation: Squeeze → Breakout confirms expansion; Buy validates participation after expansion begins.
Management: Pump highlights unusual acceleration; Momentum stream tracks continuation → slowing → exhaustion.
Exhaustion/Exit: Top Testing + Overbought build the exhaustion case; Sell marks the sequence end.
How To Use (Quick Guide)
Wait for Squeeze → Breakout → Buy to establish a structured start.
Manage with Momentum:
🟢 continuation, 🟡 slowing, 🔴 exhaustion pressure.
Monitor extremes: Top Testing and/or Overbought = tighten risk.
Exit on Sell or on your risk rules when exhaustion builds.
Limitations & Good Practice
Signals reflect price/volatility behavior, not certainty.
Strong trends can remain extended; Overbought/Top Test ≠ instant reversal.
Always confirm with your own risk rules, position sizing, and market context.
Initial public release: integrated Squeeze/Breakout/Buy → Momentum → Exhaustion → Sell cycle; improved label clarity; cleaned defaults.
Disclaimer
For educational purposes only. Not financial advice. Past performance does not guarantee future results. Test before live use.
Thank You
Margyntrade - Indicator V1Margyntrade is an automatic support-resistance indicator. Calculations are instantaneous and do not reflect past candlesticks. A separate support-resistance point is determined for each currency pair.
Autoback Grid Lab [trade_lexx]Autoback Grid Lab: Your personal laboratory for optimizing grid strategies.
Introduction
First of all, it is important to understand that Autoback Grid Lab is a powerful professional tool for backtesting and optimization, created specifically for traders using both grid strategies and regular take profit with stop loss.
The main purpose of this script is to save you weeks and months of manual testing and parameter selection. Instead of manually testing one combination of settings after another, Autoback Grid Lab automatically tests thousands of unique strategies on historical data, providing you with a comprehensive report on the most profitable and, more importantly, sustainable ones.
If you want to find mathematically sound, most effective settings for your grid strategy on a specific asset and timeframe, then this tool was created for you.
Key Features
My tool has functionality that transforms the process of finding the perfect strategy from a routine into an exciting exploration.
🧪 Mass testing of thousands of combinations
The script is able to systematically generate and run a huge number of unique combinations of parameters through the built-in simulator. You set the ranges, and the indicator does all the work, testing all possible options for the following grid settings:
* Number of safety orders (SO Count)
* Grid step (SO Step)
* Step Multiplier (SO Multiplier) for building nonlinear grids
* Martingale for controlling the volume of subsequent orders
* Take Profit (%)
* Stop Loss (%), with the possibility of calculating both from the entry point and from the dynamic breakeven line
* The volume of the base order (Volume BO) as a percentage of the deposit
🏆 Unique `FinalScore` rating system
Sorting strategies by net profit alone is a direct path to self—deception and choosing strategies that are "tailored" to history and will inevitably fail in real trading. To solve this problem, we have developed FinalScore, a comprehensive assessment of the sustainability and quality of the strategy.
How does it work?
FinalScore analyzes each combination not one by one, but by nine key performance metrics at once, including Net Profit, Drawdown, Profit Factor, WinRate, Sharpe coefficients, Sortino, Squid and Omega. Each of these indicators is normalized, that is, reduced to a single scale. Then, to test the strategy for strength, the system performs 30 iterations, each time assigning random weights to these 9 metrics. A strategy gets a high FinalScore only if it shows consistently high results under different evaluation criteria. This proves her reliability and reduces the likelihood that her success was an accident.
📈 Realistic backtesting engine
The test results are meaningless if they do not take into account the actual trading conditions. Our simulator simulates real trading as accurately as possible, taking into account:
* Leverage: Calculation of the required margin to open and hold positions.
* Commission: A percentage commission is charged each time an order is opened and closed.
* Slippage: The order execution price is adjusted by a set percentage to simulate real market conditions.
* Liquidation model: This is one of the most important functions. The script continuously monitors the equity of the account (capital + unrealized P&L). If equity falls below the level of the supporting margin (calculated from the current value of the position), the simulator forcibly closes the position, as it would happen on a real exchange. This eliminates unrealistic scenarios where the strategy survives after a huge drawdown.
🔌 Integration with external signals
The indicator operates in two modes:
1. `No Signal': Standard mode. The trading cycle starts immediately as soon as the previous one has been closed. Ideal for testing the "pure" mechanics of the grid.
2. `External Signal`: In this mode, a new trading cycle will start only when a signal is received from an external source. You can connect any other indicator (such as the RSI, MACD, or your own strategy) to the script and use it as a trigger to log in. This allows you to combine the power of a grid strategy with your own entry points.
📊 Interactive and informative results panel
Upon completion of the calculations, a detailed table with the TOP N best strategies appears on the screen, sorted according to your chosen criterion. For each strategy in the rating, you will see not only the key metrics (Profit, Drawdown, duration of transactions), but also all the parameters that led to this result. You can immediately take these settings and apply them in your trading.
Application Options: How To Solve Your Problems
Autoback Grid Lab is a flexible tool that can be adapted to solve various tasks, from complete grid optimization to fine—tuning existing strategies. Here are some key scenarios for its use:
1. Complete Optimization Of The Grid Strategy
This is the basic and most powerful mode of use. You can find the most efficient grid configuration for any asset from scratch.
* How to use: Set wide ranges for all key grid parameters ('SO Count`, SO Step, SO Multiplier, Martingale, TP, etc.).
* In the `No Signal` mode: You will find the most stable grid configuration that works as an independent, constantly active strategy, regardless of which-or entrance indicators.
* In the `External Signal` mode: You can connect your favorite indicator for input (for example, RSI, MACD or a complex author's script) and find the optimal grid parameters that best complement your input signals. This allows you to turn a simple signaling strategy into a full-fledged grid system.
2. Selecting the Optimal Take Profit and Stop Loss for Your Strategy
Do you already have an entry strategy, but you are not sure where it is best to put Take Profit and Stop Loss? Autoback Grid Lab can solve this problem as well.
* How to use:
1. Disable optimization of all grid parameters (uncheck SO Count, SO Step, Martingale, etc.). Set the Min value for SO Count to 0.
2. Set the ranges for iteration only for 'Take Profit` and `Stop Loss'.
3. Turn on the External Signal mode and connect your indicator with input signals.
* Result: The script will run your historical entry signals with hundreds of different TP and SL combinations and show you which stop order levels bring maximum profit with minimal risk specifically for your entry points.
3. Building a Secure Network with Risk Management
Many traders are afraid of grid strategies because of the risk of large drawdowns. With the help of the optimizer, you can purposefully find the parameters for such a grid, which includes mandatory risk management through Stop Loss.
* How to use: Enable and set the range for Stop Loss, along with other grid parameters. Don't forget to test both types of SL calculations (`From entry point` and `From breakeven line`) to determine which one works more efficiently.
* Result: You will find balanced strategies in which the grid parameters (number of orders, martingale) and the Stop Loss level are selected in such a way as to maximize profits without going beyond the acceptable risk level for you.
How To Use The Indicator (Step-By-Step Guide)
Working with the Autoback Grid Lab is a sequential process consisting of four main steps: from initial setup to analysis of the finished results. Follow this guide to get the most out of the tool.
Step 1: Initial Setup
1. Add the indicator to the chart of your chosen asset and timeframe.
2. Open the script settings. The first thing you should pay attention to is the ⚙️ Optimization Settings ⚙️ group.
3. Set the `Bars Count'. This parameter determines how much historical data will be used for testing.
* Important: The more bars you specify, the more statistically reliable the backtest results will be. We recommend using the maximum available value (25,000) to test strategies at different market phases.
* Consider: The indicator performs all calculations on the last historical bar. After applying the TradingView settings, it will take some time to load all the specified bars. The results table will appear only after the data is fully loaded. Don't worry if it doesn't appear instantly. And if an error occurs, simply switch the number of combinations to 990 and back to 1000 until the table appears.
Step 2: Optimization Configuration
At this stage, you define the "universe" of parameters that our algorithm will explore.
1. Set the search ranges (🛠 Optimization Parameters 🛠 group).
For each grid parameter that you want to optimize (for example, SO Count or `Take Profit'), you must specify three values:
* Min: The minimum value of the range.
* Max: The maximum value of the range.
* Step: The step with which the values from Min to Max will be traversed.
*Example:* If you set Min=5, Max=10, and Step=1 for SO Count, the script will test strategies with 5, 6, 7, 8, 9, and 10 safety orders.
* Tip for users: To get the first results quickly, start with a larger step (for example, TP from 0.5% to 2.5% in 0.5 increments instead of 0.1). After you identify the most promising areas, you can perform a deeper analysis by expanding the ranges around these values.
2. Set Up Money Management (Group `💰 Money Management Settings 💰`).
Fill in these fields with the values that best match your actual trading conditions. This is critically important for obtaining reliable results.
* Capital: Your initial deposit.
* Leverage: Leverage.
* Commission (%): Your trading commission as a percentage.
* Slippage (%): Expected slippage.
* Liquidation Level (%): The level of the supporting margin (MMR in %). For example, for Binance Futures, this value is usually between 0.4% and 2.5%, depending on the asset and position size. Specify this value for your exchange.
3. Select the Sorting Criterion and the Direction (Group `⚙️ Optimization Settings ⚙️').
* `Sort by': Specify the main criteria by which the best strategies will be selected and sorted. I strongly recommend using finalScore to find the most balanced and sustainable strategies.
* `Direction': Choose which trades to test: Long, Short or Both.
Step 3: Start Testing and Work with "Parts"
The total number of unique combinations generated based on your ranges can reach tens of millions. TradingView has technical limitations on the number of calculations that the script can perform at a time. To get around this, I implemented a "Parts" system.
1. What are `Part` and `Combinations in Part'?
* `Combinations in Part': This is the number of backtests that the script performs in one run (1000 by default).
* `Part`: This is the number of the "portion" of combinations that you want to test.
2. How does it work in practice?
* After you have everything set up, leave Part:1 and wait for the results table to appear. You will see the TOP N best strategies from the first thousand tested.
* Analyze them. Then, to check the next thousand combinations, just change the Part to 2 in the settings and click OK. The script will run a test for the next batch.
* Repeat this process by increasing the Part number (`3`, 4, 5...), until you reach the last available part.
* Where can I see the total number of parts? In the information row below the results table, you will find Total parts. This will help you figure out how many more tests are left to run.
Step 4: Analyze the Results in the Table
The results table is your main decision—making tool. It displays the best strategies found, sorted by the criteria you have chosen.
1. Study the performance metrics:
* Rating: Position in the rating.
* Profit %: Net profit as a percentage of the initial capital.
* Drawdown%: The maximum drawdown of the deposit for the entire test period.
* Max Length: The maximum duration of one transaction in days, hours and minutes.
* Trades: The total number of completed trades.
2. Examine the winning parameters:
* To the right of the performance metrics are columns showing the exact settings that led to this result ('SO Count`, SO Step, TP (%), etc.).
3. How to choose the best strategy?
* Don't chase after the maximum profit! The strategy with the highest profit often has the highest drawdown, which makes it extremely risky.
* Seek a balance. The ideal strategy is a compromise between high profitability, low drawdown (Drawdown) and the maximum length of trades acceptable to you (Max Length).
* finalScore was created to find this balance. Trust him — he often highlights not the most profitable, but the most stable and reliable options.
Detailed Description Of The Settings
This section serves as a complete reference for each parameter available in the script settings. The parameters are grouped in the same way as in the indicator interface for your convenience.
Group: ⚙️ Optimization Settings ⚙️
The main parameters governing the testing process are collected here.
* `Enable Optimizer': The main switch. Activates or deactivates all backtesting functionality.
* `Direction': Determines which way trades will be opened during the simulation.
* Long: Shopping only.
* Short: Sales only.
* Both: Testing in both directions. Important: This mode only works in conjunction with an External Signal, as the script needs an external signal to determine the direction for each specific transaction.
* `Signal Mode`: Controls the conditions for starting a new trading cycle (opening a base order).
* No Signal: A new cycle starts immediately after the previous one is completed. This mode is used to test "pure" grid mechanics without reference to market conditions.
* External Signal: A new cycle begins only when a signal is received from an external indicator connected via the Signal field.
* `Signal': A field for connecting an external signal source (works only in the `External Signal` mode). You can select any other indicator on the chart.
* For Long** trades, the signal is considered received if the value of the external indicator ** is greater than 0.
* For Short** trades, the signal is considered received if the value of the external indicator ** is less than 0.
* `Bars Count': Sets the depth of the history in the bars for the backtest. The maximum value (25000) provides the most reliable results.
* `Sort by`: A key criterion for selecting and ranking the best strategies in the final table.
* FinalScore: Recommended mode. A comprehensive assessment that takes into account 9 metrics to find the most balanced and sustainable strategies.
* Profit: Sort by net profit.
* Drawdown: Sort by minimum drawdown.
* Max Length: Sort by the minimum length of the longest transaction.
* `Combinations Count': Indicates how many of the best strategies (from 1 to 50) will be displayed in the results table.
* `Close last trade`: If this option is enabled, any active trade will be forcibly closed at the closing price of the last historical bar. For grid strategies, it is recommended to always enable this option in order to get the correct calculation of the final profit and eliminate grid strategies that have been stuck for a long time.
Group: 💰 Money Management Settings 💰
The parameters in this group determine the financial conditions of the simulation. Specify values that are as close as possible to your actual values in order to get reliable results.
* `Capital': The initial deposit amount for the simulation.
* `Leverage`: The leverage used to calculate the margin.
* `Slippage` (%): Simulates the difference between the expected and actual order execution price. The specified percentage will be applied to each transaction.
* `Commission` (%): The trading commission of your exchange as a percentage. It is charged at the execution of each order (both at opening and closing).
* `Liquidation Level' (%): Maintenance Margin Ratio. This is a critical parameter for a realistic test. Liquidation in the simulator occurs if the Equity of the account (Capital + Unrealized P&L) falls below the level of the supporting margin.
Group: 🛠 Optimization Parameters 🛠
This is the "heart" of the optimizer, where you set ranges for iterating through the grid parameters.
* `Part`: The portion number of the combinations to be tested. Start with 1, and then increment (`2`, 3, ...) sequentially to check all generated strategies.
* `Combinations in Part': The number of backtests performed at a time (in one "Part"). Increasing the value may speed up the process, but it may cause the script to error due to platform limitations. If an error occurs, it is recommended to switch to the step below and back.
Three fields are available for each of the following parameters (`SO Count`, SO Step, SO Multiplier, etc.):
* `Min`: Minimum value for testing.
* `Max': The maximum value for testing.
* `Step`: The step with which the values in the range from Min to Max will be iterated over.
There is also a checkbox for each parameter. If it is enabled, the parameter will be optimized in the specified range. If disabled, only one value specified in the Min field will be used for all tests.
* 'Stop Loss': In addition to the standard settings Min, Max, Step, it has an additional parameter:
* `Type`: Defines how the stop loss price is calculated.
* From entry point: The SL level is calculated once from the entry price (base order price).
* From breakeven line: The SL level is dynamically recalculated from the average position price after each new safety order is executed.
Group: ⚡️Filters⚡️
Filters allow you to filter out those results from the final table that do not meet your minimum requirements.
For each filter (`Max Profit`, Min Drawdown, `Min Trade Length`), you can:
1. Turn it on or off using the checkbox.
2. Select the comparison condition: Greater (More) or Less (Less).
3. Set a threshold value.
*Example:* If you set Less and 20 for the Min Drawdown filter, only those strategies with a maximum drawdown of less than 20% will be included in the final table.
Group: 🎨 Visual Settings 🎨
Here you can customize the appearance of the results table.
* `Position': Selects the position of the table on the screen (for example, Bottom Left — bottom left).
* `Font Size': The size of the text in the table.
* `Header Background / Data Background`: Background colors for the header and data cells.
* `Header Font Color / Data Font Color`: Text colors for the header and data cells.
Important Notes and Limitations
So that you can use the Autoback Grid Lab as efficiently and consciously as possible, please familiarize yourself with the following key features of its work.
1. It is a Tool for Analysis, not for Signals
It is extremely important to understand that this script does not generate trading signals in real time. Its sole purpose is to conduct in—depth research (**backtesting**) on historical data.
* The results you see in the table are a report on how a particular strategy would have worked in the past.
* The script does not provide alerts and does not draw entry/exit points on the chart for the current market situation.
* Your task is to take the best sets of parameters found during optimization and use them in your real trading, for example, when setting up a trading bot or in a manual trading system.
2. Features Of Calculations (This is not a "Repainting")
You will notice that the results table appears and is updated only once — when all historical bars on the chart are loaded. It does not change in real time with each tick of the price.
This is correct and intentional behavior.:
* To test thousands, and sometimes millions of combinations, the script needs to perform a huge amount of calculations. In the Pine Script™ environment, it is technically possible to do this only once, at the very last bar in history.
* The script does not show false historical signals, which then disappear or change. It provides a static report on the results of the simulation, which remains unchanged for a specific historical period.
3. Past Results do not Guarantee Future Results.
This is the golden rule of trading, and it fully applies to the results of backtesting. Successful strategy performance in the past is not a guarantee that it will be as profitable in the future. Market conditions, volatility and trends are constantly changing.
My tool, especially when sorting by finalScore, is aimed at finding statistically stable and reliable strategies to increase the likelihood of their success in the future. However, it is a tool for managing probabilities, not a crystal ball for predicting the future. Always use proper risk management.
4. Dependence on the Quality and Depth of the Story
The reliability of the results directly depends on the quantity and quality of the historical data on which the test was conducted.
* Always strive to use the maximum number of bars available (`Bars Count: 25,000`) so that your strategy is tested on different market cycles (rise, fall, flat).
* The results obtained on data for one month may differ dramatically from the results obtained on data for two years. The longer the testing period, the higher the confidence in the parameters found.
Conclusion
The Autoback Grid Lab is your personal research laboratory, designed to replace intuitive guesses and endless manual selection of settings with a systematic, data—driven approach. Experiment with different assets, timeframes, and settings ranges to find the unique combinations that best suit your trading style.