Trend Following Bundle [ActiveQuants]

This bundle operates on the principle that combining signals from multiple, complementary indicators provides a more robust view of market trends than relying on a single tool. It integrates:
- Trend Direction: Moving Averages, Supertrend.
- Momentum: MACD.
- Trend Strength: ADX.
- Volume Pressure: On Balance Volume (OBV).
- Volatility: Average True Range (ATR).
- Market Condition Filter: Choppiness Index (Trend vs. Range).
By allowing users to selectively enable, customize, and view these indicators (potentially across different timeframes), the bundle facilitates nuanced and layered trend analysis.
█ KEY FEATURES
- All-in-One Convenience: Access multiple core trend-following indicators within a single TradingView script slot.
- Modular Design: Easily toggle each individual indicator (MAs, MACD, Supertrend, etc.) On or Off via the settings menu to customize your chart view.
- Extensive Customization: Fine-tune parameters (lengths, sources, MA types, colors, etc.) for every included indicator to match your trading style and the specific asset.
- Multi-Timeframe (MTF) Capability: Configure each indicator component to analyze data from a different timeframe than the chart's, allowing for higher-level trend context.
- Integrated Alerts: Pre-built alert conditions for key events like Moving Average crossovers, MACD signals, Supertrend flips, and Choppiness Index threshold crosses. Easily set up alerts through TradingView's alert system.
When configuring your alerts in TradingView, pay close attention to the trigger option:
- Setting it to "Only Once" will trigger the alert the first time the condition is met, which might happen during an unclosed bar (intra-bar). This alert instance will then cease.
- Setting it to "Once Per Bar Close" will trigger the alert only after a bar closes if the condition was met on that finalized bar. This ensures signals are based on confirmed data and allows the alert to potentially trigger again on subsequent closing bars if the condition persists or reoccurs. Use this option for signals based on confirmed, closed-bar data. - MA Smoothing & Bands (Optional): Apply secondary smoothing or Bollinger Bands directly to the Fast and Slow Moving Averages for advanced analysis.
█ USER INPUTS
Fast MA:
- On/Off: Enables/Disables the Fast Moving Average plot and related smoothing/bands.
- Type: Selects the primary calculation type (SMA, EMA, SMMA (RMA), WMA, VWMA). Default: EMA.
- Source: Input data for the MA calculation (e.g., close, open, hl2). Default: close.
- Length: Lookback period for the primary MA calculation. Default: 9.
- Color: Sets the color of the primary Fast MA line. Default: Yellow.
- Line Width: Sets the thickness of the primary Fast MA line. Default: 2.
- Smoothing Type: Selects secondary smoothing type applied to the primary MA (e.g., None, SMA, EMA) or adds Bollinger Bands (SMA + Bollinger Bands). Default: None.
- Smoothing Length: Lookback period for the secondary smoothing MA or the basis MA for Bollinger Bands. Relevant only if Smoothing Type is not "None". Default: 10.
- BB StdDev: Standard deviation multiplier for Bollinger Bands. Relevant only if Smoothing Type is "SMA + Bollinger Bands". Default: 2.0.
- Timeframe: Sets a specific timeframe for the MA calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close before plotting, preventing repainting. Default: true.
Slow MA:
- On/Off: Enables/Disables the Slow Moving Average plot and related smoothing/bands.
- Type: Selects the primary calculation type (SMA, EMA, SMMA (RMA), WMA, VWMA). Default: EMA.
- Source: Input data for the MA calculation (e.g., close, open, hl2). Default: close.
- Length: Lookback period for the primary MA calculation. Default: 9.
- Color: Sets the color of the primary Slow MA line. Default: Yellow.
- Line Width: Sets the thickness of the primary Slow MA line. Default: 2.
- Smoothing Type: Selects secondary smoothing type applied to the primary MA (e.g., None, SMA, EMA) or adds Bollinger Bands (SMA + Bollinger Bands). Default: None.
- Smoothing Length: Lookback period for the secondary smoothing MA or the basis MA for Bollinger Bands. Relevant only if Smoothing Type is not "None". Default: 10.
- BB StdDev: Standard deviation multiplier for Bollinger Bands. Relevant only if Smoothing Type is "SMA + Bollinger Bands". Default: 2.0.
- Timeframe: Sets a specific timeframe for the MA calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close before plotting, preventing repainting. Default: true.
MACD:
- On/Off: Enables/Disables the MACD plots (MACD line, Signal line, Histogram).
- Fast Length: Lookback period for the fast MA in MACD calculation. Default: 12.
- Slow Length: Lookback period for the slow MA in MACD calculation. Default: 26.
- Source: Input data for the MACD MAs. Default: close.
- Signal Smoothing: Lookback period for the Signal Line MA. Default: 9.
- Oscillator MA Type: Calculation type for Fast and Slow MAs (SMA, EMA). Default: EMA.
- Signal Line MA Type: Calculation type for Signal Line MA (SMA, EMA). Default: EMA.
- MACD Color: Color of the MACD line. Default: #2962FF.
- MACD Signal Color: Color of the Signal line. Default: #FF6D00.
- Timeframe: Sets a specific timeframe for the MACD calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
On Balance Volume (OBV):
- On/Off: Enables/Disables the OBV plot and its related MAs/Bands.
- Type (MA Smoothing): Selects MA type for smoothing OBV (None, SMA, EMA, etc.) or SMA + Bollinger Bands. Default: None.
- Length (MA Smoothing): Lookback period for the OBV smoothing MA. Default: 14.
- BB StdDev: Standard deviation multiplier for Bollinger Bands if selected. Default: 2.0.
- Color: Color of the main OBV line. Default: #2962FF.
- Timeframe: Sets a specific timeframe for the OBV calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
ADX:
- On/Off: Enables/Disables the ADX plot.
- ADX Smoothing: Lookback period for the ADX smoothing component. Default: 14.
- DI Length: Lookback period for the Directional Movement (+DI/-DI) calculation. Default: 14.
- Color: Color of the ADX line. Default: Red.
- Timeframe: Sets a specific timeframe for the ADX calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
ATR:
- On/Off: Enables/Disables the ATR plot.
- Length: Lookback period for the ATR calculation. Default: 14.
- Smoothing: Selects the calculation type for ATR (SMMA (RMA), SMA, EMA, WMA). Default: SMMA (RMA).
- Color: Color of the ATR line. Default: #B71C1C.
- Timeframe: Sets a specific timeframe for the ATR calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
Supertrend:
- On/Off: Enables/Disables the Supertrend plot and background fill.
- ATR Length: Lookback period for the ATR calculation within Supertrend. Default: 10.
- Factor: Multiplier for the ATR value used to calculate the Supertrend bands. Default: 3.0.
- Up Trend Color: Color for the Supertrend line and background during an uptrend. Default: Green.
- Down Trend Color: Color for the Supertrend line and background during a downtrend. Default: Red.
- Timeframe: Sets a specific timeframe for the Supertrend calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
Choppiness Index:
- On/Off: Enables/Disables the Choppiness Index plot and bands.
- Length: Lookback period for the Choppiness Index calculation. Default: 14.
- Offset: Shifts the plot left or right. Default: 0.
- Color: Color of the Choppiness Index line. Default: #2962FF.
- Timeframe: Sets a specific timeframe for the CI calculation. Default: Chart.
- Wait TF Close: If a timeframe is set, waits for that timeframe's bar to close. Default: true.
█ STRATEGY EXAMPLES
The following strategy examples are provided for illustrative and educational purposes only to demonstrate how indicators within this bundle could be combined. They do not constitute financial advice or trading recommendations. Always conduct your own thorough research and backtesting before implementing any trading strategy.
Here are a few ways the indicators in this bundle can be combined:
1. MA Crossover with Multi-Factor Confirmation
- Goal: Enter trends early with confirmation from momentum and trend strength, while filtering out choppy conditions.
- Setup: Enable Fast MA (e.g., 9 EMA), Slow MA (e.g., 50 EMA), MACD, ADX, and Choppiness Index.
- Entry (Long):
- Price > Slow MA (Establishes broader uptrend context).
- Fast MA crosses above Slow MA OR Price crosses above Fast MA.
- MACD Histogram > 0 (Confirms bullish momentum).
- ADX > 20 or 25 (Indicates sufficient trend strength).
- Choppiness Index < 61.8 (Filters out excessively choppy markets). - Entry (Short): Reverse logic (except for ADX and Choppiness Index).
- Management: Consider using the Supertrend or an ATR multiple for stop-loss placement.
Image showing a chart with 2:1 long and short trades, highlighting a candle disqualified for a long entry due to ADX below 20.
2. Supertrend Breakout Strategy
- Goal: Use Supertrend for primary signals and stops, confirming with volume and trend strength.
- Setup: Enable Supertrend, Slow MA, ADX, and OBV.
- Entry (Long):
- Supertrend line turns green and price closes above it.
- Price > Slow MA (Optional filter for alignment with larger trend).
- ADX is rising or above 20 (Confirms trending conditions).
- OBV is generally rising or breaks a recent resistance level (Confirms volume supporting the move). - Entry (Short): Reverse logic (except for ADX and OBV).
- Management: Initial stop-loss placed just below the green Supertrend line (for longs) or above the red line (for shorts). Trail stop as Supertrend moves.
Image showing a chart with a 2:1 long trade, one candle disqualified for a short entry, and another disqualified for a long entry.
3. Trend Continuation Pullbacks
- Goal: Enter established trends during pullbacks to value areas defined by MAs or Supertrend.
- Setup: Enable Slow MA, Fast MA (or Supertrend), MACD, and ADX.
- Entry (Long):
- Price is consistently above the Slow MA (Strong uptrend established).
- ADX > 25 (Confirms strong trend).
- Price pulls back towards the Fast MA or the green Supertrend line.
- MACD Histogram was decreasing during the pullback but turns positive again OR MACD line crosses above Signal line near the MA/Supertrend level (Indicates momentum resuming). - Entry (Short): Reverse logic (except for ADX) during a confirmed downtrend.
- Management: Stop-loss below the recent swing low or the Slow MA/Supertrend level.
Image showing a chart with 2:1 long and short trades, where price pulls back to the fast MA and the MACD histogram changes color, indicating shifts in momentum during the pullbacks.
█ CONCLUSION
The Trend Following Bundle offers a powerful and flexible solution for traders focused on trend-based strategies. By consolidating essential indicators into one script with deep customization, multi-timeframe analysis, and built-in alerts, it simplifies the analytical workflow and allows for the development of robust, multi-conditional trading systems. Whether used for confirming entries, identifying trend strength, managing risk, or filtering market conditions, this bundle provides a versatile foundation for technical analysis.
█ IMPORTANT NOTES
⚠ Parameter Tuning: Indicator settings (lengths, factors, thresholds) are not one-size-fits-all. Adjust them based on the asset being traded, its typical volatility, and the timeframe you are analyzing for optimal performance. Backtesting is crucial.
⚠ Multi-Timeframe Use: Using the Timeframe input allows for powerful analysis but be mindful of potential lag, especially if Wait TF Close is disabled. Signals based on higher timeframes will update only when that higher timeframe bar closes (if Wait TF Close is enabled).
⚠ Confirmation is Key: While the bundle provides many tools, avoid relying on a single indicator's signal. Use combinations to build confluence and increase the probability of successful trades.
⚠ Chart Clarity: With many indicators available, only enable those relevant to your current strategy to avoid overwhelming your chart. Use the On/Off toggles frequently.
⚠ Confirmed Bars Only: Like most TradingView indicators, signals and plots are finalized on the close of the bar. Be cautious acting on intra-bar signals which may change before the bar closes.
█ RISK DISCLAIMER
Trading involves substantial risk of loss and is not suitable for every investor. The Trend Following Bundle indicator provides technical analysis tools for educational and informational purposes only; it does not constitute financial advice or a recommendation to buy or sell any asset. Indicator signals identify potential patterns based on historical data but do not guarantee future price movements or profitability. Always conduct your own thorough analysis, use multiple sources of information, and implement robust risk management practices before making any trading decisions. Past performance is not indicative of future results.
📊 Happy trading! 🚀
Script su invito
Solo gli utenti autorizzati dall'autore hanno accesso a questo script e ciò richiede solitamente un pagamento. Puoi aggiungere lo script ai tuoi preferiti, ma potrai utilizzarlo solo dopo aver richiesto l'autorizzazione e averla ottenuta dal suo autore - per saperne di più leggi qui. Per maggiori dettagli, segui le istruzioni dell'autore qui sotto o contatta direttamente ActiveQuants.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.
Declinazione di responsabilità
Script su invito
Solo gli utenti autorizzati dall'autore hanno accesso a questo script e ciò richiede solitamente un pagamento. Puoi aggiungere lo script ai tuoi preferiti, ma potrai utilizzarlo solo dopo aver richiesto l'autorizzazione e averla ottenuta dal suo autore - per saperne di più leggi qui. Per maggiori dettagli, segui le istruzioni dell'autore qui sotto o contatta direttamente ActiveQuants.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Attenzione: prima di richiedere l'accesso, leggi la nostra guida per gli script su invito.