Pivot Reversal Strategy - TimeFramedThis is Pivot Reversal Strategy including the time frames for backtesting.
Cerca negli script per "backtesting"
3 Duck's Trading System from Babypips.comThe 3 Duck's Trading System from Babypips.com
The 3 Duck's Trading System is the most popular and active trading system thread on the the babypips.com forum. It is a system that is mainly for beginners because it teaches you discipline, learning to cope with price moving against your position and learning to stay in a trade and keep profits running. For the thread and more info on the 3 Duck's Trading System click here
How does it work?
The system is a very simple enter/exit based on the 60 SMA of 3 different time frames: 4 hour, 1 hour and 5 minute.
The Rules, er, the Ducks! The Ducks must all be in a row for a trade to take place!
Duck 1 - To go long, price must be above the 60 SMA on the 4 hour chart.
Duck 2 - To go long, price must be above the 60 SMA on the 1 hour chart.
Duck 3 - To go long, price must cross above the 60 SMA on the 5 minute chart and the 60 SMA of the 5 minute chart must be below that of the 4 hour and 1 hour chart. (obviously the reverse for shorting)
YOU MUST USE THIS SYSTEM ONLY ON THE 5 MINUTE CHART.
I say this because I have already charted all of the Ducks into the 5 minute chart so you don't have to flip back and forth.
I have also added some inputs for profit targets, stop targets, trailing stops and times to trade for backtesting.
If you have any questions or comments, please let me know! If you see I messed up on something, please let me know!
Also a VERY special thanks to the babypips.com user Captain_Currency . He wrote this strategy 10 years ago (2007 was 10 years ago?!) and he is still active on the thread and posting results and offering help!
Adam Smith - MovingAvg CrossSimple Moving Average Cross script. Test on stocks and currency. For stocks test shorter time periods, meaning intra-day time periods such as 3min to 30min and so on to fit what is best. For currency, try longer periods with this model such as day to weeks depending on which currency.
NOTE: Take a look at your Max Drawdowns when testing. This will be the main indicator once you figure out your time period for backtesting. This will also let you know how much money to save and/or hold back in savings for down periods.
Trend v4.0 Another updateYet another update, default settings can be customized to your needs. Be aware that while this is similar to the other versions, this can only repaint an active bar, but that slows it down by one period. You are warned. Be that as it may, the basic idea is the same; trying to capture the really strong moves into overbought or oversold territory as defined by Relative Strength index. In RSI mode, you can see the smoothing has slowed it down a bit, but warrants backtesting.
First green bar go long, First red bar go short, first white bar possible trend exhaustion. Or use crossovers and such, play with the inputs OB/OS, RSI length, signal length, tick length, swing length, as I said customize to your tastes. I offer no surety as to its efficacy, but we all learn.
Trade Responsibly,
Shiroki
Improved MinhPhan EMA VWAP RSI StrategyThis enhanced Pine Script, "Improved MinhPhan EMA VWAP RSI Strategy," is a sophisticated trend-following system that combines EMA crossover, VWAP confirmation, and RSI filtering to increase trade precision. It’s ideal for traders who want high-probability entries filtered by both momentum and volume-based market positioning.
The strategy enters a long trade when the fast EMA crosses above the slow EMA, the price is above the VWAP, and RSI is below the overbought threshold, indicating early trend confirmation without being overextended. Conversely, it opens short trades when the fast EMA crosses below the slow EMA, price is under VWAP, and RSI is above the oversold level.
The script also features customizable stop loss and take profit levels in ticks (default: 100 SL, 200 TP) and uses RSI-based exits to cut trades when momentum becomes overbought/oversold. VWAP resets daily, weekly, or monthly depending on your preference, allowing better adaptability to market structure.
Visual cues for entry points (green/red triangles) and plotted indicators (EMA and VWAP) provide clarity for manual or semi-automated trading.
This strategy is well-suited for crypto, forex, or stock intraday and swing trading, offering both precision and flexibility for backtesting and optimization.
Golden & Death CrossThis indicator highlights Golden Cross and Death Cross signals based on customizable moving averages. It is ideal for swing traders and trend-following strategies across various timeframes.
🔍 Features:
Customizable moving average types: Choose between Simple Moving Average (SMA) and Exponential Moving Average (EMA)
Flexible MA lengths: Default 50/200, but can be adjusted to any short/long period (e.g., 9/21 for crypto)
Clear visual markers: Plots labels directly on the chart where crossovers occur
Alert support: Built-in alerts for Golden and Death Cross events
Overlay-enabled: MAs and signals display directly over price action
📈 Signal Logic:
Golden Cross = Short MA crosses above Long MA → bullish signal
Death Cross = Short MA crosses below Long MA → bearish signal
Common configurations:
50/200 EMA → Long-term trend shifts
9/21 EMA → Short-term momentum
🔔 Alerts:
You can create alerts using:
Golden Cross Alert: Triggers on bullish crossover
Death Cross Alert: Triggers on bearish crossover
✅ Use Cases:
Spot major trend shifts
Confirm entry/exit points with moving average dynamics
Combine with volume, RSI, or other filters for advanced strategies
Notes:
This is a basic yet powerful crossover tool. For more advanced filtering, trend confirmation, or backtesting logic, feel free to clone and expand it.
Questions or suggestions? Leave a comment or fork the script for your own use.
Triangle Breakout Strategy with TP/SL, EMA Filter📌 Triangle Breakout Strategy with TP/SL, EMA Filters, and Backtest – Explained.
✅ 1. Pattern Detection – Triangle Breakout
The script scans for triangle patterns by detecting local pivot highs and pivot lows.
It uses two recent highs and two recent lows to draw converging trendlines (upper and lower boundaries of the triangle).
If the price breaks above the upper trendline, a bullish breakout signal is generated.
🎯 2. TP (Take Profit) & SL (Stop Loss)
When a bullish breakout is detected:
A buy order is placed using strategy.entry.
TP and SL levels are calculated relative to the current close price:
TP = 3% above the entry price
SL = 1.5% below the entry price
These are defined using strategy.exit.
📊 3. EMA Filter
An optional filter checks if:
Price is above both EMA 20 and EMA 50
Only if this condition is met, the strategy allows a long entry.
You can toggle the filter on or off with useEMAFilter.
📈 4. Backtesting with Strategy Tester
This script uses strategy() instead of indicator() to enable TradingView’s built-in backtest engine.
Every buy entry and exit (based on TP or SL) is recorded.
📌 5. Visuals
EMA 20 and EMA 50 lines are plotted on the chart.
A label is shown when a breakout is detected: "Breakout Up"
Results (profit, win rate, drawdown, etc.) can be viewed in the Strategy Tester panel.
MinhPhan MA Crossover Strategy RSIThis Pine Script implements a trend-following strategy using a Moving Average Crossover combined with RSI-based exit conditions for optimal trade timing. Designed for short- to medium-term trading, the strategy enters a long position when the short-term EMA crosses above the long-term EMA, and a short position when it crosses below — a classic momentum signal. The default settings use a 9-period and 21-period EMA, but you can customize these values in the input panel.
To enhance risk management and trade timing, the script exits long positions when RSI exceeds 70 (indicating overbought conditions) and exits short positions when RSI drops below 30 (oversold), with fixed profit and loss targets of 200 and 100 points, respectively. This creates a balanced approach combining technical momentum with RSI reversal detection.
Additionally, the script includes commission modeling (0.1% default) to simulate real trading conditions more accurately. Visual aids like EMA9 and EMA21 overlays help traders validate signals visually.
Ideal for cryptocurrencies like BTC and SUI on any timeframe, this script allows for easy backtesting and optimization. It's a great starting point for traders looking to automate and refine a clean crossover-based strategy with proper risk control.
高點突破策略進場條件:突破前20根K棒的高點自動進場
出場條件:
停利:+3%
停損:-1.5%
適合時間週期: 可用於1小時或日線圖
適合標的:股票 期貨 加密貨幣 個股
如果要使用請自行回測找到最符合的標的
一律建議用模擬帳戶嘗試,沒問題過後再用真金白銀
Entry Condition:
Automatically enter a long position when the price breaks above the highest high of the past 20 candles.
Exit Conditions:
Take Profit: +3%
Stop Loss: -1.5%
Recommended Timeframes:
Suitable for 1-hour or daily charts.
Applicable Instruments:
Stocks, futures, cryptocurrencies, and individual equities.
Important:
Please perform your own backtesting to identify the most suitable assets.
We strongly recommend using a demo account first. Only trade with real money after confirming the strategy works well.
Volatility ML StrategyThis strategy uses proxy indicators for machine learning-predicted volatility and GARCH-based expected volatility. Trades are triggered when predicted volatility change exceeds threshold and market momentum confirms. Based on a fully engineered XGBoost + GARCH Python pipeline, adapted into Pine Script for backtesting and deployment on TradingView
Timeframe StrategyThis is a multi-timeframe trading strategy inspired by Ross Cameron's style, optimized for scalping and trend-following across various timeframes (1m, 5m, 15m, 1h, and 1D). The strategy integrates a comprehensive set of technical indicators, dynamic risk management, and visual tools.
Core Features
Dynamic Take Profit, Stop Loss & Trailing Stop
> Separate settings per timeframe for:
-TP% (Take Profit)
-SL% (Stop Loss)
-Trailing Stop %
-Cooldown bars
> Configurable via UI inputs.
>Smart Entry Conditions
Bullish entry: EMA9 crossover EMA20 and EMA50 > EMA200
Bearish entry: EMA9 crossunder EMA20 and EMA50 < EMA200
>Additional confirmation filters:
-Volume Filter (enabled/disabled via UI)
-Time Filter (e.g., only between 15:00–20:00 UTC)
-Spike Filter: rejects high-volatility candles
-RSI Filter: above/below 50 for trend confirmation
-ADX Filter (only applied on 1m, e.g., ADX > 15)
-Micro-Volatility Filter: minimum range percentage (1m only)
-Trend Filter (1m only): price must be above/below EMA200
>Trailing Stop Logic
-Configurable for each timeframe.
- Optional via toggle (use_trailing).
>Trade Cooldown Logic
-Prevents consecutive trades within X bars, configurable per timeframe.
>Technical Indicators Used
-EMA 9 / 20 / 50 / 200
-VWAP
-RSI (14)
-ATR (14) for volatility-based spike filtering
-Custom-calculated ADX (14) (manually implemented)
>Visual Elements
🔼/🔽 Entry signals (long/short) plotted on the chart.
📉 Table in bottom-left:
Displays current values of EMA/VWAP/volume/ATR/ADX.
> Optional "Tab info" panel in top-right (toggleable):
-Timeframe & strategy settings
-Live status of filters (volume, time, cooldown, spike, RSI, ADX, range, trend)
-Uses emoji (✅ / ❌) for quick diagnostics.
>User Customization
-Inputs per timeframe for all key parameters.
-Toggle switches for:
-Trailing stop
-Volume filter
-Info table visibility
This strategy is designed for active traders seeking a balance between momentum entry, risk control, and adaptability across timeframes. It's ideal for backtesting quick reversals or breakout setups in fast markets, especially at lower timeframes like 1m or 5m.
Reverse Keltner Channel StrategyReverse Keltner Channel Strategy
Overview
The Reverse Keltner Channel Strategy is a mean-reversion trading system that capitalizes on price movements between Keltner Channels. Unlike traditional Keltner Channel strategies that trade breakouts, this system takes the contrarian approach by entering positions when price returns to the channel after overextending.
Strategy Logic
Long Entry Conditions:
Price crosses above the lower Keltner Channel from below
This signals a potential reversal after an oversold condition
Position is entered at market price upon signal confirmation
Long Exit Conditions:
Take Profit: Price reaches the upper Keltner Channel
Stop Loss: Placed at half the channel width below entry price
Short Entry Conditions:
Price crosses below the upper Keltner Channel from above
This signals a potential reversal after an overbought condition
Position is entered at market price upon signal confirmation
Short Exit Conditions:
Take Profit: Price reaches the lower Keltner Channel
Stop Loss: Placed at half the channel width above entry price
Key Features
Mean Reversion Approach: Takes advantage of price tendency to return to mean after extreme moves
Adaptive Stop Loss: Stop loss dynamically adjusts based on market volatility via ATR
Visual Signals: Entry points clearly marked with directional triangles
Fully Customizable: All parameters can be adjusted to fit various market conditions
Customizable Parameters
Keltner EMA Length: Controls the responsiveness of the channel (default: 20)
ATR Multiplier: Determines channel width/sensitivity (default: 2.0)
ATR Length: Affects volatility calculation period (default: 10)
Stop Loss Factor: Adjusts risk management aggressiveness (default: 0.5)
Best Used On
This strategy performs well on:
Currency pairs with defined ranging behavior
Commodities that show cyclical price movements
Higher timeframes (4H, Daily) for more reliable signals
Markets with moderate volatility
Risk Management
The built-in stop loss mechanism automatically adjusts to market conditions by calculating position risk relative to the current channel width. This approach ensures that risk remains proportional to potential reward across varying market conditions.
Notes for Optimization
Consider adjusting the EMA length and ATR multiplier based on the specific asset and timeframe:
Lower values increase sensitivity and generate more signals
Higher values produce fewer but potentially more reliable signals
As with any trading strategy, thorough backtesting is recommended before live implementation.
Past performance is not indicative of future results. Always practice sound risk management.
Seekho roj kamao StrategyThe "Seekho Roj Kamao Strategy" is a powerful backtesting tool designed to identify high-probability trend continuation setups. It combines RSI, Chande Momentum Oscillator (CMO), and adaptive ATR-based trailing stop logic to detect precise entry points and manage risk through automated take profit (1R, 2R, 3R) and stop loss levels. This strategy dynamically evaluates trend direction shifts using price action and momentum divergence, enabling traders to test robust trading scenarios with clearly defined exits. Ideal for forex, crypto, and stock traders, it allows full customization of sensitivity and volatility filters, making it suitable for both intraday and swing trading approaches.
Bollinger + EMA Strategy with StatsThis strategy is a mean-reversion trading model that combines Bollinger Band deviation entries with EMA-based exits. It enters a long position when the price drops significantly below the lower Bollinger Band by a user-defined multiple of standard deviation (x), and a short position when the price exceeds the upper band by the same logic. To manage risk, it uses a wider Bollinger Band threshold (y standard deviations) as a stop loss, while take profit occurs when the price reverts to the n-period EMA, indicating mean reversion. The strategy maintains only one active position at a time—either long or short—and allocates a fixed percentage of capital per trade. Performance metrics such as equity curve, drawdown, win rate, and total trades are tracked and displayed for backtesting evaluation.
[blackcat] L1 Dynamic EdgeOVERVIEW
📈 The L1 Dynamic Edge is a sophisticated trend-following indicator designed to empower traders with a comprehensive view of market dynamics and precise buy/sell signals. By leveraging multiple Exponential Moving Averages (EMAs) and advanced signal processing, this indicator aims to capture the essence of price momentum and provide actionable insights across various financial instruments and timeframes.
🔑 Key Features:
Fully customizable EMA settings
Multi-dimensional trend analysis using high, low, and midpoint EMAs
Intuitive color-coded trend visualization
Accurate buy/sell signals with visual confirmation
Flexible alert system for real-time notifications
Seamless integration with TradingView's charting tools
FEATURES
📉 Advanced Trend Detection:
Utilizes three distinct EMAs (high, low, and midpoint) for a holistic view of market trends
Employs sophisticated logic to determine rising and falling trends
🌟 Dynamic Visualization:
Automatically adjusts the color of EMA plots based on detected trend direction
Fills the area between high and low EMAs for enhanced visual clarity
📈 Precision Signal Generation:
Identifies potential trend reversals using a combination of price action and EMA behavior
Generates clear buy/sell signals based on trend changes
📊 Comprehensive Chart Integration:
Displays buy/sell signals as easily identifiable shapes on the chart
Adds descriptive labels to signal bars for quick reference
🔔 Customizable Alert System:
Provides alert conditions for both buy and sell signals
Allows users to stay informed about potential trading opportunities even when away from the chart
🛠️ User-Friendly Interface:
Simple input parameters for easy customization
Clean and uncluttered chart appearance without overwhelming the user
🌐 Versatile Application:
Adaptable to various financial instruments, including stocks, forex, commodities, and cryptocurrencies
Effective across different timeframes, from short-term scalping to long-term investing
HOW TO USE
✨ Adding the Indicator:
Open your TradingView chart
Click on "Add Indicator" at the top of the screen
Search for " L1 Dynamic Edge" and add it to your chart
🔧 Customizing Settings:
Adjust the EMA length in the input panel to suit your trading style and preferences
Experiment with different values to find what works best for your specific strategy
🕵️♂️ Analyzing Trends:
Observe the color of the EMA bands to quickly assess the overall market sentiment
Note how the filling between the high and low EMAs responds to price movements
📈 Identifying Opportunities:
Watch for buy/sell signals indicated by triangles and labels on the chart
Consider these signals as potential entry/exit points for your trades
🎯 Implementing Strategies:
Combine the indicator's signals with your own analysis and risk management techniques
Use the provided alerts to stay informed about new trading opportunities
🚨 Setting Up Alerts:
Configure alert conditions for buy and sell signals
Choose your preferred notification method (email, SMS, push notifications, etc. )
📊 Fine-Tuning Your Approach:
Regularly review and analyze the indicator's performance
Adjust the EMA length and other parameters as needed to adapt to changing market conditions
LIMITATIONS
Like any technical indicator, the L1 Dynamic Edge should not be used as a standalone trading system
Its effectiveness may be limited during periods of extreme volatility or in highly ranging markets
The indicator's performance will vary depending on the specific instrument and timeframe being analyzed
New traders might need some time to fully understand and effectively utilize all features of the indicator
NOTES
This script utilizes Pine Script version 5 for optimal performance and compatibility with TradingView's latest features
The default EMA length is set to 3, which provides a balance between responsiveness and noise reduction
The indicator's color scheme has been carefully chosen to ensure maximum visibility while maintaining a clean chart appearance
For best results, consider combining this indicator with other forms of technical and fundamental analysis
Regular backtesting and forward testing are crucial to optimize the indicator's settings for your specific trading style and market conditions
THANKS
We extend our deepest gratitude to the vibrant TradingView community for their invaluable feedback, suggestions, and support throughout the development process of the L1 Dynamic Edge indicator. Special thanks to all the dedicated traders who took the time to test and refine this tool, helping us create a more robust and user-friendly experience for everyone.
Dirección de Sesión Diaria (Fija)This Script shows the daily direction the market may be heading to look for opportunities based on the direction marked. Currently I use this indicator to check the daily direction and it is very effective. if you are going to use this indicator go by the direction from 15m forward apart before using it do your own backtesting to adapt this indicator to your trading plans. any suggestions you can let me know to improve this script :)
Multi-Indicator Swing [TIAMATCRYPTO]This strategy uses a combination of seven powerful technical indicators to identify potential buy and sell signals for swing trading. By requiring confirmation from multiple indicators, the strategy aims to filter out false signals and capture meaningful price movements.
Indicators Used
EMA Crossover - Fast and slow exponential moving averages to identify trend direction
MACD - Momentum indicator showing the relationship between two moving averages
RSI - Measures speed and change of price movements to identify overbought/oversold conditions
Parabolic SAR - Identifies potential reversal points in price movement
Supertrend - Combines trend and volatility to generate clear buy/sell signals
ADX - Measures trend strength to filter out low-conviction signals
Liquidity Delta - Analyzes bid/ask volume imbalances to detect potential market direction
Usage Recommendations
Timeframe Selection: This strategy works best on 1-hour to daily timeframes for swing trading
Market Application: Most effective in trending markets with clear directional bias
Optimization: Test different indicator combinations to find what works best for specific markets
Risk Management: Consider adding stop-loss and take-profit levels based on your risk tolerance
Notes
The strategy uses a clean interface that displays only buy/sell signals for clearer chart analysis
An information panel shows active indicators and testing period
All calculations are performed even for disabled indicators but they won't affect signal generation
The backtesting period can be adjusted according to your analysis needs
This multi-indicator approach to swing trading aims to provide high-quality signals by requiring confirmation from multiple technical perspectives, potentially reducing false signals and improving overall trading results.
Wyckoff Advanced Swing Strategy by TIAMATCRYPTOStrategy Overview
This custom TradingView strategy combines four powerful trading methodologies - Wyckoff Market Cycles, Price Map Profiling, Mean Reversion, and Trend Following - into a comprehensive swing trading system. It provides extensive customization options and can be tailored for medium to long-term trading positions.
Key Components
1. Wyckoff Analysis
This component focuses on identifying market cycle phases as described by Richard D. Wyckoff:
Accumulation Phase: Identifies periods of smart money accumulation with above-average volume and falling price highs
Markup Phase: Detects strong uptrends with increasing prices supported by volume
Distribution Phase: Recognizes when smart money begins to distribute positions near market tops
Markdown Phase: Identifies downtrends when institutional investors are exiting positions
Special Formations: Detects "spring" patterns (false breakdowns followed by rapid reversals) and "upthrust" patterns (false breakouts)
2. Price Map Profile
Implements a simplified version of Market Profile / Volume Profile concepts:
Calculates Point of Control (POC) - the price level with the highest theoretical activity
Defines Value Area High (VAH) and Value Area Low (VAL) to establish the range where most price action occurs
Visual representation of these key levels to identify potential support and resistance zones
3. Mean Reversion
Identifies potential reversal points when price moves to extremes:
Uses Bollinger Bands to define overbought and oversold price zones
Incorporates RSI divergence to confirm potential reversals
Requires multiple confirmation signals to avoid false entries in strong trends
Employs pattern recognition for higher probability mean reversion trade setups
4. Trend Following
Captures medium to long-term directional price movements:
Utilizes multiple moving averages (9, 21, 50, 200 EMAs) to confirm trend direction and strength
MACD analysis for momentum confirmation and trend intensity
Higher timeframe trend alignment through recent price structure analysis
Requires clear higher highs/higher lows (or lower highs/lower lows) for trade confirmation
Advanced Features
Risk Management
Optional automatic Take Profit and Stop Loss based on ATR (Average True Range)
Trailing stop functionality that adjusts to market volatility
Position sizing as a percentage of equity for proper risk management
Multiple exit strategies based on time, price, or indicator signals
Time-Based Filters
Customizable date range for backtesting historical performance
Trading day filters to avoid entering positions on less favorable days (Fridays/Mondays)
Minimum and maximum holding periods to match swing trading timeframes
Smart exit timing based on market conditions and holding duration
Signal Optimization
Combined signal approach requiring confirmation from multiple systems
Candlestick pattern analysis for enhanced entry timing
RSI-based position exit rules to capture profits at overbought/oversold conditions
Advanced filtering to reduce false signals and avoid low-probability setups
Practical Applications
This strategy is designed for swing traders who:
Hold positions for several days to weeks
Prefer to analyze multiple factors before entering trades
Want to align with institutional money flow through Wyckoff principles
Seek a balance between trend-following and reversal opportunities
Require flexible risk management options
The system works best on daily timeframes for equities, forex, commodities, and cryptocurrency markets with sufficient liquidity. It can be used as a standalone trading system or as a confirmation tool alongside other analysis methods.
Strategy Parameters
All major components can be enabled or disabled independently:
Wyckoff Analysis
Price Map Profiling
Mean Reversion
Trend Following
Risk parameters, timeframes, and technical indicators can be extensively customized to match individual trading preferences, market conditions, and risk tolerance.
Multi-Day VWAP, current session only)Variation on multi day vwap, where you can choose to display 1, 2 and 3 day vwap, but only plot the current session. So each session has all 3 plots. This is especially useful for backtesting purposes. St. deviation bands included as usual.
EMA Crossover BackgroundWhen the chart closes above or below the EMA, the background color changes.
"Useful if you want to trade in the trend direction but don't always want to look at the EMA. For example, in an aggressive up or down trend, the EMA is far away on lower time frames, but you can instantly see if it’s above or below, which makes backtesting easier too."
MA Crossover Crossunder Strategy [UOI]Simple MA Crossover Crossunder Strategy Tester
📌 Purpose:
This strategy is designed to backtest and automate entries and exits based on the crossover and crossunder of two configurable moving averages. It provides traders with flexibility in selecting the moving average type and length to adapt the system to various market conditions and asset classes. To see the win ratio of each strategy (different length and different MA type) click on Strategy tester below the chart (at the bottom of the page).
🟦 Does it work?
Short answer: No — not on its own.
Unless you have a solid understanding of volume and price action, and you implement effective stop-loss and take-profit rules, the win ratio is typically poor for automated trading. However, incorporating other market dynamics can help improve the strategy's performance.
⚙️ Core Features:
🟦 User-Defined Inputs:
shortLength: Length for the short-term moving average (default: 10)
longLength: Length for the long-term moving average (default: 50)
maType: Type of moving average to apply (options include: "SMA", "EMA", "WMA", "VWMA", "RMA", "HMA")
🧮 Moving Average Function (ma):
The strategy includes a custom ma() function that dynamically computes the moving average of the selected type:
SMA (Simple Moving Average)
EMA (Exponential Moving Average)
WMA (Weighted Moving Average)
VWMA (Volume-Weighted Moving Average)
RMA (Running Moving Average / SMMA)
HMA (Hull Moving Average): Calculated using the WMA of a de-trended intermediate series with a square root length for faster response and reduced lag.
This design allows users to test multiple MA methodologies without rewriting code.
🟧 Entry & Exit Logic:
✅ Long Entry:
Triggered when the short-term MA crosses above the long-term MA (ta.crossover()).
Any existing short positions are closed immediately.
❌ Short Entry:
Triggered when the short-term MA crosses below the long-term MA (ta.crossunder()).
Any existing long positions are closed immediately.
This structure ensures that only one active position (long or short) is held at any given time, making the strategy fully reversible and directional.
📊 Visual Representation:
Both MAs are plotted on the chart for visual confirmation.
Short MA: Blue
Long MA: Orange
The chart overlays allow for easy manual verification of signal points and trend alignment.
📈 Execution Parameters:
The strategy uses strategy.percent_of_equity for position sizing, set to 100% of account equity per trade.
Works on any timeframe — users can switch chart resolution for different backtesting horizons (scalping to swing trading).
For instance Try VWMA 10 over 50 with SPX on 30 and 45 minutes time frame and you will see great results. But if you try that with SPY you will get different win ratio.
❌ Do you recommend using a moving average crossover strategy?
❌ No — I use it only as confirmation alongside other indicators.
❌ Only traders with contextual knowledge of price action and volume analysis should use MA strategies.
[blackcat] L2 MTF Heikin-Ashi SR LevelsOVERVIEW
The L2 MTF Heikin-Ashi SR Levels indicator is a sophisticated tool designed to help traders identify critical support and resistance levels across multiple timeframes. This script employs Heikin-Ashi candles, which provide a smoothed representation of price action, making it easier to spot trends and reversals. By integrating multi-timeframe analysis, this indicator offers a comprehensive view of market dynamics, enabling traders to make more informed decisions 📊✅.
This indicator not only calculates essential support and resistance levels but also visually represents them on the chart with gradient colors based on Relative Strength Index (RSI) values. Additionally, it features customizable alerts and labels to enhance user experience and ensure timely execution of trades.
FEATURES
Advanced Trend Identification:
Uses Heikin-Ashi candles for smoother price action analysis.
Helps filter out noise and focus on significant trends.
Ideal for both short-term and long-term trading strategies.
Multi-Timeframe Analysis:
Allows users to select different resolutions for deeper insights.
Ensures compatibility with various trading styles and preferences.
Comprehensive Support and Resistance Calculation:
Computes four distinct levels: Support Level 1, Support Level 2, Resistance Level 1, and Resistance Level 2.
Each level serves as a reference point for potential price reversals or continuations.
Gradient Color Visualization:
Employs a spectrum of colors derived from RSI values to represent support and resistance lines.
Enhances readability and helps traders quickly assess market sentiment 🎨.
Dynamic Labels and Alerts:
Automatically generates buy ('Buy') and sell ('Sell') labels when price crosses key levels.
Provides real-time alerts for crossing events, ensuring traders never miss important signals 🔔.
Customizable Parameters:
Offers adjustable Length and Resolution inputs for tailored performance.
Allows traders to fine-tune the indicator according to their unique needs and strategies.
HOW TO USE
Adding the Indicator:
Open your TradingView chart and navigate to the indicators list.
Search for ' L2 MTF Heikin-Ashi SR Levels' and add it to your chart.
Configuring Settings:
Adjust the Length parameter to determine the period over which calculations are made.
A shorter length increases sensitivity, while a longer length smoothens the output.
Choose a specific Resolution to analyze different timeframes simultaneously.
For example, set it to 'D' for daily charts or 'W' for weekly charts.
Interpreting the Chart:
Observe the plotted support and resistance lines on the chart.
Look for price interactions with these levels to identify potential entry and exit points.
Pay attention to the gradient colors, which reflect underlying market momentum.
Setting Up Alerts:
Configure alerts based on the generated signals to receive instant notifications.
Customize alert messages and conditions to suit your trading plan.
Utilizing Labels:
Use the automatically placed buy and sell labels as quick references for decision-making.
Combine these labels with other technical analyses for confirmation.
Backtesting and Optimization:
Thoroughly test the indicator on historical data to evaluate its performance.
Optimize settings and refine your strategy based on backtest results.
Live Trading:
Apply the indicator to live charts and monitor real-time price movements.
Execute trades based on the generated signals and adjust positions accordingly.
Combining with Other Tools:
Integrate this indicator with other technical tools and fundamental analyses for a holistic approach.
Consider using moving averages, oscillators, or volume indicators alongside L2 MTF Heikin-Ashi SR Levels.
LIMITATIONS
Market Volatility:
In highly volatile or ranging markets, the indicator might produce false signals due to erratic price movements 🌪️.
Traders should exercise caution during such periods and consider additional confirmations.
Timeframe Dependency:
The effectiveness of the indicator can vary significantly depending on the chosen timeframe and asset.
Always validate the indicator's performance across different contexts before relying solely on it.
Over-reliance Risk:
While powerful, no single indicator guarantees success in all market conditions.
Combining this tool with other analytical methods enhances reliability and reduces risk.
NOTES
Data Requirements:
Ensure your chart has enough historical data to perform accurate calculations.
Insufficient data may lead to inaccurate or incomplete results.
Demo Testing:
Before deploying the indicator in live trading, conduct extensive testing on demo accounts.
Familiarize yourself with how the indicator behaves under various market scenarios.
Parameter Tuning:
Experiment with different Length and Resolution settings to find what works best for your trading style.
Regularly review and update parameters as market conditions evolve.
Continuous Learning:
Stay updated with the latest developments in technical analysis and trading strategies.
Adapt your use of the indicator based on new insights and experiences.
THANKS
Additionally, gratitude goes to the broader TradingView community for fostering collaboration and knowledge-sharing among traders worldwide. Together, we strive to elevate our understanding and application of financial markets 🌍💡.
[blackcat] L3 Trend BoxOVERVIEW
The L3 Trend Box indicator is a sophisticated technical analysis tool designed to assist traders in identifying trends and pinpointing potential entry and exit points within the market. By leveraging multiple moving averages and price level analyses, this indicator provides a detailed view of market dynamics. It plots several key lines and labels directly onto the chart, offering clear visual signals for both bullish and bearish scenarios. Its adaptability through customizable parameters makes it suitable for various trading strategies and market conditions 📊✅.
FEATURES
Comprehensive Parameter Customization: Tailor the indicator to match specific trading preferences:
High Length: Defines the period over which the highest prices are considered.
Low Length: Specifies the period for evaluating the lowest prices.
Upper Box Length: Smoothes out the upper boundary of the trend box using a specified period.
Lower Box Length: Smoothes out the lower boundary of the trend box similarly.
Trend Line Length: Determines the period for calculating the overall trend line.
Fast EMA Length: Sets the period for the fast-moving exponential moving average (EMA), crucial for capturing short-term movements.
MA15 EMA Length: Configures the period for the medium-term moving average (MA15 EMA) to provide a balanced perspective.
Short Spirit Length: Influences how quickly the indicator responds to recent price changes.
Golden EMA Length: Fine-tunes the long-term EMA for stability and reliability.
Buy Price Length: Establishes the lookback period for determining optimal buy prices.
Var1 Length & Var2 Length: Adjusts periods for variance calculations, enhancing the accuracy of trend detection.
Detailed Chart Plots:
Upper Box Top: A fuchsia-colored line representing the smoothed highest prices, marking resistance levels.
Lower Box Bottom: A green-colored line showing the smoothed lowest prices, highlighting support zones.
MA15 Up/Down: Dynamic red and green lines illustrating the directionality of the 15-period EMA, helping gauge momentum shifts.
Conditional Plots: Multiple lines based on intricate price actions and computed values, such as closing below the lower box while also closing at or above/below the opening price, ensuring nuanced insights into market behavior.
Buy/Sell Labels: Clearly marked 'Buy' and 'Sell' labels positioned strategically on the chart, facilitating quick decision-making without missing critical signals 🎯.
Alert System: Automatically generates alerts based on predefined buy and sell conditions, enabling timely responses to market changes 🛎️.
HOW TO USE
Adding the Indicator: Start by adding the L3 Trend Box to your TradingView chart via the indicators menu.
Parameter Configuration: Adjust each parameter according to your trading style and market volatility. For instance, increasing the High Length can make the indicator less sensitive to minor fluctuations but more responsive to significant trends.
Monitoring Signals: Keep an eye on the plotted lines and labels. Pay special attention to the crossover events between the fast EMA and the lower box bottom, as these often signify strong buy signals.
Setting Alerts: Configure alerts based on the buy/sell conditions provided by the indicator. This ensures you never miss an opportunity due to inattention.
Combining Strategies: While powerful on its own, combining this indicator with others like RSI or Bollinger Bands can enhance its predictive power and reduce false positives.
LIMITATIONS
Market Volatility: In extremely volatile or sideways-trending markets, the indicator might produce false signals. Always verify with additional confirmations.
Asset-Specific Performance: Different assets and timeframes will yield varying results; thorough backtesting across diverse instruments is recommended.
Over-Reliance Risk: Avoid relying solely on this indicator. Integrate it into a broader analytical framework that includes fundamental analysis and other technical indicators.
NOTES
Data Sufficiency: Ensure ample historical data is available for precise computations. Lack of data can skew results and lead to inaccurate signals.
Demo Testing: Before deploying the indicator in real trades, rigorously test it on demo accounts under varied market conditions to understand its strengths and weaknesses.
Customization Flexibility: Feel free to tweak the parameters continuously until they align perfectly with your unique trading approach and risk tolerance.