Fibonacci Levels on Any Indicator [By MUQWISHI]▋ INTRODUCTION : 
A “Fibonacci Levels on Any Indicator” can be applied to any indicator to draw Fibonacci levels based on provided conditions of two price points to produce a sequence of horizontal line levels starting from 0% to 100% in addition to extension levels. The 0% level is measured as the start of retracement, while the 100% level is the beginning of the extension levels. This tool was developed to be easy to add to any indicator, and it could be valuable to some traders in terms of managing trades by setting targets and reducing risk in the trend direction.
_______________________
 ▋ USAGE: 
➤ NEEDS TO IDENTIFY 4 ELEMENTS:
  
1. Starting Point. What’re the conditions / When will the drawing of the Fibonacci levels begin?
2. Ending Point. What’re the conditions / When will the drawing of the Fibonacci levels end?
3. High Point. What is the price for a 100% Fibonacci level (0% for the downside)?
4. Low Point. What is the price for a 0% Fibonacci level (100% for the downside)?
➤  STARTING & ENDING POINTS CONDITIONS:
Need to specify the condition when the drawing of Fibonacci levels starts and ends, and the indicator shows different prepared conditions.
  
 
  New Phase: Import a value (plot) from an existing indicator, where its status changes from NaN to a real number.
  Crosses Above/Below: Import a value(1) (plot) from an existing indicator, where it crosses above/below value(2).
  Reversal Up/Down: Import a value(1) (plot) from an existing indicator, where it rises/decreases than the previous value(1). 
  First/Last Bar: Useful to draw stationary Fibonacci levels.
 
➤  UPPER & LOWER PIVOTS (0% & 100%):
Need to specify the two price points representing 0% & 100% Fibonacci levels to expose the sequence of Fibonacci lines.
  
 
  Upper Pivot. By default, the ATR Upper Band. It’s possible to import a custom value from an existing indicator.
  Lower Pivot. By default, the ATR Lower Band. It’s possible to import a custom value from an existing indicator. 
 
➤  FIBONACCI STYLING OPTIONS:
Ability to customize line & label style, color, reverse, and hide/show levels.
  
_______________________
 ▋ IMPLEMENTATION: 
Here are some examples of implementing the indicator.
 Note: All presented examples below are for demonstration purposes, and they're not trading suggestions. 
# Example 1: (Reversal Up/Down)
We want to implement Fibonacci levels on the  Hull MA by mohamed982 . Our requirements are as follows:
 
  Fibonacci levels start when the Hull MA reverses up.
  Fibonacci levels end when the Hull MA reverses down.
  Upper Pivot is the ATR Upper Band.
  Lower Pivot is the ATR Lower Band.
 
After adding the required indicator (Hull MA), here’re the implementation and results
  
# Example 2:  (Crosses Above/Below)
We want to implement Fibonacci Level on the   Squeeze Momentum by LazyBear . Our requirements are as follows:
 
  Fibonacci levels start when the Squeeze Momentum histogram crosses above 0.
  Fibonacci levels end when the Squeeze Momentum histogram crosses below 0.
  Upper Pivot is the Bollinger Upper Band.
  Lower Pivot is the Bollinger Lower Band.
 
After adding the required indicators (Squeeze Momentum & Bollinger Band), here’re the implementation and results
  
# Example 3:  (Crosses Above/Below)
We want to implement Fibonacci Level on the Crossing Moving Averages. Our requirements are as follows: 
 
  Fibonacci levels start when the 20-EMA crosses above 100-MA.
  Fibonacci levels end when the 20-EMA crosses below 100-MA.
  Upper Pivot is the ATR Upper Band.
  Lower Pivot is the ATR Lower Band.
 
After adding the required indicators (20-EMA & 100-MA), here’re the implementation and results
  
# Example 4:  (New Phase: When the previous value is NaN, and the current value is a real number.)
We want to implement Fibonacci Level on the Supertrend. Our requirements are as follows: 
 
  Fibonacci levels start when an up-Supertrend (green) line shows up.
  Fibonacci levels end when a down-Supertrend (red) line shows up.
  Upper Pivot is the down-Supertrend.
  Lower Pivot is the up-Supertrend.
 
After adding the required indicator (Supertrend), here’re the implementation and results
  
# Example 5: (First/Last Bar)
We want to implement Fibonacci Level between two points, 330 & 300. Our requirements are as follows: 
 
  Fibonacci levels start at first bar on the chart.
  Fibonacci levels end at last bar on the chart.
  Upper Pivot is 330.
  Lower Pivot is 300.
 
Here’re the implementation and results. 
  
 To customize the number of bars back (like 50 bars) 
  
_______________________
 ▋ Final Comments: 
 
  The “Fibonacci Levels on Any Indicator” is made to apply on other indicators for planning Fibonacci Levels. 
  It can be implemented in different ways, along with presented examples.
  This indicator does not work with plots that were developed by drawing classes.
 
Please let me know if you have any questions.
Thank you.
ค้นหาในสคริปต์สำหรับ "supertrend"
SupportResitanceAndTrendLibrary   "SupportResitanceAndTrend" 
Contains utilities for finding key levels of support, resistance and direction of trend.
 superTrendPlus(multiple, h, l, atr, closeBars) 
  A more flexible version of SuperTrend that allows for supplying the series used and sensitivity adjustment by confirming close bars.
  Parameters:
     multiple : The multiple to apply to the average true range.
     h : The high values.
     l : The low values.
     atr : The average true range values.
     closeBars : The number of bars to confirm a change in trend.
  Returns:  
 superTrend(multiple, period, mode, closeBars) 
  superTrendPlus with simplified parameters.
  Parameters:
     multiple : The multiple to apply to the average true range.
     period : The number of bars to measure.
     mode : The type of moving average to use with the true range.
     closeBars : The number of bars to confirm a change in trend.
  Returns:  
 superTrendCleaned(multiple, period, mode, closeBars, maxDeviation) 
  superTrendPlus with default compensation for extreme volatility.
  Parameters:
     multiple : The multiple to apply to the average true range.
     period : The number of bars to measure.
     mode : The type of moving average to use with the true range.
     closeBars : The number of bars to confirm a change in trend.
     maxDeviation : The optional standard deviation level to use when cleaning the series.  The default is the value of the provided level. 
  Returns:  
 stochSR() 
  Identifies support and resistance levels by when a stochastic RSI reverses.
  Returns:  
 stochAVWAP() 
  Identifies anchored VWAP levels by when a stochastic RSI reverses.
  Returns: 
VANILLA BUY SELLThis script uses three components:-
USEFUL MA by @ALEXGROVER
SUPERTREND INDICATOR(3 supertrend with different ATR and multiplier) provided by tradingview.
VIX FEAR GAUGE by @bizkitbr
To make it easy and line free, supertrend lines have been removed but the color fill has been kept. This makes the chart clean.
For option traders, direction and momentum is everything. Hence, two need to be really clear:-
a) BUY OR SELL
b) Whether momentum exists of not
While rise is charecterised by a steady pace, a fall is charecterized by a rapid decline.
So in order to make the best use of of the charecters, a careful interpretation and backtesting has been done to enable buy sell only when vix conditions are met.
BUY SIGNAL
A buy signal is generated on following conditions:-
a)PRICE CLOSE ABOVE USEFUL MA
B)ALL THREE SUPERTRENDS ARE GREEN
C)VIXFIX IS BELOW 0.18.
SELL SIGNAL
This is generated when following is met:-
A) PRICE BELOW USEFUL MA
B)ALL THREE SUPERTRENDS ARE RED
C)VIXFIX IS ABOBE 0.18
ADDITIONALLY, A SMALL BACKGROUND COLOR CHANGE PROVIDED FOR AREAS WHERE THERE IS A BUY OR SELL.
Either labels can be used or background colours referred for seeing buy or sell.
magic wand STSM"Magic Wand STSM" Strategy: Trend-Following with Dynamic Risk Management
Overview:
The "Magic Wand STSM" (Supertrend & SMA Momentum) is an automated trading strategy designed to identify and capitalize on sustained trends in the market. It combines a multi-timeframe Supertrend for trend direction and potential reversal signals, along with a 200-period Simple Moving Average (SMA) for overall market bias. A key feature of this strategy is its dynamic position sizing based on a user-defined risk percentage per trade, and a built-in daily and monthly profit/loss tracking system to manage overall exposure and prevent overtrading.
How it Works (Underlying Concepts):
    Multi-Timeframe Trend Confirmation (Supertrend):
        The strategy uses two Supertrend indicators: one on the current chart timeframe and another on a higher timeframe (e.g., if your chart is 5-minute, the higher timeframe Supertrend might be 15-minute).
        Trend Identification: The Supertrend's direction output is crucial. A negative direction indicates a bearish trend (price below Supertrend), while a positive direction indicates a bullish trend (price above Supertrend).
        Confirmation: A core principle is that trades are only considered when the Supertrend on both the current and the higher timeframe align in the same direction. This helps to filter out noise and focus on stronger, more confirmed trends. For example, for a long trade, both Supertrends must be indicating a bearish trend (price below Supertrend line, implying an uptrend context where price is expected to stay above/rebound from Supertrend). Similarly, for short trades, both must be indicating a bullish trend (price above Supertrend line, implying a downtrend context where price is expected to stay below/retest Supertrend).
        Trend "Readiness": The strategy specifically looks for situations where the Supertrend has been stable for a few bars (checking barssince the last direction change).
    Long-Term Market Bias (200 SMA):
        A 200-period Simple Moving Average is plotted on the chart.
        Filter: For long trades, the price must be above the 200 SMA, confirming an overall bullish bias. For short trades, the price must be below the 200 SMA, confirming an overall bearish bias. This acts as a macro filter, ensuring trades are taken in alignment with the broader market direction.
    "Lowest/Highest Value" Pullback Entries:
        The strategy employs custom functions (LowestValueAndBar, HighestValueAndBar) to identify specific price action within the recent trend:
            For Long Entries: It looks for a "buy ready" condition where the price has found a recent lowest point within a specific number of bars since the Supertrend turned bearish (indicating an uptrend). This suggests a potential pullback or consolidation before continuation. The entry trigger is a close above the open of this identified lowest bar, and also above the current bar's open.
            For Short Entries: It looks for a "sell ready" condition where the price has found a recent highest point within a specific number of bars since the Supertrend turned bullish (indicating a downtrend). This suggests a potential rally or consolidation before continuation downwards. The entry trigger is a close below the open of this identified highest bar, and also below the current bar's open.
        Candle Confirmation: The strategy also incorporates a check on the candle type at the "lowest/highest value" bar (e.g., closevalue_b < openvalue_b for buy signals, meaning a bearish candle at the low, suggesting a potential reversal before a buy).
Risk Management and Position Sizing:
    Dynamic Lot Sizing: The lotsvalue function calculates the appropriate position size based on your Your Equity input, the Risk to Reward ratio, and your risk percentage for your balance % input. This ensures that the capital risked per trade remains consistent as a percentage of your equity, regardless of the instrument's volatility or price. The stop loss distance is directly used in this calculation.
    Fixed Risk Reward: All trades are entered with a predefined Risk to Reward ratio (default 2.0). This means for every unit of risk (stop loss distance), the target profit is rr times that distance.
    Daily and Monthly Performance Monitoring:
        The strategy tracks todaysWins, todaysLosses, and res (daily net result) in real-time.
        A "daily profit target" is implemented (day_profit): If the daily net result is very favorable (e.g., res >= 4 with todaysLosses >= 2 or todaysWins + todaysLosses >= 8), the strategy may temporarily halt trading for the remainder of the session to "lock in" profits and prevent overtrading during volatile periods.
        A "monthly stop-out" (monthly_trade) is implemented: If the lres (overall net result from all closed trades) falls below a certain threshold (e.g., -12), the strategy will stop trading for a set period (one week in this case) to protect capital during prolonged drawdowns.
Trade Execution:
    Entry Triggers: Trades are entered when all buy/sell conditions (Supertrend alignment, SMA filter, "buy/sell situation" candle confirmation, and risk management checks) are met, and there are no open positions.
    Stop Loss and Take Profit:
        Stop Loss: The stop loss is dynamically placed at the upTrendValue for long trades and downTrendValue for short trades. These values are derived from the Supertrend indicator, which naturally adjusts to market volatility.
        Take Profit: The take profit is calculated based on the entry price, the stop loss, and the Risk to Reward ratio (rr).
    Position Locks: lock_long and lock_short variables prevent immediate re-entry into the same direction once a trade is initiated, or after a trend reversal based on Supertrend changes.
Visual Elements:
    The 200 SMA is plotted in yellow.
    Entry, Stop Loss, and Take Profit lines are plotted in white, red, and green respectively when a trade is active, with shaded areas between them to visually represent risk and reward.
    Diamond shapes are plotted at the bottom of the chart (green for potential buy signals, red for potential sell signals) to visually indicate when the buy_sit or sell_sit conditions are met, along with other key filters.
    A comprehensive trade statistics table is displayed on the chart, showing daily wins/losses, daily profit, total deals, and overall profit/loss.
    A background color indicates the active trading session.
Ideal Usage:
This strategy is best applied to instruments with clear trends and sufficient liquidity. Users should carefully adjust the Your Equity, Risk to Reward, and risk percentage inputs to align with their individual risk tolerance and capital. Experimentation with different ATR Length and Factor values for the Supertrend might be beneficial depending on the asset and timeframe.
Uptrick: MultiTrend Squeeze System**Uptrick: MultiTrend Squeeze System Indicator: The Ultimate Trading Tool for Precision and Versatility 📈🔥**
### Introduction
The MultiTrend Squeeze System is a powerful, multi-faceted trading indicator designed to provide traders with precise buy and sell signals by combining the strengths of multiple technical analysis tools. This script isn't just an indicator; it's a comprehensive trading system that merges the power of SuperTrend, RSI, Volume Filtering, and Squeeze Momentum to give you an unparalleled edge in the market. Whether you're a day trader looking for short-term opportunities or a swing trader aiming to catch longer-term trends, this indicator is tailored to meet your needs. 
### Key Features and Unique Aspects
1. **SuperTrend with Dynamic Adjustments 📊**
   - **Adaptive SuperTrend Calculation:** The SuperTrend is a popular trend-following indicator that adjusts dynamically based on market conditions. It uses the Average True Range (ATR) to calculate upper and lower bands, which shift according to market volatility. This script takes it further by combining it with the RSI and Volume filtering to provide more accurate signals.
   - **Direction Sensitivity:** The SuperTrend here is not static. It adjusts based on the direction of the previous SuperTrend value, ensuring that the indicator remains relevant even in choppy markets.
2. **RSI Integration for Overbought/Oversold Conditions 💹**
   - **RSI Calculation:** The Relative Strength Index (RSI) is incorporated to identify overbought and oversold conditions, adding an extra layer of precision. This helps in filtering out false signals and ensuring that trades are taken only in optimal conditions.
   - **Customizable RSI Settings:** The RSI settings are fully customizable, allowing traders to adjust the RSI length and the overbought/oversold levels according to their trading style and market.
3. **Volume Filtering for Enhanced Signal Confirmation 📉**
   - **Volume Multiplier:** This unique feature integrates volume analysis, ensuring that signals are only generated when there is sufficient market participation. The Volume Multiplier can be adjusted to filter out weak signals that occur during low-volume periods.
   - **Optional Volume Filtering:** Traders have the flexibility to turn the volume filter on or off, depending on their preference or market conditions. This makes the indicator versatile, allowing it to be used across different asset classes and market conditions.
4. **Squeeze Momentum Indicator (SMI) for Market Pressure Analysis 💥**
   - **Squeeze Detection:** The Squeeze Momentum Indicator detects periods of market compression and expansion. This script goes beyond the traditional Bollinger Bands and Keltner Channels by incorporating true range calculations, offering a more nuanced view of market momentum.
   - **Customizable Squeeze Settings:** The lengths and multipliers for both Bollinger Bands and Keltner Channels are customizable, giving traders the flexibility to fine-tune the indicator based on their specific needs.
5. **Visual and Aesthetic Customization 🎨**
   - **Color-Coding for Clarity:** The indicator is color-coded to make it easy to interpret signals. Bullish trends are marked with a vibrant green color, while bearish trends are highlighted in red. Neutral or unconfirmed signals are displayed in softer tones to reduce noise.
   - **Histogram Visualization:** The primary trend direction and strength are displayed as a histogram, making it easy to visualize the market's momentum at a glance. The height and color of the bars provide immediate feedback on the strength and direction of the trend.
6. **Alerts for Real-Time Trading 🚨**
   - **Custom Alerts:** The script is equipped with custom alerts that notify traders when a buy or sell signal is generated. These alerts can be configured to send notifications through various channels, including email, SMS, or directly to the trading platform.
   - **Immediate Reaction:** The alerts are triggered based on the confluence of SuperTrend, RSI, and Volume signals, ensuring that traders are notified only when the most robust trading opportunities arise.
7. **Comprehensive Input Customization ⚙️**
   - **SuperTrend Settings:** Adjust the ATR length and factor to control the sensitivity of the SuperTrend. This allows you to adapt the indicator to different market conditions, whether you're trading a volatile cryptocurrency or a more stable stock.
   - **RSI Settings:** Customize the RSI length and thresholds for overbought and oversold conditions, enabling you to tailor the indicator to your specific trading strategy.
   - **Volume Settings:** The Volume Multiplier and the option to toggle the volume filter provide an additional layer of customization, allowing you to fine-tune the indicator based on market liquidity and participation.
   - **Squeeze Momentum Settings:** The lengths and multipliers for Bollinger Bands and Keltner Channels can be adjusted to detect different levels of market compression, providing flexibility for both short-term and long-term traders.
### How It Works: A Deep Dive Into the Mechanics 🛠️
1. **SuperTrend Calculation:**
   - The SuperTrend is calculated using the ATR, which measures market volatility. The indicator creates upper and lower bands around the price, adjusting these bands based on the current level of market volatility. The direction of the trend is determined by the position of the price relative to these bands.
   - The script enhances the standard SuperTrend by ensuring that the bands do not flip-flop too quickly, reducing the chances of false signals in a choppy market. The direction is confirmed by checking the position of the close relative to the previous band, making the trend detection more reliable.
2. **RSI Integration:**
   - The RSI is calculated over a customizable length and compared to user-defined overbought and oversold levels. When the RSI crosses below the oversold level, and the SuperTrend indicates a bullish trend, a buy signal is generated. Conversely, when the RSI crosses above the overbought level, and the SuperTrend indicates a bearish trend, a sell signal is triggered.
   - The combination of RSI with SuperTrend ensures that trades are only taken when there is a strong confluence of signals, reducing the chances of entering trades during weak or indecisive market phases.
3. **Volume Filtering:**
   - The script calculates the average volume over a 20-period simple moving average. The volume filter ensures that buy and sell signals are only valid when the current volume exceeds a multiple of this average, which can be adjusted by the user. This feature helps filter out weak signals that might occur during low-volume periods, such as just before a major news event or during after-hours trading.
   - The volume filter is particularly useful in markets where volume spikes are common, as it ensures that signals are only generated when there is significant market interest in the direction of the trend.
4. **Squeeze Momentum:**
   - The Squeeze Momentum Indicator (SMI) adds a layer of market pressure analysis. The script calculates Bollinger Bands and Keltner Channels, detecting when the market is in a "squeeze" — a period of low volatility that typically precedes a significant price move.
   - When the Bollinger Bands are inside the Keltner Channels, the market is in a squeeze (compression phase). This is often a precursor to a breakout or breakdown. The script colors the histogram bars black during this phase, indicating a potential for a strong move. Once the squeeze is released, the bars are colored according to the direction of the SuperTrend, signaling a potential entry point.
5. **Integration and Signal Generation:**
   - The script brings together the SuperTrend, RSI, Volume, and Squeeze Momentum to generate highly accurate buy and sell signals. A buy signal is triggered when the SuperTrend is bullish, the RSI indicates oversold conditions, and the volume filter confirms strong market participation. Similarly, a sell signal is generated when the SuperTrend is bearish, the RSI indicates overbought conditions, and the volume filter is met.
   - The combination of these elements ensures that the signals are robust, reducing the likelihood of entering trades during weak or indecisive market conditions.
### Practical Applications: How to Use the MultiTrend Squeeze System 📅
1. **Day Trading:**
   - For day traders, this indicator provides quick and reliable signals that can be used to enter and exit trades multiple times within a day. The volume filter ensures that you are trading during the most liquid times of the day, increasing the chances of successful trades. The Squeeze Momentum aspect helps you catch breakouts or breakdowns, which are common in intraday trading.
2. **Swing Trading:**
   - Swing traders can use the MultiTrend Squeeze System to identify longer-term trends. By adjusting the ATR length and factor, you can make the SuperTrend more sensitive to catch longer-term moves. The RSI and Squeeze Momentum aspects help you time your entries and exits, ensuring that you get in early on a trend and exit before it reverses.
3. **Scalping:**
   - For scalpers, the quick signals provided by this system, especially in combination with the volume filter, make it easier to take small profits repeatedly. The histogram bars give you a clear visual cue of the market's momentum, making it easier to scalp effectively.
4. **Position Trading:**
   - Even position traders can benefit from this indicator by using it to confirm long-term trends. By adjusting the settings to less sensitive parameters, you can ensure that you are only entering trades when a strong trend is confirmed. The Squeeze Momentum indicator will help you stay in the trade during periods of consolidation, waiting for the next big move.
### Conclusion: Why the MultiTrend Squeeze System is a Game-Changer 🚀
The MultiTrend Squeeze System is not just another trading indicator; it’s a comprehensive trading strategy encapsulated within a single script. By combining the power
 of SuperTrend, RSI, Volume Filtering, and Squeeze Momentum, this indicator provides a robust and versatile tool that can be adapted to various trading styles and market conditions.
**Why is it Unique?**
- **Multi-Dimensional Analysis:** Unlike many other indicators that rely on a single data point or calculation, this script incorporates multiple layers of analysis, ensuring that signals are based on a confluence of factors, which increases their reliability.
- **Customizability:** The vast range of input settings allows traders to tailor the indicator to their specific needs, whether they are trading forex, stocks, cryptocurrencies, or commodities.
- **Visual Clarity:** The color-coded bars, labels, and signals make it easy to interpret the market conditions at a glance, reducing the time needed to make trading decisions.
Whether you are a novice trader or an experienced market participant, the MultiTrend Squeeze System offers a powerful toolset to enhance your trading strategy, reduce risk, and maximize your potential returns. With its combination of trend analysis, momentum detection, and volume filtering, this indicator is designed to help you trade with confidence and precision in any market condition.
Gold Trade Setup Strategy
Title: Profitable Gold Setup Strategy with Adaptive Moving Average & Supertrend
Introduction:
This trading strategy for Gold (XAU/USD) combines the Adaptive Moving Average (AMA) and Supertrend, tailored for high-probability setups during specific trading hours. The AMA identifies the trend, while the Supertrend confirms entry and exit points. The strategy is optimized for swing and intraday traders looking to capitalize on Gold’s price movements with precise trade timing.
Strategy Components:
	1.	Adaptive Moving Average (AMA):
	•	Reacts dynamically to market conditions, filtering noise in choppy markets.
	•	Serves as the primary trend indicator.
	2.	Supertrend:
	•	Confirms entry signals with clear buy and sell levels.
	•	Acts as a trailing stop-loss to protect profits.
Trading Rules:
Trading Hours:
	•	Only take trades between 8:30 AM and 10:30 PM IST.
	•	Avoid trading outside these hours to reduce noise and low-volume setups.
Buy Setup:
	1.	Trend Confirmation: The Adaptive Moving Average (AMA) must be green.
	2.	Signal Confirmation: The Supertrend should turn green after the AMA is green.
	3.	Trigger: Take the trade when the high of the trigger candle (the candle that turned Supertrend green) is broken.
Sell Setup (Optional if included):
	•	Reverse the rules for a short trade: AMA and Supertrend should both indicate bearish conditions (red), and take the trade when the low of the trigger candle is broken.
Stop-Loss and Targets:
	•	Place the stop-loss at the low of the trigger candle for long trades.
	•	Set a 1:2 risk-reward ratio or use the Supertrend line as a trailing stop-loss.
Timeframes:
	•	Recommended timeframes: 1H, 4H, or Daily for swing trading.
	•	For intraday trading, use 15-minute or 30-minute charts.
Why This Strategy Works:
	•	Combines trend-following (AMA) with momentum-based entries (Supertrend).
	•	Focused trading hours filter out low-probability setups.
	•	Provides precise entry, stop-loss, and target levels for disciplined trading.
Conclusion:
This Gold Setup Strategy is designed for traders seeking a structured approach to trading Gold. Follow the rules strictly, backtest the strategy extensively, and share your results. Let’s master the Gold market together!
Tags: #Gold #XAUUSD #SwingTrading #Intraday #Supertrend #AMA #TechnicalAnalysis #GoldStrategy
ETH Signal 15m
This strategy uses the Supertrend indicator combined with RSI to generate buy and sell signals, with stop loss (SL) and take profit (TP) conditions based on ATR (Average True Range). Below is a detailed explanation of each part:
 1. General Information   BINANCE:ETHUSDT.P  
Strategy Name: "ETH Signal 15m"
Designed for use on the 15-minute time frame for the ETH pair.
Default capital allocation is 15% of total equity for each trade.
 2. Backtest Period 
start_time and end_time: Define the start and end time of the backtest period.
start_time = 2024-08-01: Start date of the backtest.
end_time = 2054-01-01: End date of the backtest.
The strategy will only run when the current time falls within this specified range.
 3. Supertrend Indicator 
Supertrend is a trend-following indicator that provides buy or sell signals based on the direction of price changes.
factor = 2.76: The multiplier used in the Supertrend calculation (increasing this value makes the Supertrend less sensitive to price movements).
atrPeriod = 12: Number of periods used to calculate ATR.
Output:
direction: Determines the buy/sell direction based on Supertrend.
If direction decreases, it signals a buy (Long).
If direction increases, it signals a sell (Short).
 4. RSI Indicator 
RSI (Relative Strength Index) is a momentum indicator, often used to identify overbought or oversold conditions.
rsiLength = 12: Number of periods used to calculate RSI.
rsiOverbought = 70: RSI level considered overbought.
rsiOversold = 30: RSI level considered oversold.
 5. Entry Conditions 
Long Entry:
Supertrend gives a buy signal (ta.change(direction) < 0).
RSI must be below the overbought level (rsi < rsiOverbought).
Short Entry:
Supertrend gives a sell signal (ta.change(direction) > 0).
RSI must be above the oversold level (rsi > rsiOversold).
The strategy will only execute trades if the current time is within the backtest period (in_date_range).
 6. Stop Loss (SL) and Take Profit (TP) Conditions 
ATR (Average True Range) is used to calculate the distance for Stop Loss and Take Profit based on price volatility.
atr = ta.atr(atrPeriod): ATR is calculated using 12 periods.
Stop Loss and Take Profit are calculated as follows:
 Long Trade: 
Stop Loss: Set at close - 4 * atr (current price minus 4 times the ATR).
Take Profit: Set at close + 2 * atr (current price plus 2 times the ATR).
 Short Trade: 
Stop Loss: Set at close + 4 * atr (current price plus 4 times the ATR).
Take Profit: Set at close - 2.237 * atr (current price minus 2.237 times the ATR).
 Summary: 
This strategy enters a Long trade when the Supertrend indicates an upward trend and RSI is not in the overbought region. Conversely, a Short trade is entered when Supertrend signals a downtrend, and RSI is not oversold.
The trade is exited when the price reaches the Stop Loss or Take Profit levels, which are determined based on price volatility (ATR).
 Disclaimer: 
The content provided in this strategy is for informational and educational purposes only. It is not intended as financial, investment, or trading advice. Trading in cryptocurrency, stocks, or any financial markets involves significant risk, and you may lose more than your initial investment. Past performance is not indicative of future results, and no guarantee of profit can be made. You should consult with a professional financial advisor before making any investment decisions. The creator of this strategy is not responsible for any financial losses or damages incurred as a result of following this strategy. All trades are executed at your own risk.
Higher TF - Repainting + Limiting backtest resultsThis strategy is for illustration purpose only. Do not use this as there is massive repainting. 
As usual, I was experimenting with adding different entry/exit filters to my main strategy. Thought of adding higher frame filter, picked the code for getting higher time frame supertrend from someone else's script and copied it without thinking much about it.
 security(syminfo.tickerid, f_multiple_resolution(HTFMultiplier), supertrend(SupertrendMult, SupertrendPd), lookahead = true, gaps=true) 
 
  Started getting better results with this result. I was very much impressed and while trying to enhance further, I started disabling my other entry and exit filters which I generally use. 
  That worked pretty well without any of my other filters. Hence, thought I will forward test this on a smaller timeframe.
  To my surprise, even in forward testing, i was not able to notice repainting very much. It also appeared that smaller timeframes yielded better results. (This wasn't the case with any of my strategies)
 
Which then prompted me to study the security function and lookahead and gap parameters. Learned that lookahead and gap when set to true will lead to massive repainting - specially if you are using higher timeframes. Hence, these parameters are not advisable to use in strategies.
Further information here: www.tradingview.com
I added three repaint options to further illustrate how security function will work:
 
   Yes  : Use security with lookahead and merge set to true
   No - set lookahead false  : Use security with lookahead and merge set to false
   No - do not use security  : Falls back to original command on current timeframe. Switch timeframe to HTF resolution to compare the difference.
 
 Conclusion   : Always set lookahead and gaps to false when using security function in strategies.
PS: Script also contains code to limit backtesting to certain days/months/years. This can be used as is in other scripts.
Asset Rotation System [InvestorUnknown]Overview 
This system creates a comprehensive trend "matrix" by analyzing the performance of six assets against both the US Dollar and each other. The objective is to identify and hold the asset that is currently outperforming all others, thereby focusing on maintaining an investment in the most "optimal" asset at any given time.
  - - - Key Features - - -  
 1. Trend Classification: 
 
 The system evaluates the trend for each of the six assets, both individually against USD and in pairs (assetX/assetY), to determine which asset is currently outperforming others.
 Utilizes five distinct trend indicators: RSI (50 crossover), CCI, SuperTrend, DMI, and Parabolic SAR.
 Users can customize the trend analysis by selecting all indicators or choosing a single one via the "Trend Classification Method" input setting.
 
 2. Backtesting: 
 
 Calculates an equity curve for each asset and for the system itself, which assumes holding only the asset deemed optimal at any time.
 Customizable start date for backtesting; by default, it begins either 5000 bars ago (the maximum in TradingView) or at the inception of the youngest asset included, whichever is shorter. If the youngest asset's history exceeds 5000 bars, the system uses 5000 bars to prevent errors.
 The equity curve is dynamically colored based on the asset held at each point, with this coloring also reflected on the chart via barcolor().
 Performance metrics like returns, standard deviation of returns, Sharpe, Sortino, and Omega ratios, along with maximum drawdown, are computed for each asset and the system's equity curve.
 
  
 3 Alerts: 
 
 Supports alerts for when a new, confirmed optimal asset is identified. However, due to TradingView limitations, the specific asset cannot be included in the alert message.
 
  - - - Usage - - -  
 1. Select Assets/Tickers: 
 
 Choose which assets or tickers you want to include in the rotation system. Ensure that all selected tickers are denominated in USD to maintain consistency in analysis.
 
 2. Configure Trend Classification: 
 
 Decide on the trend classification method from the available options (RSI, CCI, SuperTrend, DMI, or Parabolic SAR, All) and adjust the settings to your preferences. This customization allows you to tailor the system to different market conditions or your specific trading strategy.
 
 3. Utilize Backtesting for Calibration: 
 
 Use the backtesting results, including equity curves and performance metrics, to fine-tune your chosen trend indicators.
 Be cautious not to overemphasize performance maximization, as this can lead to overfitting. The goal is to achieve a robust system that performs well across various market conditions, rather than just optimizing for past data.
 
  - - - Parameters - - -  
 Tickers: 
 
 Asset 1: Select the symbol for the first asset.
 Asset 2: Select the symbol for the second asset.
 Asset 3: Select the symbol for the third asset.
 Asset 4: Select the symbol for the fourth asset.
 Asset 5: Select the symbol for the fifth asset.
 Asset 6: Select the symbol for the sixth asset.
 
 General Settings: 
 
 Trend Classification Method: Choose from RSI, CCI, SuperTrend, DMI, PSAR, or "All" to determine how trends are analyzed.
 Use Custom Starting Date for Backtest: Toggle to use a custom date for beginning the backtest.
 Custom Starting Date: Set the custom start date for backtesting.
 Plot Perf. Metrics Table: Option to display performance metrics in a table on the chart.
 
 RSI (Relative Strength Index): 
 
 RSI Source: Choose the price data source for RSI calculation.
 RSI Length: Set the period for the RSI calculation.
 
 CCI (Commodity Channel Index): 
 
 CCI Source: Select the price data source for CCI calculation.
 CCI Length: Determine the period for the CCI.
 
 SuperTrend: 
 
 SuperTrend Factor: Adjust the sensitivity of the SuperTrend indicator.
 SuperTrend Length: Set the period for the SuperTrend calculation.
 
 DMI (Directional Movement Index): 
 
 DMI Length: Define the period for DMI calculations.
 
 Parabolic SAR: 
 
 PSAR Start: Initial acceleration factor for the Parabolic SAR.
 PSAR Increment: Increment value for the acceleration factor.
 PSAR Max Value: Maximum value the acceleration factor can reach.
 
 Notes/Recommendations: 
 
 While this system is operational, it's important to recognize that it relies on "basic" indicators, which may not be ideal for generating trading signals on their own. I strongly suggest that users delve into the code to grasp the underlying logic of the system. Consider customizing it by integrating more sophisticated and higher-quality trend-following indicators to enhance its performance and reliability.
 
 Disclaimer: 
 
 This system's backtest results are historical and do not predict future performance. Use for educational purposes only; not investment advice. 
 
Advanced Multi-Timeframe Trend & Signal System═══════════════════════════════════════════════════════════════
ADVANCED MULTI-TIMEFRAME TREND & SIGNAL SYSTEM v1.0
═══════════════════════════════════════════════════════════════
Created by: Zakaria Safri
License: Mozilla Public License 2.0
A comprehensive technical analysis tool designed for traders seeking 
multi-dimensional market insights. This indicator combines proven 
technical analysis methods with modern visualization techniques.
═══════════════════════════════════════════════════════════════
KEY FEATURES
═══════════════════════════════════════════════════════════════
✓ SUPERTREND SIGNAL GENERATION
  - Customizable sensitivity settings
  - Clear long/short entry signals
  - Automatic trend direction detection
  - ATR-based dynamic calculations
✓ MULTI-TIMEFRAME DASHBOARD
  - Real-time trend analysis across 6 timeframes
  - Synchronized trend confirmation
  - Customizable table position and size
  - Current: 1M, 5M, 15M, 1H, 1D coverage
✓ QQE REVERSAL DETECTION
  - Quantitative Qualitative Estimation algorithm
  - Early reversal signal identification
  - Adjustable RSI and smoothing parameters
  - Confirmation-based plotting
✓ DYNAMIC SUPPORT & RESISTANCE
  - Pivot-based level calculation
  - Quick and standard pivot detection
  - Color-coded zones (8 levels)
  - Automatic level updates
✓ MOMENTUM BREAKOUT SIGNALS
  - Ichimoku-inspired calculations
  - Bullish and bearish breakout detection
  - Visual zone highlighting
  - Trend confirmation filters
✓ RISK MANAGEMENT SYSTEM
  - ATR-based stop loss calculation
  - Multiple take profit targets (TP1, TP2, TP3)
  - Customizable risk-to-reward ratios
  - Dynamic price level tracking
  - Hit detection markers
✓ VOLATILITY BANDS
  - Keltner Channel implementation
  - Multiple band layers (3 levels)
  - EMA-based calculations
  - Adaptive to market conditions
✓ TREND CLOUD VISUALIZATION
  - Dual moving average cloud
  - Clear trend direction indication
  - Customizable color scheme
  - Trend bar coloring
═══════════════════════════════════════════════════════════════
HOW TO USE
═══════════════════════════════════════════════════════════════
SETUP:
1. Add indicator to your chart
2. Configure sensitivity in Core Signals section
3. Enable desired features (signals, reversals, breakouts)
4. Set up risk management levels if trading
5. Position MTF dashboard to preference
SIGNAL INTERPRETATION:
• LONG Signal: Price crosses above Supertrend
• SHORT Signal: Price crosses below Supertrend
• REV (Reversal): QQE indicates potential trend change
• Diamond Breakouts: Momentum shift confirmation
• T1/T2/T3: Take profit level hits
MULTI-TIMEFRAME ANALYSIS:
• Green (BULL): Higher timeframe supports uptrend
• Red (BEAR): Higher timeframe supports downtrend
• Use for trend alignment and confirmation
• Best results when multiple timeframes align
RISK MANAGEMENT:
• Enable Stop Loss for automatic SL calculation
• Activate TP levels based on trading style
• Adjust Risk-to-Reward ratio (1:1 to 1:10)
• Monitor hit detection circles for exits
═══════════════════════════════════════════════════════════════
TECHNICAL SPECIFICATIONS
═══════════════════════════════════════════════════════════════
CALCULATIONS:
• Supertrend: ATR-based with customizable multiplier
• QQE: Modified RSI with Wilders smoothing
• Keltner Channels: EMA basis with ATR bands
• Pivots: Standard left/right bar methodology
• Support/Resistance: Multi-level pivot analysis
PARAMETERS:
• Supertrend Sensitivity: 0.5 to 10.0 (default: 2.0)
• RSI Period: 5 to 50 (default: 14)
• QQE Multiplier: 1.0 to 10.0 (default: 4.238)
• Risk-to-Reward: 1 to 10 (default: 4)
TIMEFRAMES:
Compatible with all timeframes. MTF dashboard displays:
• 1 Minute (1M)
• 5 Minutes (5M)
• 15 Minutes (15M)
• 1 Hour (1H)
• 1 Day (1D)
• Current chart timeframe
═══════════════════════════════════════════════════════════════
CUSTOMIZATION OPTIONS
═══════════════════════════════════════════════════════════════
VISUAL:
• Professional color scheme (Cyan/Orange)
• Adjustable table position (9 positions)
• Table size options (tiny/small/normal/large)
• Transparent zone highlighting
• Clean, modern label design
TOGGLES:
• Enable/disable any feature independently
• Show/hide signals, reversals, breakouts
• Toggle S/R levels and zones
• Control trend cloud and bands
• Master trend line optional
ALERTS:
The indicator provides visual signals that can be used with 
TradingView's alert system by setting alerts on the indicator.
═══════════════════════════════════════════════════════════════
BEST PRACTICES
═══════════════════════════════════════════════════════════════
✓ Combine signals for higher probability setups
✓ Use MTF dashboard for trend confirmation
✓ Respect S/R levels for entry/exit planning
✓ Monitor QQE reversals at key price levels
✓ Adjust sensitivity based on asset volatility
✓ Test on demo/paper trading first
✓ Use proper risk management always
═══════════════════════════════════════════════════════════════
IMPORTANT DISCLAIMER
═══════════════════════════════════════════════════════════════
This indicator is a technical analysis tool and does NOT:
• Guarantee profitable trades
• Provide financial advice
• Predict future price movements with certainty
• Replace proper risk management
• Substitute for personal due diligence
Past performance does not indicate future results. All trading 
involves risk. Users should:
- Understand the indicator's logic
- Test thoroughly before live trading
- Use appropriate position sizing
- Never risk more than they can afford to lose
- Consult financial advisors if needed
═══════════════════════════════════════════════════════════════
CODING STANDARDS
═══════════════════════════════════════════════════════════════
This indicator follows PineCoders Coding Conventions:
✓ Proper variable naming (prefixes: i_, f_, c_)
✓ Clear function documentation
✓ Organized code structure
✓ Type declarations
✓ Efficient calculations
✓ No repainting (confirmed signals)
✓ Proper use of request.security
═══════════════════════════════════════════════════════════════
SUPPORT & UPDATES
═══════════════════════════════════════════════════════════════
Version: 1.0
Author: Zakaria Safri
License: MPL 2.0
Last Updated: 2024
For questions, feedback, or suggestions, please comment below.
═══════════════════════════════════════════════════════════════
#trading #signals #supertrend #multiTimeframe #QQE #reversals
#supportResistance #riskManagement #trendAnalysis #momentum
Codigo Trading 1.0📌Codigo Trading 1.0
This indicator strategically combines SuperTrend, multiple Exponential Moving Averages (EMAs), the Relative Strength Index (RSI), and the Average True Range (ATR) to offer clear entry and exit signals, as well as an in-depth view of market trends. Ideal for traders looking to optimize their operations with an all-in-one tool.
🔩How the Indicator Works:
This indicator relies on the interaction and confirmation of several key components to generate signals:
SuperTrend: Determines the primary trend direction. An uptrend SuperTrend signal (green line) indicates an upward trend, while a downtrend (red line) signals a downward trend. It also serves as a guide for setting Stop Loss and Take Profit levels.
EMAs: Includes EMAs of 10, 20, 55, 100, 200, and 325 periods. The relationship between the EMA 10 and EMA 20 is fundamental for confirming the strength and direction of movements. An EMA 10 above the EMA 20 suggests an uptrend, and vice versa. Longer EMAs act as dynamic support and resistance levels, offering a broader view of the market structure.
RSI: Used to identify overbought (RSI > 70/80) and oversold (RSI < 30/20) conditions, generating "Take Profit" alerts for potential trade closures.
ATR: Monitors market volatility to help you manage exits. ATR exit signals are triggered when volatility changes direction, indicating a possible exhaustion of the movement.
🗒️Entry and Exit Signals:
I designed specific alerts based on all the indicators I use in conjunction:
Long Entries: When SuperTrend is bullish and EMA 10 crosses above EMA 20.
Short Entries: When SuperTrend is bearish and EMA 10 crosses below EMA 20.
RSI Exits (Take Profit): Indicated by "TP" labels on the chart, when the RSI reaches extreme levels (overbought for longs, oversold for shorts).
EMA 20 Exits: When the price closes below EMA 20 (for longs) or above EMA 20 (for shorts).
ATR Exits: When the ATR changes direction, signaling a possible decrease in momentum.
📌Key Benefits:
Clarity in Trend: Quickly identifies market direction with SuperTrend and EMA alignment.
Strategic Entry and Exit Signals: Receive timely alerts to optimize your entry and exit points.
Assisted Trade Management: RSI and ATR help you consider when to take profits or exit a position.
Intuitive Visualization: Arrows, labels, and colored lines make analysis easy to interpret.
Disclaimer:
Trading in financial markets carries significant risks. This indicator is an analysis tool and should not be considered financial advice. Always conduct your own research and trade at your own risk.
Akshay - TheOne, TheMostWanted, TheUnbeatable, TheEnd➤ All-in-One Solution (❌ No repaint):
This Technical Chart contains, MA24 Condition, Supertrend Indicator, HalfTrend Signal, Ichimoku Cloud Status, Parabolic SAR (P_SAR), First 5-Minute Candle Analysis (ORB5min), Volume-Weighted Moving Average (VWMA), Price-Volume Trend (PVT), Oscillator Composite, RSI Condition, ADX & Trend Strength.
Technicals don't lie.
  
  
  
 🚀 Overview and Key Features 
 
 Comprehensive Multi-Indicator Approach: 
The script is built to be an all-in-one technical indicator on TradingView. It integrates several well-known indicators and overlays—including Supertrend, HalfTrend, Ichimoku Cloud, various moving averages (EMA, SMA, VWMA), oscillators (Klinger, Price Oscillator, Awesome Oscillator, Chaikin Oscillator, Ultimate Oscillator, SMI Ergodic Oscillator, Chande Momentum Oscillator, Detrended Price Oscillator, Money Flow Index), ADX, and Donchian Channels—to create a composite picture of market sentiment.
 Signal Generation and Alerts: 
It not only calculates these indicators but also aggregates their output into “Master Candle” signals. Vertical lines are drawn on the chart with corresponding alerts to indicate potential buy or sell opportunities based on robust, combined conditions.
 Visual Layering: 
Through the use of colored histograms, custom candle plots, trend lines, and background color changes, the script offers a multi-layered visual representation of data, providing clarity about both short-term signals and overall market trends.
 
 ⚙️ How It Works and Functionality 
 
 MA24 Condition: 
Uses the 24-period moving average as a proxy; if the price is above it, the bar is colored green, and red if below, with neutrality when conditions aren’t met.
 Supertrend Indicator: 
Evaluates price relative to the Supertrend level (calculated via ATR), coloring green when price is above it and red when below.
 HalfTrend Signal: 
Determines trend shifts by comparing the current close to a calculated trend level; green indicates an upward trend, while red suggests a downtrend.
 Ichimoku Cloud Status: 
Analyzes the relationship between the Conversion and Base lines; a bullish (green) signal is given when price is above both or the Conversion line is higher than the Base line.
 Parabolic SAR (P_SAR): 
Colors the signal based on whether the current price is above (green) or below (red) the Parabolic SAR marker, indicating stop and reverse conditions.
 First 5-Minute Candle Analysis (ORB5min): 
Uses key levels from the first 5-minute candle; if price exceeds the candle’s low, VWAP, and MA, it’s bullish (green), otherwise bearish (red).
 Volume-Weighted Moving Average (VWMA): 
Compares the current price to volume-weighted averages; a price above these levels is shown in green, below in red.
 Price-Volume Trend (PVT): 
Determines bullish or bearish momentum by comparing PVT to its VWAP—green when above and red when below.
 Oscillator Composite: 
Aggregates signals from multiple oscillators; a majority of positive results turn it green, while negative dominance results in red.
 RSI Condition: 
Uses a simple RSI threshold of 50, with values above signifying bullish (green) momentum and below marking bearish (red) conditions.
 ADX & Trend Strength: 
Reflects overall trend strength through ADX and directional movements; a combination favoring bullish conditions colors it green, with red signaling bearish pressure.
 Master Candle Overall Signal: 
Combines multiple indicator outputs into one “Master” signal—green for a consensus bullish trend and red for a bearish outlook.
 Scalp Signal Variation: 
Focused on short-term price changes, this signal adjusts quickly; green indicates improving short-term conditions, while red signals a downturn.
 
 📊 Visualizations and 🎨 User Experience (❌ no repaint) 
 
 Dynamic Histograms & Bar Plots: 
Each indicator is represented as a colored bar (with added vertical offsets) to facilitate easy comparison of their respective bullish or bearish contributions.
 Clear Color-Coding & Labels: 
Green (e.g., GreenFluorescent) indicates bullish sentiment.
Red (e.g., RedFluorescent) indicates bearish sentiment.
Custom labels and descriptive text accompany each bar for clarity.
 Interactive Charting: 
The overall background color adapts based on the “Master Candle” condition, offering an instant read on market sentiment.
The current candlestick is overlaid with color cues to reinforce the indicator’s signal, enhancing the trading experience.
 Real-Time Alerts: 
Vertical lines appear on signal events (buy/sell triggers), complemented by alerts that help traders stay on top of actionable market moves.
 Sharp lines: 
The Sharp lines are plotted based upon the EMA5 cross over with the same market trend, marks this as good time to reentry.
 
 🔧 Settings and Customization 
 
 Flexible Timeframe Input: 
Users can select their preferred timeframe for analysis, making the indicator adaptable to intraday or longer-term trading styles.
 Customizable Indicator Parameters: 
➤ Supertrend: Adjust ATR length and multiplier factors.
➤ HalfTrend: Tweak amplitude and channel deviation settings.
➤ Ichimoku Cloud & Oscillators: Fine-tune the conversion/base lines and oscillator lengths to match individual trading strategies.
 Visual Customization: 
The script’s color schemes and plotting styles can be altered as needed, giving users the freedom to tailor the interface to their taste or existing chart setups.
 
 🌟 Uniqueness of the Concept 
 
 Integrated Multi-Indicator Synergy: 
Combines a diverse range of trend, momentum, and volume-based indicators into a single cohesive system for a holistic market view.
 Master Candle Aggregation: 
Consolidates numerous individual signals into a "Master Candle" that filters out noise and provides a clear, consensus-based trading signal.
 Layered Visual Feedback: 
Uses color-coded histograms, adaptive background cues, and dynamic overlays to deliver a visually intuitive guide to market sentiment at a glance.
 Customization and Flexibility: 
Offers adjustable parameters for each indicator, allowing users to tailor the system to fit diverse trading styles and market conditions.
 
 ✅ Conclusion: 
 
 Robust Trading Tool & Non-Repainting Reliability: 
This versatile technical analysis tool computes an extensive range of indicators, aggregates them into a stable, non-repainting “Master Candle” signal, and maintains consistent, verifiable outputs on historical data.
 Holistic Market Insight & Consistent Signal Generation: 
By combining trend detection, momentum oscillators, and volume analysis, the indicator delivers a comprehensive snapshot of market conditions and generates dependable signals across varying timeframes.
 User-Centric Design with Rich Visual Feedback: 
Customizable settings, clear color-coded outputs, adaptive backgrounds, and real-time alerts work together to provide actionable, transparent feedback—enhancing the overall trading experience.
 A Unique All-in-One Solution: 
The integrated approach not only simplifies complex market dynamics into an easy-to-read visual guide but also empowers systematic traders with a powerful, adaptable asset for accurate decision-making.
 
 ❤️ Credits: 
 
 Pine Script™ User Manual 
 Supertrend 
 Ichimoku Cloud 
 Parabolic SAR 
 Price Volume Trend (PVT) 
 Average Directional Index (ADX) 
 Volume Oscillator 
 HalfTrend 
 Donchian Trend 
ATR GOD Strategy by TradeSmart (PineConnector-compatible)This is a  highly-customizable trading strategy  made by TradeSmart, focusing mainly on ATR-based indicators and filters. The strategy is mainly intended for  trading forex , and has been optimized using the Deep Backtest feature on the 2018.01.01 - 2023.06.01 interval on the EUR/USD (FXCM) 15M chart, with a Slippage value of 3, and a Commission set to 0.00004 USD per contract. The strategy is also made  compatible with PineConnector , to provide an easy option to  automate the strategy  using a connection to MetaTrader. See tooltips for details on how to set up the bot, and check out our website for a  detailed guide  with images on how to automate the strategy.
 The strategy was implemented using the following logic: 
 Entry strategy: 
A total of 4 Supertrend values can be used to determine the entry logic. There is option to set up all 4 Supertrend parameters individually, as well as their potential to be used as an entry signal/or a trend filter. Long/Short entry signals will be determined based on the selected potential Supertrend entry signals, and filtered based on them being in an uptrend/downtrend (also available for setup). Please use the provided tooltips for each setup to see every detail.
 Exit strategy: 
4 different types of Stop Losses are available: ATR-based/Candle Low/High Based/Percentage Based/Pip Based. Additionally, Force exiting can also be applied, where there is option to set up 4 custom sessions, and exits will happen after the session has closed.
 Parameters of every indicator used in the strategy can be tuned in the strategy settings as follows: 
 Plot settings: 
 
 Plot Signals: true by default, Show all Long and Short signals on the signal candle
 Plot SL/TP lines: false by default, Checking this option will result in the TP and SL lines to be plotted on the chart.
 
 Supertrend 1-4: 
All the parameters of the Supertrends can be set up here, as well as their individual role in the entry logic.
 Exit Strategy: 
 
 ATR Based Stop Loss: true by default
 ATR Length (of the SL): 100 by default
 ATR Smoothing (of the SL): RMA/SMMA by default
 Candle Low/High Based Stop Loss: false by default, recent lowest or highest point (depending on long/short position) will be used to calculate stop loss value. Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
 Candle Lookback (of the SL): 50 by default
 Percentage Based Stop Loss: false by default, Set the stop loss to current price - % of current price (long) or price + % of current price (short).
 Percentage (of the SL): 0.3 by default
 Pip Based Stop Loss: Set the stop loss to current price - x pips (long) or price + x pips (short). Set 'Base Risk Multiplier' to 1 if you would like to use the calculated value as is. Setting it to a different value will count as an additional multiplier.
 Pip (of the SL): 10 by default
 Base Risk Multiplier: 4.5 by default, the stop loss will be placed at this risk level (meaning in case of ATR SL that the ATR value will be multiplied by this factor and the SL will be placed that value away from the entry level)
 Risk to Reward Ratio: 1.5 by default, the take profit level will be placed such as this Risk/Reward ratio is met
 
 Force Exiting: 
4 total Force exit on custom session close options: none applied by default. If enabled, trades will close automatically after the set session is closed (on next candle's open).
 Base Setups: 
 
 Allow Long Entries: true by default
 Allow Short Entries: true by default
 Order Size: 10 by default
 Order Type: Capital Percentage by default, allows adjustment on how the position size is calculated: Cash: only the set cash amount will be used for each trade Contract(s): the adjusted number of contracts will be used for each trade Capital  Percentage: a % of the current available capital will be used for each trade
 
 ATR Limiter: 
 
 Use ATR Limiter: true by default, Only enter into any position (long/short) if ATR value is higher than the Low Boundary and lower than the High Boundary.
 ATR Limiter Length: 50 by default
 ATR Limiter Smoothing: RMA/SMMA by default
 High Boundary: 1000 by default
 Low Boundary: 0.0003 by default
 MA based calculation: ATR value under MA by default, If not Unspecified, an MA is calculated with the ATR value as source. Only enter into position (long/short) if ATR value is higher/lower than the MA.
 MA Type: RMA/SMMA by default
 MA Length: 400 by default
 
 Waddah Attar Filter: 
 
 Explosion/Deadzone relation: Not specified by default, Explosion over Deadzone: trades will only happen if the explosion line is over the deadzone line; Explosion under Deadzone: trades will only happen if the explosion line is under the deadzone line; Not specified: the opening of trades will not be based on the relation between the explosion and deadzone lines.
 Limit trades based on trends: Not specified by default, Strong Trends: only enter long if the WA bar is colored green (there is an uptrend and the current bar is higher then the previous); only enter short if the WA bar is colored red (there is a downtrend and the current bar is higher then the previous); Soft Trends: only enter long if the WA bar is colored lime (there is an uptrend and the current bar is lower then the previous); only enter short if the WA bar is colored orange (there is a downtrend and the current bar is lower then the previous); All Trends: only enter long if the WA bar is colored green or lime (there is an uptrend); only enter short if the WA bar is colored red or orange (there is a downtrend); Not specified: the color of the WA bar (trend) is not relevant when considering entries.
 WA bar value: Not specified by default, Over Explosion and Deadzone: only enter trades when the WA bar value is over the Explosion and Deadzone lines; Not specified: the relation between the explosion/deadzone lines to the value of the WA bar will not be used to filter opening trades.
 Sensitivity: 150 by default
 Fast MA Type: SMA by default
 Fast MA Length: 10 by default
 Slow MA Type: SMA
 Slow MA Length: 20 by default
 Channel MA Type: EMA by default
 BB Channel Length: 20 by default
 BB Stdev Multiplier: 2 by default
 
 Trend Filter: 
 
 Use long trend filter 1: false by default, Only enter long if price is above Long MA.
 Show long trend filter 1: false by default, Plot the selected MA on the chart.
 TF1 - MA Type: EMA by default
 TF1 - MA Length: 120 by default
 TF1 - MA Source: close by default
 Use short trend filter 1: false by default, Only enter long if price is above Long MA.
 Show short trend filter 1: false by default, Plot the selected MA on the chart.
 TF2 - MA Type: EMA by default
 TF2 - MA Length: 120 by default
 TF2 - MA Source: close by default
 
 Volume Filter: 
 
 Only enter trades where volume is higher then the volume-based MA: true by default, a set type of MA will be calculated with the volume as source, and set length
 MA Type: RMA/SMMA by default
 MA Length: 200 by default
 
 Date Range Limiter: 
 
 Limit Between Dates: false by default
 Start Date: Jan 01 2023 00:00:00 by default
 End Date: Jun 24 2023 00:00:00 by default
 
 Session Limiter: 
 
 Show session plots: false by default, show market sessions on chart: Sidney (red), Tokyo (orange), London (yellow), New York (green)
 Use session limiter: false by default, if enabled, trades will only happen in the ticked sessions below.
 Sidney session: false by default, session between: 15:00 - 00:00 (EST)
 Tokyo session: false by default, session between: 19:00 - 04:00 (EST)
 London session: false by default, session between: 03:00 - 11:00 (EST)
 New York session: false by default, session between: 08:00 - 17:00 (EST)
 
 Trading Time: 
 
 Limit Trading Time: true by default, tick this together with the options below to enable limiting based on day and time
 Valid Trading Days Global: 123567 by default, if the Limit Trading Time is on, trades will only happen on days that are present in this field. If any of the not global Valid Trading Days is used, this field will be neglected. Values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) To trade on all days use: 123457
 (1) Valid Trading Days: false, 123456 by default, values represent days: Sunday (1), Monday (2), ..., Friday (6), Saturday(7) The script will trade on days that are present in this field. Please make sure that this field and also (1) Valid Trading Hours Between is checked
 (1) Valid Trading Hours Between: false, 1800-2000 by default, hours between which the trades can happen. The time is always in the exchange's timezone
 All other options are also disabled by default
 
 PineConnector Automation: 
 
 Use PineConnector Automation: false by default, In order for the connection to MetaTrader to work, you will need do perform prerequisite steps, you can follow our full guide at our website, or refer to the official PineConnector Documentation. To set up PineConnector Automation on the TradingView side, you will need to do the following: 
1. Fill out the License ID field with your PineConnector License ID; 
2. Fill out the Risk (trading volume) with the desired volume to be traded in each trade (the meaning of this value depends on the EA settings in Metatrader. Follow the detailed guide for additional information); 
3. After filling out the fields, you need to enable the 'Use PineConnector Automation' option (check the box in the strategy settings); 
4. Check if the chart has updated and you can see the appropriate order comments on your chart; 
5. Create an alert with the strategy selected as Condition, and the Message as {{strategy.order.comment}} (should be there by default); 
6. Enable the Webhook URL in the Notifications section, set it as the official PineConnector webhook address and enjoy your connection with MetaTrader.
 License ID: 60123456789 by default
 Risk (trading volume): 1 by default
 
 NOTE!  Fine-tuning/re-optimization is highly recommended when using other asset/timeframe combinations.
taLibrary   "ta" 
█  OVERVIEW 
This library holds technical analysis functions calculating values for which no Pine built-in exists.
 Look first. Then leap.  
█  FUNCTIONS 
 cagr(entryTime, entryPrice, exitTime, exitPrice) 
It calculates the "Compound Annual Growth Rate" between two points in time. The CAGR is a notional, annualized growth rate that assumes all profits are reinvested. It only takes into account the prices of the two end points — not drawdowns, so it does not calculate risk. It can be used as a yardstick to compare the performance of two instruments. Because it annualizes values, the function requires a minimum of one day between the two end points (annualizing returns over smaller periods of times doesn't produce very meaningful figures).
  Parameters:
     entryTime : The starting timestamp.
     entryPrice : The starting point's price.
     exitTime : The ending timestamp.
     exitPrice : The ending point's price.
  Returns: CAGR in % (50 is 50%). Returns `na` if there is not >=1D between `entryTime` and `exitTime`, or until the two time points have not been reached by the script.
█  v2, Mar. 8, 2022 
Added functions `allTimeHigh()` and `allTimeLow()` to find the highest or lowest value of a source from the first historical bar to the current bar. These functions will not look ahead; they will only return new highs/lows on the bar where they occur.
 allTimeHigh(src) 
Tracks the highest value of `src` from the first historical bar to the current bar.
  Parameters:
     src : (series int/float) Series to track. Optional. The default is `high`.
  Returns: (float) The highest value tracked.
 allTimeLow(src) 
Tracks the lowest value of `src` from the first historical bar to the current bar.
  Parameters:
     src : (series int/float) Series to track. Optional. The default is `low`.
  Returns: (float) The lowest value tracked.
█  v3, Sept. 27, 2022 
This version includes the following new functions: 
 aroon(length) 
  Calculates the values of the Aroon indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: ( [float, float ]) A tuple of the Aroon-Up and Aroon-Down values.
 coppock(source, longLength, shortLength, smoothLength) 
  Calculates the value of the Coppock Curve indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     longLength (simple int) : (simple int) Number of bars for the fast ROC value (length).
     shortLength (simple int) : (simple int) Number of bars for the slow ROC value (length).
     smoothLength (simple int) : (simple int) Number of bars for the weigted moving average value (length).
  Returns: (float) The oscillator value.
 dema(source, length) 
  Calculates the value of the Double Exponential Moving Average (DEMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The double exponentially weighted moving average of the `source`.
 dema2(src, length) 
  An alternate Double Exponential Moving Average (Dema) function to `dema()`, which allows a "series float" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The double exponentially weighted moving average of the `src`.
 dm(length) 
  Calculates the value of the "Demarker" indicator. 
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 donchian(length) 
  Calculates the values of a Donchian Channel using `high` and `low` over a given `length`.
  Parameters:
     length (int) : (series int) Number of bars (length).
  Returns: ( [float, float, float ]) A tuple containing the channel high, low, and median, respectively.
 ema2(src, length) 
  An alternate ema function to the `ta.ema()` built-in, which allows a "series float" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int/float) Number of bars (length).
  Returns: (float) The exponentially weighted moving average of the `src`.
 eom(length, div) 
  Calculates the value of the Ease of Movement indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
     div (simple int) : (simple int) Divisor used for normalzing values. Optional. The default is 10000.
  Returns: (float) The oscillator value.
 frama(source, length) 
  The Fractal Adaptive Moving Average (FRAMA), developed by John Ehlers, is an adaptive moving average that dynamically adjusts its lookback period based on fractal geometry.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The fractal adaptive moving average of the `source`.
 ft(source, length) 
  Calculates the value of the Fisher Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 ht(source) 
  Calculates the value of the Hilbert Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
  Returns: (float) The oscillator value.
 ichimoku(conLength, baseLength, senkouLength) 
  Calculates values of the Ichimoku Cloud indicator, including tenkan, kijun, senkouSpan1, senkouSpan2, and chikou. NOTE: offsets forward or backward can be done using the `offset` argument in `plot()`.
  Parameters:
     conLength (int) : (series int) Length for the Conversion Line (Tenkan). The default is 9 periods, which returns the mid-point of the 9 period Donchian Channel.
     baseLength (int) : (series int) Length for the Base Line (Kijun-sen). The default is 26 periods, which returns the mid-point of the 26 period Donchian Channel.
     senkouLength (int) : (series int) Length for the Senkou Span 2 (Leading Span B). The default is 52 periods, which returns the mid-point of the 52 period Donchian Channel.
  Returns: ( [float, float, float, float, float ]) A tuple of the Tenkan, Kijun, Senkou Span 1, Senkou Span 2, and Chikou Span values. NOTE: by default, the senkouSpan1 and senkouSpan2 should be plotted 26 periods in the future, and the Chikou Span plotted 26 days in the past.
 ift(source) 
  Calculates the value of the Inverse Fisher Transform indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
  Returns: (float) The oscillator value.
 kvo(fastLen, slowLen, trigLen) 
  Calculates the values of the Klinger Volume Oscillator.
  Parameters:
     fastLen (simple int) : (simple int) Length for the fast moving average smoothing parameter calculation.
     slowLen (simple int) : (simple int) Length for the slow moving average smoothing parameter calculation.
     trigLen (simple int) : (simple int) Length for the trigger moving average smoothing parameter calculation.
  Returns: ( [float, float ]) A tuple of the KVO value, and the trigger value.
 pzo(length) 
  Calculates the value of the Price Zone Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 rms(source, length) 
  Calculates the Root Mean Square of the `source` over the `length`.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The RMS value.
 rwi(length) 
  Calculates the values of the Random Walk Index.
  Parameters:
     length (simple int) : (simple int) Lookback and ATR smoothing parameter length.
  Returns: ( [float, float ]) A tuple of the `rwiHigh` and `rwiLow` values.
 stc(source, fast, slow, cycle, d1, d2) 
  Calculates the value of the Schaff Trend Cycle indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     fast (simple int) : (simple int) Length for the MACD fast smoothing parameter calculation.
     slow (simple int) : (simple int) Length for the MACD slow smoothing parameter calculation.
     cycle (simple int) : (simple int) Number of bars for the Stochastic values (length).
     d1 (simple int) : (simple int) Length for the initial %D smoothing parameter calculation.
     d2 (simple int) : (simple int) Length for the final %D smoothing parameter calculation.
  Returns: (float) The oscillator value.
 stochFull(periodK, smoothK, periodD) 
  Calculates the %K and %D values of the Full Stochastic indicator.
  Parameters:
     periodK (simple int) : (simple int) Number of bars for Stochastic calculation. (length).
     smoothK (simple int) : (simple int) Number of bars for smoothing of the %K value (length).
     periodD (simple int) : (simple int) Number of bars for smoothing of the %D value (length).
  Returns: ( [float, float ]) A tuple of the slow %K and the %D moving average values.
 stochRsi(lengthRsi, periodK, smoothK, periodD, source) 
  Calculates the %K and %D values of the Stochastic RSI indicator.
  Parameters:
     lengthRsi (simple int) : (simple int) Length for the RSI smoothing parameter calculation.
     periodK (simple int) : (simple int) Number of bars for Stochastic calculation. (length).
     smoothK (simple int) : (simple int) Number of bars for smoothing of the %K value (length).
     periodD (simple int) : (simple int) Number of bars for smoothing of the %D value (length).
     source (float) : (series int/float) Series of values to process. Optional. The default is `close`.
  Returns: ( [float, float ]) A tuple of the slow %K and the %D moving average values.
 supertrend(factor, atrLength, wicks) 
  Calculates the values of the SuperTrend indicator with the ability to take candle wicks into account, rather than only the closing price.
  Parameters:
     factor (float) : (series int/float) Multiplier for the ATR value.
     atrLength (simple int) : (simple int) Length for the ATR smoothing parameter calculation.
     wicks (simple bool) : (simple bool) Condition to determine whether to take candle wicks into account when reversing trend, or to use the close price. Optional. Default is false.
  Returns: ( [float, int ]) A tuple of the superTrend value and trend direction.
 szo(source, length) 
  Calculates the value of the Sentiment Zone Oscillator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 t3(source, length, vf) 
  Calculates the value of the Tilson Moving Average (T3).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
     vf (simple float) : (simple float) Volume factor. Affects the responsiveness.
  Returns: (float) The Tilson moving average of the `source`.
 t3Alt(source, length, vf) 
  An alternate Tilson Moving Average (T3) function to `t3()`, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
     vf (simple float) : (simple float) Volume factor. Affects the responsiveness.
  Returns: (float) The Tilson moving average of the `source`.
 tema(source, length) 
  Calculates the value of the Triple Exponential Moving Average (TEMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The triple exponentially weighted moving average of the `source`.
 tema2(source, length) 
  An alternate Triple Exponential Moving Average (TEMA) function to `tema()`, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The triple exponentially weighted moving average of the `source`.
 trima(source, length) 
  Calculates the value of the Triangular Moving Average (TRIMA).
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (int) : (series int) Number of bars (length).
  Returns: (float) The triangular moving average of the `source`.
 trima2(src, length) 
  An alternate Triangular Moving Average (TRIMA) function to `trima()`, which allows a "series int" length argument.
  Parameters:
     src : (series int/float) Series of values to process.
     length : (series int) Number of bars (length).
  Returns: (float) The triangular moving average of the `src`.
 trix(source, length, signalLength, exponential) 
  Calculates the values of the TRIX indicator.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
     signalLength (simple int) : (simple int) Length for smoothing the signal line.
     exponential (simple bool) : (simple bool) Condition to determine whether exponential or simple smoothing is used. Optional. The default is `true` (exponential smoothing).
  Returns: ( [float, float, float ]) A tuple of the TRIX value, the signal value, and the histogram.
 uo(fastLen, midLen, slowLen) 
  Calculates the value of the Ultimate Oscillator.
  Parameters:
     fastLen (simple int) : (series int) Number of bars for the fast smoothing average (length).
     midLen (simple int) : (series int) Number of bars for the middle smoothing average (length).
     slowLen (simple int) : (series int) Number of bars for the slow smoothing average (length).
  Returns: (float) The oscillator value.
 vhf(source, length) 
  Calculates the value of the Vertical Horizontal Filter.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (simple int) : (simple int) Number of bars (length).
  Returns: (float) The oscillator value.
 vi(length) 
  Calculates the values of the Vortex Indicator.
  Parameters:
     length (simple int) : (simple int) Number of bars (length).
  Returns: ( [float, float ]) A tuple of the viPlus and viMinus values.
 vzo(length) 
  Calculates the value of the Volume Zone Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
 williamsFractal(period) 
  Detects Williams Fractals.
  Parameters:
     period (int) : (series int) Number of bars (length).
  Returns: ( [bool, bool ]) A tuple of an up fractal and down fractal. Variables are true when detected.
 wpo(length) 
  Calculates the value of the Wave Period Oscillator.
  Parameters:
     length (simple int) : (simple int) Length for the smoothing parameter calculation.
  Returns: (float) The oscillator value.
█  v7, Nov. 2, 2023 
This version includes the following new and updated functions: 
 atr2(length) 
  An alternate ATR function to the `ta.atr()` built-in, which allows a "series float" `length` argument.
  Parameters:
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The ATR value.
 changePercent(newValue, oldValue) 
  Calculates the percentage difference between two distinct values.
  Parameters:
     newValue (float) : (series int/float) The current value.
     oldValue (float) : (series int/float) The previous value.
  Returns: (float) The percentage change from the `oldValue` to the `newValue`.
 donchian(length) 
  Calculates the values of a Donchian Channel using `high` and `low` over a given `length`.
  Parameters:
     length (int) : (series int) Number of bars (length).
  Returns: ( [float, float, float ]) A tuple containing the channel high, low, and median, respectively.
 highestSince(cond, source) 
  Tracks the highest value of a series since the last occurrence of a condition.
  Parameters:
     cond (bool) : (series bool) A condition which, when `true`, resets the tracking of the highest `source`.
     source (float) : (series int/float) Series of values to process. Optional. The default is `high`.
  Returns: (float) The highest `source` value since the last time the `cond` was `true`.
 lowestSince(cond, source) 
  Tracks the lowest value of a series since the last occurrence of a condition.
  Parameters:
     cond (bool) : (series bool) A condition which, when `true`, resets the tracking of the lowest `source`.
     source (float) : (series int/float) Series of values to process. Optional. The default is `low`.
  Returns: (float) The lowest `source` value since the last time the `cond` was `true`.
 relativeVolume(length, anchorTimeframe, isCumulative, adjustRealtime) 
  Calculates the volume since the last change in the time value from the `anchorTimeframe`, the historical average volume using bars from past periods that have the same relative time offset as the current bar from the start of its period, and the ratio of these volumes. The volume values are cumulative by default, but can be adjusted to non-accumulated with the `isCumulative` parameter.
  Parameters:
     length (simple int) : (simple int) The number of periods to use for the historical average calculation.
     anchorTimeframe (simple string) : (simple string) The anchor timeframe used in the calculation. Optional. Default is "D".
     isCumulative (simple bool) : (simple bool) If `true`, the volume values will be accumulated since the start of the last `anchorTimeframe`. If `false`, values will be used without accumulation. Optional. The default is `true`.
     adjustRealtime (simple bool) : (simple bool) If `true`, estimates the cumulative value on unclosed bars based on the data since the last `anchor` condition. Optional. The default is `false`.
  Returns: ( [float, float, float ]) A tuple of three float values. The first element is the current volume. The second is the average of volumes at equivalent time offsets from past anchors over the specified number of periods. The third is the ratio of the current volume to the historical average volume.
 rma2(source, length) 
  An alternate RMA function to the `ta.rma()` built-in, which allows a "series float" `length` argument.
  Parameters:
     source (float) : (series int/float) Series of values to process.
     length (float) : (series int/float) Length for the smoothing parameter calculation.
  Returns: (float) The rolling moving average of the `source`.
 supertrend2(factor, atrLength, wicks) 
  An alternate SuperTrend function to `supertrend()`, which allows a "series float" `atrLength` argument.
  Parameters:
     factor (float) : (series int/float) Multiplier for the ATR value.
     atrLength (float) : (series int/float) Length for the ATR smoothing parameter calculation.
     wicks (simple bool) : (simple bool) Condition to determine whether to take candle wicks into account when reversing trend, or to use the close price. Optional. Default is `false`.
  Returns: ( [float, int ]) A tuple of the superTrend value and trend direction.
 vStop(source, atrLength, atrFactor) 
  Calculates an ATR-based stop value that trails behind the `source`. Can serve as a possible stop-loss guide and trend identifier.
  Parameters:
     source (float) : (series int/float) Series of values that the stop trails behind.
     atrLength (simple int) : (simple int) Length for the ATR smoothing parameter calculation.
     atrFactor (float) : (series int/float) The multiplier of the ATR value. Affects the maximum distance between the stop and the `source` value. A value of 1 means the maximum distance is 100% of the ATR value. Optional. The default is 1.
  Returns: ( [float, bool ]) A tuple of the volatility stop value and the trend direction as a "bool".
 vStop2(source, atrLength, atrFactor) 
  An alternate Volatility Stop function to `vStop()`, which allows a "series float" `atrLength` argument.
  Parameters:
     source (float) : (series int/float) Series of values that the stop trails behind.
     atrLength (float) : (series int/float) Length for the ATR smoothing parameter calculation.
     atrFactor (float) : (series int/float) The multiplier of the ATR value. Affects the maximum distance between the stop and the `source` value. A value of 1 means the maximum distance is 100% of the ATR value. Optional. The default is 1.
  Returns: ( [float, bool ]) A tuple of the volatility stop value and the trend direction as a "bool".
Removed Functions: 
 allTimeHigh(src) 
  Tracks the highest value of `src` from the first historical bar to the current bar.
 allTimeLow(src) 
  Tracks the lowest value of `src` from the first historical bar to the current bar.
 trima2(src, length) 
  An alternate Triangular Moving Average (TRIMA) function to `trima()`, which allows a
"series int" length argument.
Luxy BIG beautiful Dynamic ORBThis is an advanced Opening Range Breakout (ORB) indicator that tracks price breakouts from the first 5, 15, 30, and 60 minutes of the trading session. It provides complete trade management including entry signals, stop-loss placement, take-profit targets, and position sizing calculations.
The ORB strategy is based on the concept that the opening range of a trading session often acts as support/resistance, and breakouts from this range tend to lead to significant moves.
  
 What Makes This Different? 
Most ORB indicators simply draw horizontal lines and leave you to figure out the rest. This indicator goes several steps further:
 Multi-Stage Tracking 
Instead of just one ORB timeframe, this tracks FOUR simultaneously (5min, 15min, 30min, 60min). Each stage builds on the previous one, giving you multiple trading opportunities throughout the session.
 Active Trade Management 
When a breakout occurs, the indicator automatically calculates and displays entry price, stop-loss, and multiple take-profit targets. These lines extend forward and update in real-time until the trade completes.
 Cycle Detection 
Unlike indicators that only show the first breakout, this tracks the complete cycle: Breakout → Retest → Re-breakout. You can see when price returns to test the ORB level after breaking out (potential re-entry).
 Failed Breakout Warning 
If price breaks out but quickly returns inside the range (within a few bars), the label changes to "FAILED BREAK" - warning you to exit or avoid the trade.
 Position Sizing Calculator 
Built-in risk management that tells you exactly how many shares to buy based on your account size and risk tolerance. No more guessing or manual calculations.
 Advanced Filtering 
Optional filters for volume confirmation, trend alignment, and Fair Value Gaps (FVG) to reduce false signals and improve win rate.
  
 Core Features Explained
 
### 1. Multi-Stage ORB Levels
The indicator builds four separate Opening Range levels:
 
 ORB 5  - First 5 minutes (fastest signals, most volatile)
 ORB 15  - First 15 minutes (balanced, most popular)
 ORB 30  - First 30 minutes (slower, more reliable)
 ORB 60  - First 60 minutes (slowest, most confirmed)
 
Each level is drawn as a horizontal range on your chart. As time progresses, the ranges expand to include more price action. You can enable or disable any stage and assign custom colors to each.
 How it works:  During the opening minutes, the indicator tracks the highest high and lowest low. Once the time period completes, those levels become your ORB high and low for that stage.
### 2. Breakout Detection
When price closes outside the ORB range, a label appears:
 
 BREAK UP  (green label above price) - Price closed above ORB High
 BREAK DOWN  (red label below price) - Price closed below ORB Low
 
The label shows which ORB stage triggered (ORB5, ORB15, etc.) and the cycle number if tracking multiple breakouts.
 Important:  Signals appear on bar close only - no repainting. What you see is what you get.
### 3. Retest Detection
After price breaks out and moves away, if it returns to test the ORB level, a "RETEST" label appears (orange). This indicates:
 
 The original breakout level is now acting as support/resistance
 Potential re-entry opportunity if you missed the first breakout
 Confirmation that the level is significant
 
The indicator requires price to move a minimum distance away before considering it a valid retest (configurable in settings).
### 4. Failed Breakout Detection
If price breaks out but returns inside the ORB range within a few bars (before the breakout is "committed"), the original label changes to "FAILED BREAK" in orange.
This warns you:
 
 The breakout lacked conviction
 Consider exiting if already in the trade
 Wait for better setup
 
 Committed Breakout:  The indicator tracks how many bars price stays outside the range. Only after staying outside for the minimum number of bars does it become a committed breakout that can be retested.
  
### 5. TP/SL Lines (Trade Management)
When a breakout occurs, colored horizontal lines appear showing:
 
 Entry Line  (cyan for long, orange for short) - Your entry price (the ORB level)
 Stop Loss Line  (red) - Where to exit if trade goes against you
 TP1, TP2, TP3 Lines  (same color as entry) - Profit targets at 1R, 2R, 3R
 
These lines extend forward as new bars form, making it easy to track your trade. When a target is hit, the line turns green and the label shows a checkmark.
 Lines freeze (stop updating) when: 
 
 Stop loss is hit
 The final enabled take-profit is hit
 End of trading session (optional setting)
 
### 6. Position Sizing Dashboard
The dashboard (bottom-left corner by default) shows real-time information:
 
 Current ORB stage and range size
 Breakout status (Inside Range / Break Up / Break Down)
 Volume confirmation (if filter enabled)
 Trend alignment (if filter enabled)
 Entry and Stop Loss prices
 All enabled Take Profit levels with percentages
 Risk/Reward ratio
 Position sizing: Max shares to buy and total risk amount
 
 Position Sizing Example: 
If your account is $25,000 and you risk 1% per trade ($250), and the distance from entry to stop loss is $0.50, the calculator shows you can buy 500 shares (250 / 0.50 = 500).
  
### 7. FVG Filter (Fair Value Gap)
Fair Value Gaps are price inefficiencies - gaps left by strong momentum where one candle's high doesn't overlap with a previous candle's low (or vice versa).
When enabled, this filter:
 
 Detects bullish and bearish FVGs
 Draws semi-transparent boxes around these gaps
 Only allows breakout signals if there's an FVG near the breakout level
 
 Why this helps:  FVGs indicate institutional activity. Breakouts through FVGs tend to be stronger and more reliable.
 Proximity setting:  Controls how close the FVG must be to the ORB level. 2.0x means the breakout can be within 2 times the FVG size - a reasonable default.
### 8. Volume & Trend Filters
 Volume Filter: 
Requires current volume to be above average (customizable multiplier). High volume breakouts are more likely to sustain.
 
 Set minimum multiplier (e.g., 1.5x = 50% above average)
 Set "strong volume" multiplier (e.g., 2.5x) that bypasses other filters
 Dashboard shows current volume ratio
 
 Trend Filter: 
Only shows breakouts aligned with a higher timeframe trend. Choose from:
 
 VWAP - Price above/below volume-weighted average
 EMA - Price above/below exponential moving average
 SuperTrend - ATR-based trend indicator
 Combined modes (VWAP+EMA, VWAP+SuperTrend) for stricter filtering
 
### 9. Pullback Filter (Advanced)
 Purpose: 
Waits for price to pull back slightly after initial breakout before confirming the signal. 
This reduces false breakouts from immediate reversals.
 How it works: 
- After breakout is detected, indicator waits for a small pullback (default 2%)
- Once pullback occurs AND price breaks out again, signal is confirmed
- If no pullback within timeout period (5 bars), signal is issued anyway
 Settings: 
 
 Enable Pullback Filter:  Turn this filter on/off
 Pullback %:  How much price must pull back (2% is balanced)
 Timeout (bars):  Max bars to wait for pullback (5 is standard)
 
 When to use: 
- Choppy markets with many fake breakouts
- When you want higher quality signals
- Combine with Volume filter for maximum confirmation
 Trade-off: 
- Better signal quality
- May miss some valid fast moves
- Slight entry delay
  
 How to Use This Indicator 
### For Beginners - Simple Setup
 
 Add the indicator to your chart (5-minute or 15-minute timeframe recommended)
 Leave all default settings - they work well for most stocks
 Watch for BREAK UP or BREAK DOWN labels to appear
 Check the dashboard for entry, stop loss, and targets
 Use the position sizing to determine how many shares to buy
 
 Basic Trading Plan: 
 
 Wait for a clear breakout label
 Enter at the ORB level (or next candle open if you're late)
 Place stop loss where the red line indicates
 Take profit at TP1 (50% of position) and TP2 (remaining 50%)
 
### For Advanced Traders - Customized Setup
 
 Choose which ORB stages to track (you might only want ORB15 and ORB30)
 Enable filters: Volume (stocks) or Trend (trending markets)
 Enable FVG filter for institutional confirmation
 Set "Track Cycles" mode to catch retests and re-breakouts
 Customize stop loss method (ATR for volatile stocks, ORB% for stable ones)
 Adjust risk per trade and account size for accurate position sizing
 
 Advanced Strategy Example: 
 
 Enable ORB15 only (disable others for cleaner chart)
 Turn on Volume filter at 1.5x with Strong at 2.5x
 Enable Trend filter using VWAP
 Set Signal Mode to "Track Cycles" with Max 3 cycles
 Wait for aligned breakouts (Volume + Trend + Direction)
 Enter on retest if you missed the initial break
 
### Timeframe Recommendations
 
 5-minute chart:  Scalping, very active trading, crypto
 15-minute chart:  Day trading, balanced approach (most popular)
 30-minute chart:  Swing entries, less screen time
 60-minute chart:  Position trading, longer holds
 
The indicator works on any intraday timeframe, but ORB is fundamentally a day trading strategy. Daily charts don't make sense for ORB.
 
 DEFAULT CONFIGURATION  
ON by Default:
• All 4 ORB stages (5/15/30/60)
• Breakout Detection
• Retest Labels
• All TP levels (1/1.5/2/3)
• TP/SL Lines (Detailed mode)
• Dashboard (Bottom Left, Dark theme)
• Position Size Calculator
OFF by Default (Optional Filters):
• FVG Filter
• Pullback Filter
• Volume Filter
• Trend Filter
• HTF Bias Check
• Alerts
Recommended for Beginners:
• Leave all defaults
• Session Mode: Auto-Detect
• Signal Mode: Track Cycles
• Stop Method: ATR
• Add Volume Filter if trading stocks
 Recommended for Advanced: 
• Enable ORB15 + ORB30 only (disable 5 & 60)
• Enable: Volume + Trend + FVG 
• Signal Mode: Track Cycles, Max 3 
• Stop Method: ATR or Safer 
• Enable HTF Daily bias check 
 
## Settings Guide
The settings are organized into logical groups. Here's what each section controls:
### ORB COLORS Section
 
 Show Edge Labels:  Display "ORB 5", "ORB 15" labels at the right edge of the levels
 Background:  Fill the area between ORB high/low with color
 Transparency:  How see-through the background is (95% is nearly invisible)
 Enable ORB 5/15/30/60:  Turn each stage on or off individually
 Colors:  Assign colors to each ORB stage for easy identification
 
### SESSION SETTINGS Section
 
 Session Mode:  Choose trading session (Auto-Detect works for most instruments)
 Custom Session Hours:  Define your own hours if needed (format: HHMM-HHMM)
 
Auto-Detect uses the instrument's natural hours (stocks use exchange hours, crypto uses 24/7).
### BREAKOUT DETECTION Section
 
 Enable Breakout Detection:  Master switch for signals
 Show Retest Labels:  Display retest signals
 Label Size:  Visual size for all labels (Small recommended)
 Enable FVG Filter:  Require Fair Value Gap confirmation
 Show FVG Boxes:  Display the gap boxes on chart
 Signal Mode:  "First Only" = one signal per direction per day, "Track Cycles" = multiple signals
 Max Cycles:  How many breakout-retest cycles to track (6 is balanced)
 Breakout Buffer:  Extra distance required beyond ORB level (0.1-0.2% recommended)
 Min Distance for Retest:  How far price must move away before retest is valid (2% recommended)
 Min Bars Outside ORB:  Bars price must stay outside for committed breakout (2 is balanced)
 
### TARGETS & RISK Section
 
 Enable Targets & Stop-Loss:  Calculate and show trade management
 TP1/TP2/TP3 checkboxes:  Select which profit targets to display
 Stop Method:  How to calculate stop loss placement
  - ATR: Based on volatility (best for most cases)
  - ORB %: Fixed % of ORB range
  - Swing: Recent swing high/low
  - Safer: Widest of all methods
 ATR Length & Multiplier:  Controls ATR stop distance (14 period, 1.5x is standard)
 ORB Stop %:  Percentage beyond ORB for stop (20% is balanced)
 Swing Bars:  Lookback period for swing high/low (3 is recent)
 
### TP/SL LINES Section
 
 Show TP/SL Lines:  Display horizontal lines on chart
 Label Format:  "Short" = minimal text, "Detailed" = shows prices
 Freeze Lines at EOD:  Stop extending lines at session close
 
### DASHBOARD Section
 
 Show Info Panel:  Display the metrics dashboard
 Theme:  Dark or Light colors
 Position:  Where to place dashboard on chart
 Toggle rows:  Show/hide specific information rows
 Calculate Position Size:  Enable the position sizing calculator
 Risk Mode:  Risk fixed $ amount or % of account
 Account Size:  Your total trading capital
 Risk %:  Percentage to risk per trade (0.5-1% recommended)
 
### VOLUME FILTER Section
 
 Enable Volume Filter:  Require volume confirmation
 MA Length:  Average period (20 is standard)
 Min Volume:  Required multiplier (1.5x = 50% above average)
 Strong Volume:  Multiplier that bypasses other filters (2.5x)
 
### TREND FILTER Section
 
 Enable Trend Filter:  Require trend alignment
 Trend Mode:  Method to determine trend (VWAP is simple and effective)
 Custom EMA Length:  If using EMA mode (50 for swing, 20 for day trading)
 SuperTrend settings:  Period and Multiplier if using SuperTrend mode
 
### HIGHER TIMEFRAME Section
 
 Check Daily Trend:  Display higher timeframe bias in dashboard
 Timeframe:  What TF to check (D = daily, recommended)
 Method:  Price vs MA (stable) or Candle Direction (reactive)
 MA Period:  EMA length for Price vs MA method (20 is balanced)
 Min Strength %:  Minimum strength threshold for HTF bias to be considered
  - For "Price vs MA": Minimum distance (%) from moving average
  - For "Candle Direction": Minimum candle body size (%)
  - 0.5% is balanced - increase for stricter filtering
  - Lower values = more signals, higher values = only strong trends
 
### ALERTS Section
 
 Enable Alerts:  Master switch (must be ON to use any alerts)
 Breakout Alerts:  Notify on ORB breakouts
 Retest Alerts:  Notify when price retests after breakout
 Failed Break Alerts:  Notify on failed breakouts
 Stage Complete Alerts:  Notify when each ORB stage finishes forming
 
After enabling desired alert types, click "Create Alert" button, select this indicator, choose "Any alert() function call".
## Tips & Best Practices
### General Trading Tips
 
 ORB works best on liquid instruments (stocks with good volume, major crypto pairs)
 First hour of the session is most important - that's when ORB is forming
 Breakouts WITH the trend have higher success rates - use the trend filter
 Failed breakouts are common - use the "Min Bars Outside" setting to filter weak moves
 Not every day produces good ORB setups - be patient and selective
 
### Position Sizing Best Practices
 
 Never risk more than 1-2% of your account on a single trade
 Use the built-in calculator - don't guess your position size
 Update your account size monthly as it grows
 Smaller accounts: use $ Amount mode for simplicity
 Larger accounts: use % of Account mode for scaling
 
### Take Profit Strategy
 
 Most traders use: 50% at TP1, 50% at TP2
 Aggressive: Hold through TP1 for TP2 or TP3
 Conservative: Full exit at TP1 (1:1 risk/reward)
 After TP1 hits, consider moving stop to breakeven
 TP3 rarely hits - only on strong trending days
 
### Filter Combinations
 
 Maximum Quality:  Volume + Trend + FVG (fewest signals, highest quality)
 Balanced:  Volume + Trend (good quality, reasonable frequency)
 Active Trading:  No filters or Volume only (many signals, lower quality)
 Trending Markets:  Trend filter essential (indices, crypto)
 Range-Bound:  Volume + FVG (avoid trend filter)
 
### Common Mistakes to Avoid
 
 Chasing breakouts - wait for the bar to close, don't FOMO into wicks
 Ignoring the stop loss - always use it, move it manually if needed
 Over-leveraging - the calculator shows MAX shares, you can buy less
 Trading every signal - quality > quantity, use filters
 Not tracking results - keep a journal to see what works for YOU
 
## Pros and Cons
### Advantages
 
 Complete all-in-one solution - from signal to position sizing
 Multiple timeframes tracked simultaneously
 Visual clarity - easy to see what's happening
 Cycle tracking catches opportunities others miss
 Built-in risk management eliminates guesswork
 Customizable filters for different trading styles
 No repainting - what you see is locked in
 Works across multiple markets (stocks, forex, crypto)
 
### Limitations
 
 Intraday strategy only - doesn't work on daily charts
 Requires active monitoring during first 1-2 hours of session
 Not suitable for after-hours or extended sessions by default
 Can produce many signals in choppy markets (use filters)
 Dashboard can be overwhelming for complete beginners
 Performance depends on market conditions (trends vs ranges)
 Requires understanding of risk management concepts
 
### Best For
 
 Day traders who can watch the first 1-2 hours of market open
 Traders who want systematic entry/exit rules
 Those learning proper position sizing and risk management
 Active traders comfortable with multiple signals per day
 Anyone trading liquid instruments with clear sessions
 
### Not Ideal For
 
 Swing traders holding multi-day positions
 Set-and-forget / passive investors
 Traders who can't watch market open
 Complete beginners unfamiliar with trading concepts
 Low volume / illiquid instruments
 
## Frequently Asked Questions
 Q: Why are no signals appearing? 
A: Check that you're on an intraday timeframe (5min, 15min, etc.) and that the current time is within your session hours. Also verify that "Enable Breakout Detection" is ON and at least one ORB stage is enabled. If using filters, they might be blocking signals - try disabling them temporarily.
 Q: What's the best ORB stage to use? 
A: ORB15 (15 minutes) is most popular and balanced. ORB5 gives faster signals but more noise. ORB30 and ORB60 are slower but more reliable. Many traders use ORB15 + ORB30 together.
 Q: Should I enable all the filters? 
A: Start with no filters to see all signals. If too many false signals, add Volume filter first (stocks) or Trend filter (trending markets). FVG filter is most restrictive - use for maximum quality but fewer signals.
 Q: How do I know which stop loss method to use? 
A: ATR works for most cases - it adapts to volatility. Use ORB% if you want predictable stop placement. Swing is for respecting chart structure. Safer gives you the most room but largest risk.
 Q: Can I use this for swing trading? 
A: Not really - ORB is fundamentally an intraday strategy. The ranges reset each day. For swing trading, look at weekly support/resistance or moving averages instead.
 Q: Why do TP/SL lines disappear sometimes? 
A: Lines freeze (stop extending) when: stop loss is hit, the last enabled take-profit is hit, or end of session arrives (if "Freeze at EOD" is enabled). This is intentional - the trade is complete.
 Q: What's the difference between "First Only" and "Track Cycles"? 
A: "First Only" shows one breakout UP and one DOWN per day maximum - clean but might miss opportunities. "Track Cycles" shows breakout-retest-rebreak sequences - more signals but busier chart.
 Q: Is position sizing accurate for options/forex? 
A: The calculator is designed for shares (stocks). For options, ignore the share count and use the risk amount. For forex, you'll need to adapt the lot size calculation manually.
 Q: How much capital do I need to use this? 
A: The indicator works for any account size, but practical day trading typically requires $25,000 in the US due to Pattern Day Trader rules. Adjust the "Account Size" setting to match your capital.
 Q: Can I backtest this strategy? 
A: This is an indicator, not a strategy script, so it doesn't have built-in backtesting. You can visually review historical signals or code a strategy script using similar logic.
 Q: Why does the dashboard show different entry price than the breakout label? 
A: If you're looking at an old breakout, the ORB levels may have changed when the next stage completed. The dashboard always shows the CURRENT active range and trade setup.
 Q: What's a good win rate to expect? 
A: ORB strategies typically see 40-60% win rate depending on market conditions and filters used. The strategy relies on positive risk/reward ratios (2:1 or better) to be profitable even with moderate win rates.
 Q: Does this work on crypto? 
A: Yes, but crypto trades 24/7 so you need to define what "session start" means. Use Session Mode = Custom and set your preferred daily reset time (e.g., 0000-2359 UTC).
## Credits & Transparency
### Development
This indicator was developed with the assistance of AI technology to implement complex ORB trading logic.
The strategy concept, feature specifications, and trading logic were designed by the publisher. The implementation leverages modern development tools to ensure:
 
 Clean, efficient, and maintainable code
 Comprehensive error handling and input validation
 Detailed documentation and user guidance
 Performance optimization
 
### Trading Concepts
This indicator implements several public domain trading concepts:
 
 Opening Range Breakout (ORB):  Trading strategy popularized by Toby Crabel, Mark Fisher and many more talanted traders.
 Fair Value Gap (FVG):  Price imbalance concept from ICT methodology
 SuperTrend:  ATR-based trend indicator using public formula
 Risk/Reward Ratio:  Standard risk management principle
 
All mathematical formulas and technical concepts used are in the public domain.
### Pine Script
Uses standard TradingView built-in functions:
 ta.ema(), ta.atr(), ta.vwap(), ta.highest(), ta.lowest(), request.security() 
No external libraries or proprietary code from other authors.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice.
Trading involves substantial risk of loss and is not suitable for every investor. Past performance shown in examples is not indicative of future results.
The indicator provides signals and calculations, but trading decisions are solely your responsibility. Always:
 
 Test strategies on paper before using real money
 Never risk more than you can afford to lose
 Understand that all trading involves risk
 Consider seeking advice from a licensed financial advisor
 
The publisher makes no guarantees regarding accuracy, profitability, or performance. Use at your own risk.
---
 Version:  3.0
 Pine Script Version:  v6
 Last Updated:  October 2024
For support, questions, or suggestions, please comment below or send a private message.
---
 Happy trading, and remember: consistent risk management beats perfect entry timing every time.
Multi-Timeframe Trend Indicator with Signals═══════════════════════════════════════════════════════════════
         Multi-Timeframe Trend Indicator with Signals
                    by Zakaria Safri
═══════════════════════════════════════════════════════════════
⚠️ IMPORTANT DISCLAIMERS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• This indicator may REPAINT on unconfirmed bars
• Signals appear in real-time but may change or disappear
• FOR EDUCATIONAL PURPOSES ONLY - NOT FINANCIAL ADVICE
• Past performance does not guarantee future results
• Always do your own research and use proper risk management
• The Risk Management feature is VISUAL ONLY - does not execute trades
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 OVERVIEW:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator combines multiple technical analysis tools to help identify
potential trend directions and entry/exit points across different timeframes.
It uses SuperTrend, EMAs, ADX, RSI, and Keltner Channels to generate signals.
🎯 KEY FEATURES:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📍 SIGNAL TYPES:
   • All Signals: Shows all SuperTrend crossovers
   • Filtered Signals: Additional EMA filter for potentially higher quality signals
   • Signals use barstate.isconfirmed to reduce (but not eliminate) repainting
📈 TREND ANALYSIS:
   • Trend Ribbon: 8 EMAs creating a visual trend direction indicator
   • Trend Cloud: EMA 150/250 cloud for long-term trend context
   • Chaos Trend Line: Dynamic support/resistance trend line
   • Multi-timeframe dashboard showing trend across 8 timeframes (3m to Daily)
📊 TECHNICAL INDICATORS:
   • Keltner Channels: Dynamic price channels
   • RSI Background: Visual overbought/oversold zones
   • Candlestick Coloring: Three modes (CleanScalper/Trend Ribbon/Moving Average)
   • ADX-based trend strength analysis for MTF dashboard
🎯 VISUAL TOOLS:
   • Order Blocks: Supply/demand zones (optional)
   • Channel Breakouts: Pivot-based support/resistance levels
   • Reversal Signals: RSI-based potential reversal indicators
   • Visual TP/SL Lines: For reference only - does NOT execute trades
📊 DASHBOARD:
   • Real-time multi-timeframe trend analysis
   • Volatility indicator (Very Low to Very High)
   • Current RSI value with color coding
   • Customizable position and size
⚙️ SETTINGS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
MAIN SETTINGS:
• Sensitivity: Controls signal frequency (lower = more signals)
• Signal Type: Choose between All Signals or Filtered Signals
• Factor: ATR multiplier for SuperTrend calculation
TREND SETTINGS:
• Toggle Trend Ribbon, Trend Cloud, Chaos Trend, Order Blocks
• Moving Average: Customizable EMA (default 200)
ADVANCED SETTINGS:
• Candlestick coloring with 3 different modes
• Overbought/Oversold background coloring
• Channel breakout levels
• Show/hide signals
RISK MANAGEMENT (VISUAL ONLY):
• ⚠️ Does NOT execute trades automatically
• Shows potential Take Profit levels (TP1, TP2, TP3)
• Shows potential Stop Loss level
• Adjustable TP strength multiplier
• For educational reference only
📖 HOW TO USE:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
1. SIGNAL INTERPRETATION:
   • "Buy" signals appear below candles when conditions are met
   • "Sell" signals appear above candles when conditions are met
   • Wait for bar close confirmation to avoid repainting
   • Use multiple timeframes for confluence
2. TREND CONFIRMATION:
   • Check the multi-timeframe dashboard for trend alignment
   • Use Trend Ribbon for visual trend direction
   • Trend Cloud shows longer-term market bias
   • Green candles = potential uptrend, Red = potential downtrend
3. ENTRY/EXIT STRATEGY:
   • Combine signals with other analysis tools
   • Check volatility status before entering trades
   • Use support/resistance levels for confirmation
   • The visual TP/SL lines are for planning only
4. RISK MANAGEMENT:
   • Always use stop losses (indicator shows suggested levels only)
   • Position size according to your risk tolerance
   • Never risk more than you can afford to lose
   • The indicator does NOT manage trades automatically
⚠️ LIMITATIONS & RISKS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REPAINTING:
• Signals may appear and disappear on unconfirmed bars
• Always wait for bar close before taking action
• Historical performance may look better than real-time results
FALSE SIGNALS:
• No indicator is 100% accurate
• Signals can fail in ranging/choppy markets
• Use additional confirmation methods
• Consider market context and fundamentals
VISUAL TP/SL:
• Lines are for reference/planning only
• Does NOT place or manage actual trades
• You must manually set your own stop losses
• TP levels are calculated estimates, not guarantees
🔧 TECHNICAL DETAILS:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
• Version: Pine Script v5
• Overlay: Yes (displays on main chart)
• Anti-repaint measures: Uses barstate.isconfirmed on signals
• Security function: Uses lookahead protection for higher timeframes
• Dynamic requests: Enabled for MTF analysis
• Max labels: 500
📚 COMPONENTS EXPLAINED:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
SUPERTREND:
• Core signal generator using ATR-based bands
• Crossovers indicate potential trend changes
• Adjustable via Sensitivity and Factor inputs
EMA FILTER:
• Uses 200 EMA as trend filter (customizable)
• Filtered signals require price above/below EMA
• Helps reduce false signals in ranging markets
ADX TREND QUALITY:
• Measures trend strength across timeframes
• Used in multi-timeframe dashboard
• Shows Bullish/Bearish/Neutral states
KELTNER CHANNELS:
• Multiple bands showing volatility zones
• Color-coded based on RSI levels
• Helps identify overbought/oversold conditions
ORDER BLOCKS:
• Identifies supply/demand zones
• Based on price structure and pivots
• Can extend to the right for projection
💡 BEST PRACTICES:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Use multiple timeframe confirmation
✓ Wait for bar close before acting on signals
✓ Combine with support/resistance analysis
✓ Check overall market conditions
✓ Use proper risk management (1-2% per trade)
✓ Backtest on your specific market/timeframe
✓ Paper trade before using real money
✓ Keep a trading journal
✓ Adjust settings to your trading style
✗ Don't rely solely on this indicator
✗ Don't ignore risk management
✗ Don't trade on unconfirmed signals
✗ Don't overtrade every signal
✗ Don't use without understanding how it works
✗ Don't expect the TP/SL feature to trade for you
📞 SUPPORT & UPDATES:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Creator: Zakaria Safri
Version: 4.3 (Compliance Update)
For questions or feedback, please use TradingView's comment section.
⚖️ FINAL DISCLAIMER:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
This indicator is provided for EDUCATIONAL and INFORMATIONAL purposes only.
It is NOT financial advice, investment advice, or a recommendation to buy/sell.
Trading involves substantial risk of loss. Past performance, whether actual or
indicated by historical tests of strategies, is not indicative of future results.
The creator assumes NO responsibility for your trading results. You are solely
responsible for your own investment decisions and due diligence.
Always consult with a qualified financial advisor before making investment decisions.
By using this indicator, you acknowledge and accept these risks and limitations.
AshishBediSPLAshishBediSPL: Dynamic Premium Analysis with Integrated Signals
This indicator provides a comprehensive view of combined options premiums by aggregating data from Call and Put contracts for a selected index and expiry. It integrates multiple popular technical indicators like EMA Crossover, Supertrend, VWAP, RSI, and SMA, allowing users to select their preferred tools for generating dynamic buy and sell signals directly on the premium chart.
AshishBediSPL" is a powerful TradingView indicator designed to analyze options premiums. It calculates a real-time combined premium for a chosen index (NIFTY, BANKNIFTY, FINNIFTY, etc.) and specific expiry date. You have the flexibility to visualize the premium of Call options, Put options, or a combined premium of both.
The indicator then overlays several popular technical analysis tools, which you can selectively enable:
EMA Crossover: Identify trend changes with configurable fast and slow Exponential Moving Averages.
Supertrend: Detect trend direction and potential reversal points.
VWAP (Volume Weighted Average Price): Understand the average price of the premium considering trading volume.
RSI (Relative Strength Index): Gauge momentum and identify overbought/oversold conditions.
SMA (Simple Moving Average): Analyze price smoothing and trend identification.
Based on your selected indicators, the tool generates clear "Buy" and "Sell" signals directly on the chart, helping you identify potential entry and exit points. Customizable alerts are also available to keep you informed.
Unlock a new perspective on options trading with "AshishBediSPL." This indicator focuses on the combined value of options premiums, giving you a consolidated view of market sentiment for a chosen index and expiry.
Instead of just looking at individual option prices, "AshishBediSPL" blends the Call and Put premiums (or focuses on one, based on your preference) and empowers you with a suite of built-in technical indicators: EMA, Supertrend, VWAP, RSI, and SMA. Pick the indicators that resonate with your strategy, and let the tool generate actionable buy and sell signals right on your chart. With customizable alerts, you'll never miss a crucial market move. Gain deeper insights and make more informed trading decisions with "AshishBediSPL.
Combined options premium: This accurately describes what your indicator calculates.
Selected index and expiry: Essential inputs for the indicator.
Call/Put options or combined: Explains the flexibility in data display.
Multiple technical indicators (EMA Crossover, Supertrend, VWAP, RSI, SMA): Lists the analysis tools included.
Buy/Sell signals: The primary output of the indicator.
Customizable alerts: A valuable feature for users.
LANZ Strategy 4.0🔷 LANZ Strategy 4.0 — Trend Impulse Detection with Risk Management 
LANZ Strategy 4.0 is a multi-indicator trend strategy designed for short to medium-term trading on any asset or timeframe. It combines Parabolic SAR, Supertrend, ADX, and time zone highlighting to detect and confirm trend impulses, while managing entries with dynamic Stop Loss (SL) and Take Profit (TP) levels.
 🧠 Core Components: 
 
 Parabolic SAR: Identifies short-term trend reversals.
 Supertrend: Highlights trend continuation zones.
 ADX Filter: Ensures trend strength by filtering entries when ADX exceeds a defined threshold.
 Impulse Detection Logic: Detects and confirms movement impulses with a counter, only generating trade signals on confirmed sequences.
 Risk Management: Calculates dynamic SL/TP with a default risk-reward ratio of 1:2, minimum SL of 4 pts, and maximum of 12 pts.
 
 📊 Visual Features: 
 
 Trend lines from Supertrend and SAR.
 Colored background zones for different sessions (Asia, NY).
 Labels and lines for entry, SL, and TP.
 Movement number labels help visualize impulse progression.
 Alerts when a new impulse is confirmed.
 
 ⚙️ How It Works: 
 
 The strategy waits for a confirmed impulse (i.e., change in SAR + Supertrend + ADX filter).
 Once a valid impulse is confirmed:
 A trade signal (BUY/SELL) is shown.
 SL and TP levels are calculated and drawn.
 The script monitors live price to determine if SL or TP is hit.
 Impulse counter advances to label movement progression.
 
 🔔 Alerts: 
 
 You will receive an alert each time a new valid impulse is confirmed, indicating a potential trading opportunity.
 
 📝 Notes: 
 
 Script is intended for discretionary or assisted trading, not automated execution.
 Works best during active sessions with visible trend direction.
 You can adjust ATR period, multiplier, SL padding, and impulse thresholds.
 
 Credits: 
 Developed by LANZ combines established technical indicators and original impulse-count logic.
LiquidFusion SignalPro [CHE]  LiquidFusion SignalPro   – Indicator Overview 
The LiquidFusion SignalPro   is a powerful and sophisticated TradingView indicator designed to identify high-quality trade entries and exits. By combining seven unique sub-indicators, it provides comprehensive market analysis, ensuring traders can make informed decisions. This tool is suitable for all market conditions and supports customization to fit individual trading strategies.
  Key Components (Sub-Indicators): 
1. RPM (Relative Price Momentum):
   - Measures cumulative price momentum over a specified period.
   - Provides insights into price strength and directional bias.
   - Input Customization:
     - Source: Data for momentum calculation.
     - Period: Length for momentum measurement.
     - Resolution: Timeframe for data fetching.
2. BBO (Bull-Bear Oscillator):
   - Calculates the strength of bullish or bearish momentum based on price movement and RSI conditions.
   - Uses a super-smoothing technique for reliable signals.
   - Customizable parameters include the oscillator's period and repainting options.
3. MACD (Moving Average Convergence Divergence):
   - A classic momentum indicator for trend direction and strength.
   - Provides buy/sell signals based on the crossover of the MACD line and signal line.
   - Input Customization:
     - Fast/Slow EMA Periods.
     - Signal Line Period.
     - Resolution and Source Data.
4. RSI (Relative Strength Index):
   - Tracks overbought and oversold conditions.
   - A key tool to validate trend continuation or reversals.
   - Customizable period, resolution, and source.
5. CCI (Commodity Channel Index):
   - Measures the deviation of price from its average.
   - Useful for identifying cyclical trends.
   - Input Customization includes period, resolution, and source.
6. Stochastic Oscillator:
   - Indicates momentum by comparing closing prices to a range of highs and lows.
   - Includes smoothing factors for %K and %D lines.
   - Customizable parameters:
     - %K Length and Smoothing.
     - Resolution and Repainting Options.
7. Supertrend:
   - A trailing stop-and-reverse system for trend-following strategies.
   - Excellent for identifying strong trends and potential reversals.
   - Inputs include the multiplier factor and period for ATR-like calculations.
  Inputs Overview: 
The indicator supports extensive customization for each sub-indicator, grouped under intuitive categories:
- Color Settings: Define bullish and bearish plot colors.
- RPM, BBO, MACD, RSI, CCI, Stochastic, and Supertrend Settings: Tailor each sub-indicator's behavior with adjustable parameters.
- UI Options: Toggle features such as bar coloring, indicator names, and plotted candles.
  Trade Signals: 
- Long Signal:
  - All indicators align in a bullish state:
    - RPM > 0, MACD > 0, RSI > 50, Stochastic > 50, CCI > 0, BBO > 0, Supertrend below price.
  - Plot: Green triangle below the candle.
  - Alert: Notifies the trader of a potential long entry.
- Short Signal:
  - All indicators align in a bearish state:
    - RPM < 0, MACD < 0, RSI < 50, Stochastic < 50, CCI < 0, BBO < 0, Supertrend above price.
  - Plot: Red triangle above the candle.
  - Alert: Notifies the trader of a potential short entry.
  Features: 
- Enhanced Visuals: Plots sub-indicator statuses using labels and color-coded shapes for clarity.
- Alerts: Integrated alert conditions for both long and short trades.
- Bar Coloring: Provides overall trend bias with green (bullish), red (bearish), or gray (neutral) bars.
- Customizable Table: Displays the indicator's status in the chart’s top-right corner.
  Trading Benefits: 
The LiquidFusion SignalPro   excels in generating high-quality entries and exits by:
- Reducing noise through multiple indicator alignment.
- Supporting multiple timeframes and resolutions for flexibility.
- Offering customizable inputs for personalized trading strategies.
Use this tool to enhance your market analysis and improve your trading performance.
 Disclaimer: 
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
This indicator is inspired by the Super 6x Indicators: RSI, MACD, Stochastic, Loxxer, CCI, and Velocity  . A special thanks to Loxx for their relentless effort, creativity, and contributions to the TradingView community, which served as a foundation for this work.
Happy trading and best regards
Chervolino
Elliott Wave AnalysisInitially, Elliott wave analysis is designed to simplify and increase the objectivity of graph analysis using the Elliott method. Probably, this indicator can be successfully used in trading without knowing the Elliott method.
The indicator is based on a supertrend. Supertrends are built in accordance with the Fibonacci grid. The degree of waves in the indicator settings corresponds to a 1-hour timeframe - this is the main mode of working with the indicator. I also recommend using weekly (for evaluating large movements) and 1-minute timeframes.
When using other timeframes, the baseline of the indicator will correspond to:
1 min-Submicro
5 minutes-Micro
15 minutes-Subminuette
1 hour-Minuette
4 hours-Minute
Day-Minor
Week-Intermediate
Month-Primary
Those who are well versed in the Elliott method can see that the waves fall on the indicator almost perfectly. To demonstrate this, I put the markup on the graph
Bank Nifty ScalpingThis indicator is designed for scalping purposes.
Users have the option to input the desired source and enable or disable the following indicators:
 Multiple EMA (Exponential moving average) 
Simultaneously displays multiple moving averages to quickly identify shifts in momentum and obtain confirmation from slower-moving averages.
By default, the EMA display settings are configured to show the 20-day EMA and the 200-day EMA. However, users have the flexibility to modify the display settings according to their preferences. This means that users can customize the indicator to show the EMA values of their choice, such as EMA 50 and EMA 100. 
 VWAP ( Volume weighted average price )  
Default value is set to ‘hl2’ 
A bullish trend is indicated when the price is above the Volume Weighted Average Price (VWAP), while a bearish trend is indicated when the price is below the VWAP. 
 VWMA ( Volume weighted moving average )  
In the VWMA (Volume Weighted Moving Average) indicator, a default value of 20 is used. If the price is higher than the VWMA, it typically indicates a bullish trend. Conversely, if the price is lower than the VWMA, it suggests a bearish trend. The VWMA takes into account both price and volume, providing a weighted average that can help identify shifts in market sentiment. 
 Multiple SuperTrends 
Default value is 10 and 2 / 10 and 3 
A bullish trend is identified when the price is above the SuperTrend indicator, whereas a bearish trend is observed when the price is below the SuperTrend indicator. 
 Camarilla Pivot Points (Level 3 and 4 only) 
Levels 3 and 4 serve as crucial support and resistance levels, acting as the final line of defense against strong trends. These levels are expected to generate reversals, where price often changes direction.
CPR ( Central Pivot Points) 
The Daily Central Pivot Point Indicator is a popular tool used in technical analysis. It calculates several levels based on the previous day's high, low, and closing prices. 
 Strong Volume 
The user has the ability to set the average volume for Nifty and BankNifty indices to calculate strong volume.
 Elder Impulse System 
The Impulse System, developed by Alexander Elder and discussed in his book "New Trading for a Living," is a censorship trading system designed to determine whether a trade should be allowed or prohibited. Additionally, it can be used to identify when a trend is starting to weaken. The Impulse System relies on the following factors:
1. Slope of a Fast Exponential Moving Average (EMA): The fast EMA's slope reflects the price's inertia or momentum.
2. Slope of the Moving Average Convergence Divergence (MACD): The MACD's slope indicates the strength or power of the price movement.
Based on these factors, the Impulse System categorizes candles or price bars into three colors:
* Green Candle: When both the fast EMA and MACD are rising, indicating upward momentum.
* Red Candle: When both the fast EMA and MACD are declining, suggesting downward momentum.
* Blue Candle: In all other cases where the conditions for green or red candles are not met, representing a neutral or uncertain market condition.
By applying the Impulse System, traders can gain insights into the market trend, its strength, and potential shifts in momentum, helping them make informed trading decisions.
Happy Trading
EMA+SuperThis comprehensive indicator combines multiple powerful trend-following tools into a single chart overlay, designed for traders seeking clear entry and exit signals with market context.
Features:
Exponential Moving Averages (EMAs): Five EMAs (9, 21, 50, 100, 200) plotted for multi-timeframe trend analysis and dynamic support/resistance.
Supertrend: Classic volatility-based trend indicator highlighting bullish and bearish phases with dynamic colored bands.
NovaWave Cloud: Custom trend cloud created using fast and slow EMAs plus a signal moving average for visualizing market momentum shifts.
Displaced Moving Averages (20, 50, 200 DMA): Simple moving averages with optional displacement to assess lagged trend confirmation and cyclical ranges.
Buy/Sell Signal Labels: Automated labels show “BUY” when the 9 EMA crosses above the 21 EMA, and “SELL” when the 9 EMA crosses below the 21 EMA, providing timely entry/exit cues.
Intended Use:
Perfect for swing and position traders, this indicator combines trend confirmation and actionable signals to help identify sustained price moves in various markets. It works well on multiple timeframes, offering a clear visual framework for market direction and trading decisions.
How to Use:
Look for BUY labels for potential long entry opportunities when momentum shifts bullish.
Look for SELL labels as potential exit or short signals when a bearish momentum crossover occurs.
Use the overlaying EMAs, Supertrend, and cloud as additional confirmation for trend strength and timing.
This all-in-one tool is ideal for traders who want a unified view of trend dynamics combined with simple, clear signals without needing multiple separate indicators.
Feel free to modify or expand based on your style. Let me know if you want a shorter summary or technical details added!
LiliALHUNTERSystem_v2📚 **Library: LiliALHUNTERSystem_v2**
This library provides a powerful target management system for Pine Script developers.  
It includes advanced calculators for EMA, RMA, and Supertrend, and introduces a central `createTargets()` function to dynamically render target lines and labels based on long/short trade logic.
🛠️ **Main Features:**
– Dynamic horizontal & vertical target lines  
– Dual target configuration (Target 1 & Target 2)  
– Directional logic via `isLong1`, `isLong2`  
– Integrated Supertrend validation  
– Visual dashboard and label display  
– Works seamlessly with custom indicators
🎯 **Purpose:**  
The `LiliALHUNTERSystem_v2` Library enables Pine coders to manage and visualize targets consistently across all trading strategies and indicators. It simplifies target logic while maintaining visual clarity and modular usage.
⚠️ **Disclaimer:**  
This script is intended for educational and analytical purposes only. It does not constitute financial advice.
Library   "LiliALHUNTERSystem_v2" 
 ema_calc(len, source) 
  Parameters:
     len (simple int) 
     source (float) 
 rma_calc(len, source) 
  Parameters:
     len (simple int) 
     source (float) 
 supertrend_calc(length, factor) 
  Parameters:
     length (simple int) 
     factor (float) 
 createTargets(config, state, source1A, source1B, source2A, source2B) 
  Parameters:
     config (TargetConfig) 
     state (TargetState) 
     source1A (float) 
     source1B (float) 
     source2A (float) 
     source2B (float) 
 showDashboard(state, dashLoc, textSize) 
  Parameters:
     state (TargetState) 
     dashLoc (string) 
     textSize (string) 
 TargetConfig 
  Fields:
     enableTarget1 (series bool) 
     enableTarget2 (series bool) 
     isLong1 (series bool) 
     isLong2 (series bool) 
     target1Condition (series string) 
     target2Condition (series string) 
     target1Color (series color) 
     target2Color (series color) 
     target1Style (series string) 
     target2Style (series string) 
     distTarget1 (series float) 
     distTarget2 (series float) 
     distOptions1 (series string) 
     distOptions2 (series string) 
     showLabels (series bool) 
     showDash (series bool) 
 TargetState 
  Fields:
     target1LineV (series line) 
     target1LineH (series line) 
     target2LineV (series line) 
     target2LineH (series line) 
     target1Lbl (series label) 
     target2Lbl (series label) 
     target1Active (series bool) 
     target2Active (series bool) 
     target1Value (series float) 
     target2Value (series float) 
     countTargets1 (series int) 
     countTgReached1 (series int) 
     countTargets2 (series int) 
     countTgReached2 (series int)






















