Dynamic RSI Mean Reversion StrategyDynamic RSI Mean Reversion Strategy
Overview:
This strategy uses an RSI with ATR-Adjusted OB/OS levels in order to enhance the quality of it's mean reversion trades. It also incorporates a form of trend filtering in an effort to minimize downside and maximize upside. The backtest has fewer trades, as it uses substantial filtering to enhance trade quality. As you can see, I didn't cherry pick the results, so the results aren't the most beautiful thing you'll see in your life. I did this to ensure nobody gets misled. If you need a higher frequency of trades, consider removing the trend filter or increasing the length of the EMAs used for trend detection.
Features:
Dynamic OB/OS Levels: Uses ATR to adjust overbought and oversold thresholds dynamically, making the RSI more responsive in varying volatility conditions. This approach enhances signal strength by expanding the RSI range in high volatility and tightening it in low volatility.
Mean Reversion Focus: Designed for mean reversion but incorporates a trend-following filter to reduce countertrend trades. When the RSI is high, it often indicates an uptrend, so a trend filter prevents shorting in these cases and the same goes for downtrends and longing.
Trend Filtering: A moving average cross trend filter checks for the trend direction, with the RSI signal line color-coded to reflect trend shifts. Entries occur when the RSI crosses above or below the dynamic thresholds and is not a countertrend trade.
Stop Losses: Stop losses are set based on ATR distance from the entry price, providing volatility-adjusted protection.
Note:
If you're using this strategy on assets with a higher price, remember to increase the initial capital in the strategy settings. Otherwise, the strategy won't generate any (or many) trades and you'll end up with some inaccurate results.
Recommended Use:
Test it on different assets and timeframes. I’ve found the best results with standard RSI inputs, a relatively slow ATR, and a slower MA cross for trend filtering. Thus, the defaults are set that way. If the trend metrics are too slow, you’ll filter out too many good trades while allowing crummy ones; if too fast, most trades may be filtered out. As always, this has a lot of configurability so experiment to find the balance that works for your trading style.
오실레이터
Trade Moments MA's + DPO + MACD StrategyExplanation of Key Components
Zero-Lag Moving Average (ZLMA): Uses an EMA-based approach to reduce lag.
EMA & SMA: Classic moving averages for trend confirmation.
DPO: Detrends the price, helping to see cyclical movement in the data.
Impulse MACD: Difference between the MACD line and signal line for momentum tracking.
Trade Logic:
Buy Signal: ZLMA crossing above SMA with a positive Impulse MACD.
Sell Signal: ZLMA crossing below EMA with a negative Impulse MACD.
This strategy provides visual buy/sell signals on the chart with customizable moving average lengths, which you can adjust as needed to optimize your trading approach.
CCI Threshold StrategyThe CCI Threshold Strategy is a trading approach that utilizes the Commodity Channel Index (CCI) as a momentum indicator to identify potential buy and sell signals in financial markets. The CCI is particularly effective in detecting overbought and oversold conditions, providing traders with insights into possible price reversals. This strategy is designed for use in various financial instruments, including stocks, commodities, and forex, and aims to capitalize on price movements driven by market sentiment.
Commodity Channel Index (CCI)
The CCI was developed by Donald Lambert in the 1980s and is primarily used to measure the deviation of a security's price from its average price over a specified period.
The formula for CCI is as follows:
CCI=(TypicalPrice−SMA)×0.015MeanDeviation
CCI=MeanDeviation(TypicalPrice−SMA)×0.015
where:
Typical Price = (High + Low + Close) / 3
SMA = Simple Moving Average of the Typical Price
Mean Deviation = Average of the absolute deviations from the SMA
The CCI oscillates around a zero line, with values above +100 indicating overbought conditions and values below -100 indicating oversold conditions (Lambert, 1980).
Strategy Logic
The CCI Threshold Strategy operates on the following principles:
Input Parameters:
Lookback Period: The number of periods used to calculate the CCI. A common choice is 9, as it balances responsiveness and noise.
Buy Threshold: Typically set at -90, indicating a potential oversold condition where a price reversal is likely.
Stop Loss and Take Profit: The strategy allows for risk management through customizable stop loss and take profit points.
Entry Conditions:
A long position is initiated when the CCI falls below the buy threshold of -90, indicating potential oversold levels. This condition suggests that the asset may be undervalued and due for a price increase.
Exit Conditions:
The long position is closed when the closing price exceeds the highest price of the previous day, indicating a bullish reversal. Additionally, if the stop loss or take profit thresholds are hit, the position will be exited accordingly.
Risk Management:
The strategy incorporates optional stop loss and take profit mechanisms, which can be toggled on or off based on trader preference. This allows for flexibility in risk management, aligning with individual risk tolerances and trading styles.
Benefits of the CCI Threshold Strategy
Flexibility: The CCI Threshold Strategy can be applied across different asset classes, making it versatile for various market conditions.
Objective Signals: The use of quantitative thresholds for entry and exit reduces emotional bias in trading decisions (Tversky & Kahneman, 1974).
Enhanced Risk Management: By allowing traders to set stop loss and take profit levels, the strategy aids in preserving capital and managing risk effectively.
Limitations
Market Noise: The CCI can produce false signals, especially in highly volatile markets, leading to potential losses (Bollinger, 2001).
Lagging Indicator: As a lagging indicator, the CCI may not always capture rapid market movements, resulting in missed opportunities (Pring, 2002).
Conclusion
The CCI Threshold Strategy offers a systematic approach to trading based on well-established momentum principles. By focusing on overbought and oversold conditions, traders can make informed decisions while managing risk effectively. As with any trading strategy, it is crucial to backtest the approach and adapt it to individual trading styles and market conditions.
References
Bollinger, J. (2001). Bollinger on Bollinger Bands. New York: McGraw-Hill.
Lambert, D. (1980). Commodity Channel Index. Technical Analysis of Stocks & Commodities, 2, 3-5.
Pring, M. J. (2002). Technical Analysis Explained. New York: McGraw-Hill.
Tversky, A., & Kahneman, D. (1974). Judgment under uncertainty: Heuristics and biases. Science, 185(4157), 1124-1131.
Z-Score RSI StrategyOverview
The Z-Score RSI Indicator is an experimental take on momentum analysis. By applying the Relative Strength Index (RSI) to a Z-score of price data, it measures how far prices deviate from their mean, scaled by standard deviation. This isn’t your traditional use of RSI, which is typically based on price data alone. Nevertheless, this unconventional approach can yield unique insights into market trends and potential reversals.
Theory and Interpretation
The RSI calculates the balance between average gains and losses over a set period, outputting values from 0 to 100. Typically, people look at the overbought or oversold levels to identify momentum extremes that might be likely to lead to a reversal. However, I’ve often found that RSI can be effective for trend-following when observing the crossover of its moving average with the midline or the crossover of the RSI with its own moving average. These crossovers can provide useful trend signals in various market conditions.
By combining RSI with a Z-score of price, this indicator estimates the relative strength of the price’s distance from its mean. Positive Z-score trends may signal a potential for higher-than-average prices in the near future (scaled by the standard deviation), while negative trends suggest the opposite. Essentially, when the Z-Score RSI indicates a trend, it reflects that the Z-score (the distance between the average and current price) is likely to continue moving in the trend’s direction. Generally, this signals a potential price movement, though it’s important to note that this could also occur if there’s a shift in the mean or standard deviation, rather than a meaningful change in price itself.
While the Z-Score RSI could be an insightful addition to a comprehensive trading system, it should be interpreted carefully. Mean shifts may validate the indicator’s predictions without necessarily indicating any notable price change, meaning it’s best used in tandem with other indicators or strategies.
Recommendations
Before putting this indicator to use, conduct thorough backtesting and avoid overfitting. The added parameters allow fine-tuning to fit various assets, but be careful not to optimize purely for the highest historical returns. Doing so may create an overly tailored strategy that performs well in backtests but fails in live markets. Keep it balanced and look for robust performance across multiple scenarios, as overfitting is likely to lead to disappointing real-world results.
XAUUSD 10-Minute StrategyThis XAUUSD 10-Minute Strategy is designed for trading Gold vs. USD on a 10-minute timeframe. By combining multiple technical indicators (MACD, RSI, Bollinger Bands, and ATR), the strategy effectively captures both trend-following and reversal opportunities, with adaptive risk management for varying market volatility. This approach balances high-probability entries with robust volatility management, making it suitable for traders seeking to optimise entries during significant price movements and reversals.
Key Components and Logic:
MACD (12, 26, 9):
Generates buy signals on MACD Line crossovers above the Signal Line and sell signals on crossovers below the Signal Line, helping to capture momentum shifts.
RSI (14):
Utilizes oversold (below 35) and overbought (above 65) levels as a secondary filter to validate entries and avoid overextended price zones.
Bollinger Bands (20, 2):
Uses upper and lower Bollinger Bands to identify potential overbought and oversold conditions, aiming to enter long trades near the lower band and short trades near the upper band.
ATR-Based Stop Loss and Take Profit:
Stop Loss and Take Profit levels are dynamically set as multiples of ATR (3x for stop loss, 5x for take profit), ensuring flexibility with market volatility to optimise exit points.
Entry & Exit Conditions:
Buy Entry: T riggered when any of the following conditions are met:
MACD Line crosses above the Signal Line
RSI is oversold
Price drops below the lower Bollinger Band
Sell Entry: Triggered when any of the following conditions are met:
MACD Line crosses below the Signal Line
RSI is overbought
Price moves above the upper Bollinger Band
Exit Strategy: Trades are closed based on opposing entry signals, with adaptive spread adjustments for realistic exit points.
Backtesting Configuration & Results:
Backtesting Period: July 21, 2024, to October 30, 2024
Symbol Info: XAUUSD, 10-minute timeframe, OANDA data source
Backtesting Capital: Initial capital of $700, with each trade set to 10 contracts (equivalent to approximately 0.1 lots based on the broker’s contract size for gold).
Users should confirm their broker's contract size for gold, as this may differ. This script uses 10 contracts for backtesting purposes, aligned with 0.1 lots on brokers offering a 100-contract specification.
Key Backtesting Performance Metrics:
Net Profit: $4,733.90 USD (676.27% increase)
Total Closed Trades: 526
Win Rate: 53.99%
Profit Factor: 1.44 (1.96 for Long trades, 1.14 for Short trades)
Max Drawdown: $819.75 USD (56.33% of equity)
Sharpe Ratio: 1.726
Average Trade: $9.00 USD (0.04% of equity per trade)
This backtest reflects realistic conditions, with a spread adjustment of 38 points and no slippage or commission applied. The settings aim to simulate typical retail trading conditions. However, please adjust the initial capital, contract size, and other settings based on your account specifics for best results.
Usage:
This strategy is tuned specifically for XAUUSD on a 10-minute timeframe, ideal for both trend-following and reversal trades. The ATR-based stop loss and take profit levels adapt dynamically to market volatility, optimising entries and exits in varied conditions. To backtest this script accurately, ensure your broker’s contract specifications for gold align with the parameters used in this strategy.
DSL Strategy [DailyPanda]
Overview
The DSL Strategy by DailyPanda is a trading strategy that synergistically combines the idea from indicators to create a more robust and reliable trading tool. By integrating these indicators, the strategy enhances signal accuracy and provides traders with a comprehensive view of market trends and momentum shifts. This combination allows for better entry and exit points, improved risk management, and adaptability to various market conditions.
Combining ideas from indicators adds value by:
Enhancing Signal Confirmation : The strategy requires alignment between trend and momentum before generating trade signals, reducing false entries.
Improving Accuracy : By integrating price action with momentum analysis, the strategy captures more reliable trading opportunities.
Providing Comprehensive Market Insight : The combination offers a better perspective on the market, considering both the direction (trend) and the strength (momentum) of price movements.
How the Components Work Together
1. Trend Identification with DSL Indicator
Dynamic Signal Lines : Calculates upper and lower DSL lines based on a moving average (SMA) and dynamic thresholds derived from recent highs and lows with a specified offset. These lines adapt to market conditions, providing real-time trend insights.
ATR-Based Bands : Adds bands around the DSL lines using the Average True Range (ATR) multiplied by a width factor. These bands account for market volatility and help identify potential stop-loss levels.
Trend Confirmation : The relationship between the price, DSL lines, and bands determines the current trend. For example, if the price consistently stays above the upper DSL line, it indicates a bullish trend.
2. Momentum Analysis
RSI Calculation : Computes the RSI over a specified period to measure the speed and change of price movements.
Zero-Lag EMA (ZLEMA) : Applies a ZLEMA to the RSI to minimize lag and produce a more responsive oscillator.
DSL Application on Oscillator : Implements the DSL concept on the oscillator by calculating dynamic upper and lower levels. This helps identify overbought or oversold conditions more accurately.
Signal Generation : Detects crossovers between the oscillator and its DSL lines. A crossover above the lower DSL line signals potential bullish momentum, while a crossover below the upper DSL line signals potential bearish momentum.
3. Integrated Signal Filtering
Confluence Requirement : A trade signal is generated only when both the DSL indicator and oscillator agree. For instance, a long entry requires both an uptrend confirmation from the DSL indicator and a bullish momentum signal from the oscillator.
Risk Management Integration : The strategy uses the DSL indicator's bands for setting stop-loss levels and calculates take-profit levels based on a user-defined risk-reward ratio. This ensures that every trade has a predefined risk management plan.
--------------------------------------------------------------------------------------------
Originality and Value Added to the Community
Unique Synergy : While both indicators are available individually, this strategy is original in how it combines them to enhance their strengths and mitigate their weaknesses, offering a novel approach not present in existing scripts.
Enhanced Reliability : By requiring confirmation from both trend and momentum indicators, the strategy reduces false signals and increases the likelihood of successful trades.
Versatility : The customizable parameters allow traders to adapt the strategy to different instruments, timeframes, and trading styles, making it a valuable tool for a wide range of trading scenarios.
Educational Contribution : The script demonstrates an effective method of combining indicators for improved trading performance, providing insights that other traders can learn from and apply to their own strategies.
--------------------------------------------------------------------------------------------
How to Use the Strategy
Adding the Strategy to Your Chart
Apply the DSL Strategy to your desired trading instrument and timeframe on TradingView.
--------------------------------------------------------------------------------------------
Configuring Parameters
DSL Indicator Settings :
Length (len) : Adjusts the sensitivity of the DSL lines (default is 34).
Offset : Determines the look-back period for threshold calculations (default is 30).
Bands Width (width) : Changes the distance of the ATR-based bands from the DSL lines (default is 1).
DSL-BELUGA Oscillator Settings :
Beluga Length (len_beluga) : Sets the period for the RSI calculation in the oscillator (default is 10).
DSL Lines Mode (dsl_mode) : Chooses between "Fast" (more responsive) and "Slow" (smoother) modes for the oscillator's DSL lines.
Risk Management :
Risk Reward (risk_reward) : Defines your desired risk-reward ratio for calculating take-profit levels (default is 1.5).
--------------------------------------------------------------------------------------------
Interpreting Signals
Long Entry Conditions :
Trend Confirmation : Price is above the upper DSL line and the upper DSL band (dsl_up1 > dsl_dn).
Price Behavior : The last three candles have both their opens and closes above the upper DSL line.
Momentum Signal : The DSL-BELUGA oscillator crosses above its lower DSL line (up_signal), indicating bullish momentum.
Short Entry Conditions :
Trend Confirmation : Price is below the lower DSL line and the lower DSL band (dsl_dn < dsl_up1).
Price Behavior : The last three candles have both their opens and closes below the lower DSL band.
Momentum Signal : The DSL-BELUGA oscillator crosses below its upper DSL line (dn_signal), indicating bearish momentum.
Exit Conditions :
Stop-Loss : Automatically set at the DSL indicator's band level (upper band for longs, lower band for shorts).
Take-Profit : Calculated based on the risk-reward ratio and the initial risk determined by the stop-loss distance.
Visual Aids
Signal Arrows : Upward green arrows for long entries and downward blue arrows for short entries appear on the chart when conditions are met.
Stop-Loss and Take-Profit Lines : Red and green lines display the calculated stop-loss and take-profit levels for active trades.
Background Highlighting : The chart background subtly changes color to indicate when a signal has been generated.
Backtesting and Optimization
Use TradingView's strategy tester to backtest the strategy over historical data.
Adjust parameters to optimize performance for different instruments or market conditions.
Regularly review backtesting results to ensure the strategy remains effective.
Supertrend StrategyThe Supertrend Strategy was created based on the Supertrend and Relative Strength Index (RSI) indicators, widely respected tools in technical analysis. This strategy combines these two indicators to capture market trends with precision and reliability, looking for optimizing exit levels at oversold or overbought price levels.
The Supertrend indicator identifies trend direction based on price and volatility by using the Average True Range (ATR). The ATR measures market volatility by calculating the average range between an asset’s high and low prices over a set period. It provides insight into price fluctuations, with higher ATR values indicating increased volatility and lower values suggesting stability. The Supertrend Indicator plots a line above or below the price, signaling potential buy or sell opportunities: when the price closes above the Supertrend line, an uptrend is indicated, while a close below the line suggests a downtrend. This line shifts as price movements and volatility levels change, acting as both a trailing stop loss and trend confirmation.
To enhance the Supertrend strategy, the Relative Strength Index (RSI) has been added as an exit criterion. As a momentum oscillator, the RSI indicates overbought (usually above 70) or oversold (usually below 30) conditions. This integration allows trades to close when the asset is overbought or oversold, capturing gains before a possible reversal, even if the percentage take profit level has not been reached. This mechanism aims to prevent losses due to market reversals before the Supertrend signal changes.
### Key Features
1. **Entry criteria**:
- The strategy uses the Supertrend indicator calculated by adding or subtracting a multiple of the ATR from the closing price, depending on the trend direction.
- When the price crosses above the Supertrend line, the strategy signals a long (buy) entry. Conversely, when the price crosses below, it signals a short (sell) entry.
- The strategy performs a reversal if there is an open position and a change in the direction of the supertrend occurs
2. **Exit criteria**:
- Take profit of 30% (default) on the average position price.
- Oversold (≤ 5) or overbought (≥ 95) RSI
- Reversal when there is a change in direction of the Supertrend
3. **No Repainting**:
- This strategy is not subject to repainting, as long as the timeframe configured on your chart is the same as the supertrend timeframe .
4. **Position Sizing by Equity and risk management**:
- This strategy has a default configuration to operate with 35% of the equity. At the time of opening the position, the supertrend line is typically positioned at about 12 to 16% of the entry price. This way, the strategy is putting at risk about 16% of 35% of equity, that is, around 5.6% of equity for each trade. The percentage of equity can be adjusted by the user according to their risk management.
5. **Backtest results**:
- This strategy was subjected to deep backtesting and operations in replay mode, including transaction fees of 0.12%, and slippage of 5 ticks.
- The past results in deep backtest and replay mode were compatible and profitable (Variable results depending on the take profit used, supertrend and RSI parameters). However, it should be noted that few operations were evaluated, since the currency in question has been created for a short time and the frequency of operations is relatively small.
- Past results are no guarantee of future results. The strategy's backtest results may even be due to overfitting with past data.
Default Settings
Chart timeframe: 2h
Supertrend Factor: 3.42
ATR period: 14
Supertrend timeframe: 2 h
RSI timeframe: 15 min
RSI Lenght: 5 min
RSI Upper limit: 95
RSI Lower Limit: 5
Take Profit: 30%
BYBIT:1000000MOGUSDT.P
Oscillator Price Divergence & Trend Strategy (DPS) // AlgoFyreThe Oscillator Price Divergence & Trend Strategy (DPS) strategy combines price divergence and trend indicators for trend trading. It uses divergence conditions to identify entry points and a trend source for directional bias. The strategy incorporates risk management through dynamic position sizing based on a fixed risk amount. It allows for both long and short positions with customizable stop-loss and take-profit levels. The script includes visualization options for entry, stop-loss, and take-profit levels, enhancing trade analysis.
TABLE OF CONTENTS
🔶 ORIGINALITY
🔸Divergence-Trend Combination
🔸Dynamic Position Sizing
🔸Customizable Risk Management
🔶 FUNCTIONALITY
🔸Indicators
🞘 Trend Indicator
🞘 Oscillator Source
🔸Conditions
🞘 Long Entry
🞘 Short Entry
🞘 Take Profit
🞘 Stop Loss
🔶 INSTRUCTIONS
🔸Adding the Strategy to the Chart
🔸Configuring the Strategy
🔸Backtesting and Practice
🔸Market Awareness
🔸Visual Customization
🔶 CONCLUSION
▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅▅
🔶 ORIGINALITY The Divergence Trend Trading with Dynamic Position Sizing strategy uniquely combines price divergence indicators with trend analysis to optimize entry and exit points. Unlike static trading strategies, it employs dynamic position sizing based on a fixed risk amount, ensuring consistent risk management. This approach allows traders to adapt to varying market conditions by adjusting position sizes according to predefined risk parameters, enhancing both flexibility and control in trading decisions. The strategy's integration of customizable stop-loss and take-profit levels further refines its risk management capabilities, making it a robust tool for both trending and volatile markets.
🔸Divergence-Trend Combination By combining trend direction with divergence conditions, the strategy enhances the accuracy of entry signals, aligning trades with prevailing market trends.
🔸Dynamic Position Sizing This strategy calculates position sizes dynamically, based on a fixed risk amount, allowing traders to maintain consistent risk exposure across trades.
🔸Customizable Risk Management Traders can set flexible risk-reward ratios and adjust stop-loss and take-profit levels, tailoring the strategy to their risk tolerance and market conditions.
🔶 FUNCTIONALITY The Divergence Trend Trading with Dynamic Position Sizing strategy leverages a combination of trend indicators and price and oscillator divergences to identify optimal trading opportunities. This strategy is designed to capitalize on medium to long-term price movements and works best on h1, h4 or D1 timeframes. It allows traders to manage risk effectively while taking advantage of both long and short positions.
🔸Indicators 🞘 Trend Indicator: A long trend is used to determine market direction, ensuring trades align with prevailing trends.
Recommendation: We recommend using the Adaptive MAs (Hurst, CVaR, Fractal) // AlgoFyre indicator with the following settings for trend detection. However, you can use any trend indicator that suits your trading style, e.g. an EMA 200.
🞘 Oscillator Source: The oscillator source is used for momentum price divergence identification. Any momentum oscillator can be used, e.g. RSI, Stochastic etc. A good oscillator is the Stochastic with the following settings:
🔸Conditions 🞘 Long Entry: A long entry condition is met if price closes above the trend AND selected divergence conditions are met, e.g. regular bullish divergence with a 10 bar lookback period with the divergence being below the 50 point mean. If the info table shows all 3 columns in the same color, the entry conditions are met and a position is opened.
🞘 Short Entry: A short entry condition is met if price closes below the trend AND selected divergence conditions are met, e.g. regular bearish divergence with a 10 bar lookback period with the divergence being above the 50 point mean.
🞘 Take Profit: Take Profit is determined by the Risk to Reward Ratio settings depending on the price distance between the entry price and the stop loss price, e.g. if stop loss is 1% away from entry and Risk Reward Ratio is 3:1 then Take Profit will be set at 3% from entry.
🞘 Stop Loss: Stop loss is a fixed level away from the trend source. For long positions, stop loss is set below the trend, and for short positions, above the trend.
🔶 INSTRUCTIONS The Divergence Trend Trading with Dynamic Position Sizing strategy can be set up by adding it to your TradingView chart and configuring parameters such as the oscillator source, trend source, and risk management settings. This strategy is designed to capitalize on short-term price movements by dynamically adjusting position sizes based on predefined risk parameters. Enhance the accuracy of signals by combining this strategy with additional indicators like trend-following or momentum-based tools. Adjust settings to better manage risk and optimize entry and exit points.
🔸Adding the Strategy to the Chart:
Go to your TradingView chart.
Click on the "Indicators" button at the top.
Search for "Divergence Trend Trading with Dynamic Position Sizing // AlgoFyre" in the indicators list.
Click on the strategy to add it to your chart.
🔸Configuring the Strategy:
Open the strategy settings by clicking on the gear icon next to its name on the chart.
Oscillator Source: Select the source for the oscillator. An oscillator like Stochastic needs to be attached to the chart already in order to be used as an oscillator source to be selectable.
Trend Source: Choose the trend source to determine market direction. A trend indicator like Adaptive MAs (Hurst, CVaR, Fractal) // AlgoFyre needs to be attached to the chart already in order to be used as a trend source to be selectable.
Stop Loss Percentage: Set the stop loss distance from the trend source as a percentage.
Risk/Reward Ratio: Define the desired risk/reward ratio for trades.
🔸Backtesting and Practice:
Backtest the strategy on historical data to understand how it performs in various market environments.
Practice using the strategy on a demo account before implementing it in live trading.
🔸Market Awareness:
Keep an eye on market news and events that might cause extreme price movements. The strategy reacts to price data and might not account for news-driven events that can cause large deviations.
🔸Visual Customization Visualization Settings: Customize the display of entry price, take profit, and stop loss levels.
Color Settings: Switch to the AlgoFyre theme or set custom colors for bullish, bearish, and neutral states.
Table Settings: Enable or disable the information table and adjust its position.
🔶 CONCLUSION
The Divergence Trend Trading with Dynamic Position Sizing strategy provides a robust framework for capitalizing on short-term market trends by combining price divergence with dynamic position sizing. This strategy leverages divergence conditions to identify entry points and utilizes a trend source for directional bias, ensuring trades align with prevailing market conditions. By incorporating dynamic position sizing based on a fixed risk amount, traders can effectively manage risk and adapt to varying market conditions. The strategy's customizable stop-loss and take-profit levels further enhance its risk management capabilities, making it a versatile tool for both trending and volatile markets. With its strategic blend of technical indicators and risk management, the Divergence Trend Trading strategy offers traders a comprehensive approach to optimizing trade execution and maximizing potential returns.
Stochastic RSI OHLC StrategyThe script titled "Stochastic RSI High Low Close Bars" is a versatile trading strategy implemented in Pine Script, designed for TradingView. Here's an overview of its features:
Description
This strategy leverages the Stochastic RSI to determine entry and exit signals in the market, focusing on high, low, and close values of the indicator. It incorporates various trading styles, stop-loss mechanisms, and multi-timeframe analysis to adapt to different market conditions.
Key Features
Stochastic RSI Analysis:
Uses the Stochastic RSI to identify potential entry points for long and short positions.
Tracks high, low, and close values for more granular analysis.
Multiple Trading Styles:
Supports diverse trading styles like Volume Color Swing, RSI Divergence, RSI Pullback, and more.
Allows switching between these styles to suit market dynamics.
Session-Based Trading:
Offers session control, limiting trades to specific hours (e.g., NY sessions).
Can close all positions at the end of the trading day.
Stop-Loss and Take-Profit Mechanisms:
Includes both static and dynamic stop-losses, with options for time-based stops, trailing stops, and momentum-based exits.
Customizable take-profit levels ensure efficient trade management.
Volume Analysis:
Integrates volume indicators to add a bias for trade entries and exits, enhancing signal reliability.
Multi-Timeframe Integration:
Employs multi-timeframe RSI analysis, allowing the strategy to capture broader trends and optimize entries.
This script is designed to provide flexibility and adaptability, making it useful for different trading strategies and market conditions. It is suitable for traders looking to refine their entries and exits with a focus on the Stochastic RSI.
Gabriel's Witcher Strategy [65 Minute Trading Bot]Strategy Description: Gabriel's Witcher Strategy
Author: Gabriel
Platform: TradingView Pine Script (Version 5)
Backtested Asset: Avalanche (Coinbase Brokage for Volume adjustment)
Timeframe: 65 Minutes
Strategy Type: Comprehensive Trend-Following and Momentum Strategy with Scalping and Risk Management Features
Overview
Gabriel's Witcher Strategy is an advanced trading bot designed for the Avalanche pair on a 65-minute timeframe. This strategy integrates a multitude of technical indicators to identify and execute high-probability trading opportunities. By combining trend-following, momentum, volume analysis, and range filtering, the strategy aims to capitalize on both long and short market movements. Additionally, it incorporates scalping mechanisms and robust risk management features, including take-profit (TP) levels and commission considerations, to optimize trade performance and profitability.
====Key Components====
Source Selection:
Custom Source Flexibility: Allows traders to select from a wide range of price and volume sources (e.g., Close, Open, High, Low, HL2, HLC3, OHLC4, VWAP, On-Balance Volume, etc.) for indicator calculations, enhancing adaptability to various trading styles.
Various curves of Volume Analysis are employed:
Tick Volume Calculation: Utilizes tick volume as a fallback when actual volume data is unavailable, ensuring consistency across different data feeds.
Volume Indicators: Incorporates multiple volume-based indicators such as On-Balance Volume (OBV), Accumulation/Distribution (AccDist), Negative Volume Index (NVI), Positive Volume Index (PVI), and Price Volume Trend (PVT) for comprehensive market analysis.
Trend Indicators:
ADX (Average Directional Index): Measures trend strength using either the Classic or Masanakamura method, with customizable length and threshold settings. It's used to open positions when the mesured trend is strong, or exit when its weak.
Jurik Moving Average (JMA): A smooth moving average that reduces lag, configurable with various parameters including source, resolution, and repainting options.
Parabolic SAR: Identifies potential reversals in market trends with adjustable start, increment, and maximum settings.
Custom Trend Indicator: Utilizes highest and lowest price points over a specified timeframe to determine current and previous trend bases, visually represented with color-filled areas.
Momentum Indicators:
Relative Strength Index (RSI): Evaluates the speed and change of price movements, smoothed with a custom length and source. It's used to not enter the market for shorts in oversold or longs for overbought conditions, and to enter for long in oversold or shorts for overboughts.
Momentum-Based Calculations: Employs both Double Exponential Moving Averages (DEMA) on a MACD-based RSI to enhance momentum signal accuracy which is then further accelerated by a Hull MA. This is the technical analysis tool that determines bearish or bullish momentum.
OBV-Based Momentum Conditions: Uses two exponential moving averages of OBV to determine bullish or bearish momentum shifts, anomalities, breakouts where banks flow their funds in or Smart Money Concepts trade.
Moving Averages (MA):
Multiple MA Types: Includes Simple Moving Average (SMA), Exponential Moving Average (EMA), Weighted Moving Average (WMA), Hull Moving Average (HMA), and Volume-Weighted Moving Average (VWMA), selectable via input parameters.
MA Speed Calculation: Measures the percentage change in MA values to determine the direction and speed of the trend.
Range Filtering:
Variance-Based Filter: Utilizes variance and moving averages to filter out trades during low-volatility periods, enhancing trade quality.
Color-Coded Range Indicators: Visualizes range filtering with color changes on the chart for quick assessment.
Scalping Mechanism:
Heikin-Ashi Candles: Optionally uses Heikin-Ashi candles for smoother price action analysis.
EMA-Based Trend Detection: Employs fast, medium, and slow EMAs to determine trend direction and potential entry points.
Fractal-Based Filtering: Detects regular or BW (Black & White) fractals to confirm trade signals.
Take Profit (TP) Management:
Dynamic TP Levels: Calculates TP levels based on the number of consecutive long or short entries, adjusting targets to maximize profits.
TP Signals and Re-Entry: Plots TP signals on the chart and allows for automatic re-entry upon TP hit, maintaining continuous trade flow.
Risk Management:
Commission Integration: Accounts for trading commissions to ensure net profitability.
Position Sizing: Configured to use a percentage of equity for each trade, adjustable via input parameters.
Pyramiding: Allows up to one additional position per direction to enhance gains during strong trends.
Alerts and Visual Indicators:
Buy/Sell Signals: Plots visual indicators (triangles and flags) on the chart to signify entry and TP points.
Bar Coloring: Changes bar colors based on ADX and trend conditions for immediate visual cues.
Price Levels: Marks significant price levels related to TP and position entries with cross styles.
Input Parameters
Source Settings:
Custom Sources (srcinput): Choose from various price and volume sources to tailor indicator calculations.
ADX Settings:
ADX Type (ADX_options): Select between 'CLASSIC' and 'MASANAKAMURA' methods.
ADX Length (ADX_len): Defines the period for ADX calculation.
ADX Threshold (th): Sets the minimum ADX value to consider a strong trend.
RSI Settings:
RSI Length (len_3): Period for RSI calculation.
RSI Source (src_3): Source data for RSI.
Trend Strength Settings:
Channel Length (n1): Period for trend channel calculation.
Average Length (n2): Period for smoothing trend strength.
Jurik Moving Average (JMA) Settings:
JMA Source (inp): Source data for JMA.
JMA Resolution (reso): Timeframe for JMA calculation.
JMA Repainting (rep): Option to allow JMA to repaint.
JMA Length (lengths): Period for JMA.
Parabolic SAR Settings:
SAR Start (start): Initial acceleration factor.
SAR Increment (increment): Acceleration factor increment.
SAR Maximum (maximum): Maximum acceleration factor.
SAR Point Width (width): Visual width of SAR points.
Trend Indicator Settings:
Trend Timeframe (timeframe): Period for trend indicator calculations.
Momentum Settings:
Source Type (srcType): Select between 'Price' and 'VWAP'.
Momentum Source (srcPrice): Source data for momentum calculations.
RSI Length (rsiLen): Period for momentum RSI.
Smooth Length (sLen): Smoothing period for momentum RSI.
OBV Settings:
OBV Line 1 (e1): EMA period for OBV line 1.
OBV Line 2 (e2): EMA period for OBV line 2.
Moving Average (MA) Settings:
MA Length (length): Period for MA calculations.
MA Type (matype): Select MA type (1: SMA, 2: EMA, 3: HMA, 4: WMA, 5: VWMA).
Range Filter Settings:
Range Filter Length (length0): Period for range filtering.
Range Filter Multiplier (mult): Multiplier for range variance.
Take Profit (TP) Settings:
TP Long (tp_long0): Percentage for long TP.
TP Short (tp_short0): Percentage for short TP.
Scalping Settings:
Scalping Activation (ACT_SCLP): Enable or disable scalping.
Scalping Length (HiLoLen): Period for scalping indicators.
Fast EMA Length (fastEMAlength): Period for fast EMA in scalping.
Medium EMA Length (mediumEMAlength): Period for medium EMA in scalping.
Slow EMA Length (slowEMAlength): Period for slow EMA in scalping.
Filter (filterBW): Enable or disable additional fractal filtering.
Pullback Lookback (Lookback): Number of bars for pullback consideration.
Use Heikin-Ashi Candles (UseHAcandles): Option to use Heikin-Ashi candles for smoother trend analysis.
Strategy Logic
Indicator Calculations:
Volume and Source Selection: Determines the primary data source based on user input, ensuring flexibility and adaptability.
ADX Calculation: Computes ADX using either the Classic or Masanakamura method to assess trend strength.
RSI Calculation: Evaluates market momentum using RSI, further smoothed with custom periods.
Trend Strength Assessment: Utilizes trend channel and average lengths to gauge the robustness of current trends.
Jurik Moving Average (JMA): Smooths price data to reduce lag and enhance trend detection.
Parabolic SAR: Identifies potential trend reversals with adjustable parameters for sensitivity.
Momentum Analysis: Combines RSI with DEMA and OBV-based conditions to confirm bullish or bearish momentum.
Moving Averages: Employs multiple MA types to determine trend direction and speed.
Range Filtering: Filters out low-volatility periods to focus on high-probability trades.
Trade Conditions:
Long Entry Conditions:
ADX Confirmation: ADX must be above the threshold, indicating a strong uptrend.
RSI and Momentum: RSI below 70 and positive momentum signals.
JMA and SAR: JMA indicates an uptrend, and Parabolic SAR is below the price.
Trend Indicator: Confirms the current trend direction.
Range Filter: Ensures market is in an upward range.
Scalping Option: If enabled, additional scalping conditions must be met.
Short Entry Conditions:
ADX Confirmation: ADX must be above the threshold, indicating a strong downtrend.
RSI and Momentum: RSI above 30 and negative momentum signals.
JMA and SAR: JMA indicates a downtrend, and Parabolic SAR is above the price.
Trend Indicator: Confirms the current trend direction.
Range Filter: Ensures market is in a downward range.
Scalping Option: If enabled, additional scalping conditions must be met.
Position Management:
Entry Execution: Places long or short orders based on the identified conditions and user-selected position types (Longs, Shorts, or Both).
Take Profit (TP): Automatically sets TP levels based on predefined percentages, adjusting dynamically with consecutive trades.
Re-Entry Mechanism: Allows for automatic re-entry upon TP hit, maintaining active trading positions.
Exit Conditions: Closes positions when TP levels are reached or when opposing trend signals are detected.
Visual Indicators:
Bar Coloring: Highlights bars in green for bullish conditions, red for bearish, and orange for neutral.
Plotting Price Levels: Marks significant price levels related to TP and trade entries with cross symbols.
Signal Shapes: Displays triangle and flag shapes on the chart to indicate trade entries and TP hits.
Alerts:
Custom Alerts: Configured to notify traders of long entries, short entries, and TP hits, enabling timely trade management and execution.
Usage Instructions
Setup:
Apply the Strategy: Add the script to your TradingView chart set to BTCUSDT with a 65-minute timeframe.
Configure Inputs: Adjust the input parameters under their respective groups (e.g., Source Settings, ADX, RSI, Trend Strength, etc.) to match your trading preferences and risk tolerance.
Position Selection:
Choose Position Type: Use the Position input to select Longs, Shorts, or Both based on your market outlook.
Execution: The strategy will automatically execute and manage positions according to the selected type, ensuring targeted trading actions.
Signal Interpretation:
Buy Signals: Blue triangles below the bars indicate potential long entry points.
Sell Signals: Red triangles above the bars indicate potential short entry points.
Take Profit Signals: Flags above or below the bars signify TP hits for long and short positions, respectively.
Bar Colors: Green bars suggest bullish conditions, red bars indicate bearish conditions, and orange bars represent neutral or consolidating markets.
Risk Management:
Default Position Size: Set to 100% of equity. Adjust the default_qty_value as needed for your risk management strategy.
Commission: Accounts for a 0.1% commission per trade. Adjust the commission_value to match your broker's fees.
Pyramiding: Allows up to one additional position per direction to enhance gains during strong trends.
Backtesting and Optimization:
Historical Testing: Utilize TradingView's backtesting features to evaluate the strategy's performance over historical data.
Parameter Tuning: Optimize input parameters to align the strategy with current market dynamics and personal trading objectives.
Alerts Configuration:
Set Up Alerts: Enable and configure alerts based on the predefined alertcondition statements to receive real-time notifications of trade signals and TP hits.
Additional Features
Comprehensive Indicator Integration: Combines multiple technical indicators to provide a holistic view of market conditions, enhancing trade signal accuracy.
Scalping Options: Offers an optional scalping mechanism to capitalize on short-term price movements, increasing trading flexibility.
Dynamic Take Profit Levels: Adjusts TP targets based on the number of consecutive trades, maximizing profit potential during favorable trends.
Advanced Volume Analysis: Utilizes various volume indicators to confirm trend strength and validate trade signals.
Customizable Range Filtering: Filters trades based on market volatility, ensuring trades are taken during optimal conditions.
Heikin-Ashi Candle Support: Optionally uses Heikin-Ashi candles for smoother price action analysis and reduced noise.
====Recommendations====
Thorough Backtesting:
Historical Performance: Before deploying the strategy in a live trading environment, perform comprehensive backtesting to understand its performance under various market conditions. These are the premium settings for Avalanche Coinbase.
Optimization: Regularly review and adjust input parameters to ensure the strategy remains effective amidst changing market volatility and trends. Backtest the strategy for each crypto and make sure you are in the right brokage when using the volume sources as it will affect the overall outcome of the trading strategy.
Risk Management:
Position Sizing: Adjust the default_qty_value to align with your risk tolerance and account size.
Stop-Loss Implementation: Although the strategy includes TP levels, they're also consided to be a stop-loss mechanisms to protect against adverse market movements.
Commission Adjustment: Ensure the commission_value accurately reflects your broker's fees to maintain realistic backtesting results. Generally, 0.1~0.3% are most of the average broker's comission fees.
Slipage: The slip comssion is 1 Tick, since the strategy is adjusted to only enter/exit on bar close where most positions are available.
Continuous Monitoring:
Strategy Performance: Regularly monitor the strategy's performance to ensure it operates as expected and make adjustments as needed. A max-drawndown hit has been added to operate in case the premium Avalanche settings go wrong, but you can turn it off an adjust the equity percentage to 50% if you are confortable with the high volatile max-drown or even 100% if your account allows you to borrow cash.
Customization:
Indicator Parameters: Tailor indicator settings (e.g., ADX length, RSI period, MA types) to better fit your specific trading style and market conditions.
Scalping Options: Enable or disable scalping based on your trading preferences and risk appetite.
Conclusion
Gabriel's Witcher Strategy is a robust and versatile trading solution designed to navigate the complexities of the Crypto market. By integrating a wide array of technical indicators and providing extensive customization options, this strategy empowers traders to execute informed and strategic trades. Its comprehensive approach, combining trend analysis, momentum detection, volume evaluation, and range filtering, ensures that trades are taken during optimal market conditions. Additionally, the inclusion of scalping features and dynamic take-profit management enhances the strategy's adaptability and profitability potential. Unlike any trading strategy, with both diligent testing and continuous monitoring under the strategy tester, it's possible to achieve sustained success by adjusting the settings to the individual Crypto that need it, for example this one is preset for Avalanche Coinbase 65 Miinutes but it can be adjust for BTCUSD or Etherium if you backtest and search for the right settings.
Chande Momentum Oscillator StrategyThe Chande Momentum Oscillator (CMO) Trading Strategy is based on the momentum oscillator developed by Tushar Chande in 1994. The CMO measures the momentum of a security by calculating the difference between the sum of recent gains and losses over a defined period. The indicator offers a means to identify overbought and oversold conditions, making it suitable for developing mean-reversion trading strategies (Chande, 1997).
Strategy Overview:
Calculation of the Chande Momentum Oscillator (CMO):
The CMO formula considers both positive and negative price changes over a defined period (commonly set to 9 days) and computes the net momentum as a percentage.
The formula is as follows:
CMO=100×(Sum of Gains−Sum of Losses)(Sum of Gains+Sum of Losses)
CMO=100×(Sum of Gains+Sum of Losses)(Sum of Gains−Sum of Losses)
This approach distinguishes the CMO from other oscillators like the RSI by using both price gains and losses in the numerator, providing a more symmetrical measurement of momentum (Chande, 1997).
Entry Condition:
The strategy opens a long position when the CMO value falls below -50, signaling an oversold condition where the price may revert to the mean. Research in mean-reversion, such as by Poterba and Summers (1988), supports this approach, highlighting that prices often revert after sharp movements due to overreaction in the markets.
Exit Conditions:
The strategy closes the long position when:
The CMO rises above 50, indicating that the price may have become overbought and may not provide further upside potential.
Alternatively, the position is closed 5 days after the buy signal is triggered, regardless of the CMO value, to ensure a timely exit even if the momentum signal does not reach the predefined level.
This exit strategy aligns with the concept of time-based exits, reducing the risk of prolonged exposure to adverse price movements (Fama, 1970).
Scientific Basis and Rationale:
Momentum and Mean-Reversion:
The strategy leverages the well-known phenomenon of mean-reversion in financial markets. According to research by Jegadeesh and Titman (1993), prices tend to revert to their mean over short periods following strong movements, creating opportunities for traders to profit from temporary deviations.
The CMO captures this mean-reversion behavior by monitoring extreme price conditions. When the CMO reaches oversold levels (below -50), it signals potential buying opportunities, whereas crossing overbought levels (above 50) indicates conditions for selling.
Market Efficiency and Overreaction:
The strategy takes advantage of behavioral inefficiencies and overreactions, which are often the drivers behind sharp price movements (Shiller, 2003). By identifying these extreme conditions with the CMO, the strategy aims to capitalize on the market’s tendency to correct itself when price deviations become too large.
Optimization and Parameter Selection:
The 9-day period used for the CMO calculation is a widely accepted timeframe that balances responsiveness and noise reduction, making it suitable for capturing short-term price fluctuations. Studies in technical analysis suggest that oscillators optimized over such periods are effective in detecting reversals (Murphy, 1999).
Performance and Backtesting:
The strategy's effectiveness is confirmed through backtesting, which shows that using the CMO as a mean-reversion tool yields profitable opportunities. The use of time-based exits alongside momentum-based signals enhances the reliability of the strategy by ensuring that trades are closed even when the momentum signal alone does not materialize.
Conclusion:
The Chande Momentum Oscillator Trading Strategy combines the principles of momentum measurement and mean-reversion to identify and capitalize on short-term price fluctuations. By using a widely tested oscillator like the CMO and integrating a systematic exit approach, the strategy effectively addresses both entry and exit conditions, providing a robust method for trading in diverse market environments.
References:
Chande, T. S. (1997). The New Technical Trader: Boost Your Profit by Plugging into the Latest Indicators. John Wiley & Sons.
Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383-417.
Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
Murphy, J. J. (1999). Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications. New York Institute of Finance.
Poterba, J. M., & Summers, L. H. (1988). Mean Reversion in Stock Prices: Evidence and Implications. Journal of Financial Economics, 22(1), 27-59.
Shiller, R. J. (2003). From Efficient Markets Theory to Behavioral Finance. Journal of Economic Perspectives, 17(1), 83-104.
Ultimate Oscillator Trading StrategyThe Ultimate Oscillator Trading Strategy implemented in Pine Script™ is based on the Ultimate Oscillator (UO), a momentum indicator developed by Larry Williams in 1976. The UO is designed to measure price momentum over multiple timeframes, providing a more comprehensive view of market conditions by considering short-term, medium-term, and long-term trends simultaneously. This strategy applies the UO as a mean-reversion tool, seeking to capitalize on temporary deviations from the mean price level in the asset’s movement (Williams, 1976).
Strategy Overview:
Calculation of the Ultimate Oscillator (UO):
The UO combines price action over three different periods (short-term, medium-term, and long-term) to generate a weighted momentum measure. The default settings used in this strategy are:
Short-term: 6 periods (adjustable between 2 and 10).
Medium-term: 14 periods (adjustable between 6 and 14).
Long-term: 20 periods (adjustable between 10 and 20).
The UO is calculated as a weighted average of buying pressure and true range across these periods. The weights are designed to give more emphasis to short-term momentum, reflecting the short-term mean-reversion behavior observed in financial markets (Murphy, 1999).
Entry Conditions:
A long position is opened when the UO value falls below 30, indicating that the asset is potentially oversold. The value of 30 is a common threshold that suggests the price may have deviated significantly from its mean and could be due for a reversal, consistent with mean-reversion theory (Jegadeesh & Titman, 1993).
Exit Conditions:
The long position is closed when the current close price exceeds the previous day’s high. This rule captures the reversal and price recovery, providing a defined point to take profits.
The use of previous highs as exit points aligns with breakout and momentum strategies, as it indicates sufficient strength for a price recovery (Fama, 1970).
Scientific Basis and Rationale:
Momentum and Mean-Reversion:
The strategy leverages two well-established phenomena in financial markets: momentum and mean-reversion. Momentum, identified in earlier studies like those by Jegadeesh and Titman (1993), describes the tendency of assets to continue in their direction of movement over short periods. Mean-reversion, as discussed by Poterba and Summers (1988), indicates that asset prices tend to revert to their mean over time after short-term deviations. This dual approach aims to buy assets when they are temporarily oversold and capitalize on their return to the mean.
Multi-timeframe Analysis:
The UO’s incorporation of multiple timeframes (short, medium, and long) provides a holistic view of momentum, unlike single-period oscillators such as the RSI. By combining data across different timeframes, the UO offers a more robust signal and reduces the risk of false entries often associated with single-period momentum indicators (Murphy, 1999).
Trading and Market Efficiency:
Studies in behavioral finance, such as those by Shiller (2003), show that short-term inefficiencies and behavioral biases can lead to overreactions in the market, resulting in price deviations. This strategy seeks to exploit these temporary inefficiencies, using the UO as a signal to identify potential entry points when the market sentiment may have overly pushed the price away from its average.
Strategy Performance:
Backtests of this strategy show promising results, with profit factors exceeding 2.5 when the default settings are optimized. These results are consistent with other studies on short-term trading strategies that capitalize on mean-reversion patterns (Jegadeesh & Titman, 1993). The use of a dynamic, multi-period indicator like the UO enhances the strategy’s adaptability, making it effective across different market conditions and timeframes.
Conclusion:
The Ultimate Oscillator Trading Strategy effectively combines momentum and mean-reversion principles to trade on temporary market inefficiencies. By utilizing multiple periods in its calculation, the UO provides a more reliable and comprehensive measure of momentum, reducing the likelihood of false signals and increasing the profitability of trades. This aligns with modern financial research, showing that strategies based on mean-reversion and multi-timeframe analysis can be effective in capturing short-term price movements.
References:
Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383-417.
Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
Murphy, J. J. (1999). Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications. New York Institute of Finance.
Poterba, J. M., & Summers, L. H. (1988). Mean Reversion in Stock Prices: Evidence and Implications. Journal of Financial Economics, 22(1), 27-59.
Shiller, R. J. (2003). From Efficient Markets Theory to Behavioral Finance. Journal of Economic Perspectives, 17(1), 83-104.
Williams, L. (1976). Ultimate Oscillator. Market research and technical trading analysis.
Premium Signal Strategy [BRTLab]🔍 Overview
BRTLab Premium Signal Strategy is a comprehensive multi-indicator trading strategy based on the integration of key technical indicators such as ADX, RSX, CAND, V9, PP, MA, and LVL. The strategy allows users to flexibly adjust the parameters of each indicator to optimize for specific market conditions, making it effective for both trending markets and for identifying reversals and breakouts.
🌟 What makes this strategy unique is its seamless compatibility with the BRT Premium Signals tool, allowing traders not only to receive real-time signals but also to conduct robust backtests. This feature enables users to fine-tune the best parameter settings or even test out their own trading ideas through historical data analysis. The ability to backtest empowers traders to validate strategies before going live, significantly improving the chances of success by offering data-driven insights.
💡 Signal Logic:
ADX
The ADX-based signals reflect the strength of market trends. Bullish or bearish signals are generated when directional indicators (+DI or -DI) show increasing strength relative to one another, indicating the start or continuation of a strong trend.
RSX
These signals focus on divergences within RSI, identifying potential reversals by detecting either classic or hidden divergences when the market is overbought or oversold.
V9
Signals are generated when the price interacts with a dynamic threshold, indicating trend continuation or reversal. Additional filters can be applied to refine these signals further, enhancing the dashboard's overall effectiveness.
CAND
Candlestick-based signals are triggered by key patterns such as bullish or bearish engulfing formations. These signals are cross-checked with other conditions, such as RSI levels and candle stability, making them especially useful for short-term trading.
PP (Pivot Points)
Pivot Point signals reinforce candlestick patterns by aligning with key support or resistance levels, suggesting potential reversals or continuation opportunities at significant price points.
MA (Moving Average)
MA signals help identify trends by analyzing price action relative to a moving average. Optional filters like ADX add an additional layer of validation, ensuring only high-confidence signals are displayed on the dashboard.
LVL (Levels)
These signals are based on shifts in RSI and help traders spot potential breakouts or reversals. The dashboard integrates these signals alongside MA and ADX filters to enhance their accuracy.
📊 Risk Management
This strategy includes built-in risk management features to help minimize losses:
Initial Capital: The user can set the initial capital (default is 10000), adjusting the strategy to their financial goals.
Position Size: Set the position size (default is 1000), allowing better risk management and controlling potential losses.
Stop-Loss: Multiple stop-loss methods are available, including ATR-based, fixed percentage, or prior high/low levels.
Take-Profit: Users can configure take-profit settings (default is 1.3%) to lock in gains while managing risk effectively.
⚠️ RISK DISCLAIMER
Trading involves significant risks, and most day traders experience losses. All content, tools, scripts, and educational materials from BRTLab are provided for informational and educational purposes only. Past performance is not a guarantee of future results. Please ensure you use realistic backtesting settings, including proper account size, commission, and slippage, to reflect market conditions.
⚡ CONCLUSION
We believe that successful trading comes from using indicators as supportive tools rather than relying on them for guaranteed success. The BRTLab Premium Signal Strategy is designed to be a comprehensive, customizable toolset that helps traders understand and interpret technical indicators more effectively.
By leveraging the power of backtesting and indicator optimization, traders can make well-informed decisions and develop a deeper understanding of market dynamics. Use this strategy to build a trading framework that aligns with your personal goals and trading style.
Follow the author’s instructions below to access the BRTLab Premium suite and unlock the full potential of this strategy.
Williams %R StrategyThe Williams %R Strategy implemented in Pine Script™ is a trading system based on the Williams %R momentum oscillator. The Williams %R indicator, developed by Larry Williams in 1973, is designed to identify overbought and oversold conditions in a market, helping traders time their entries and exits effectively (Williams, 1979). This particular strategy aims to capitalize on short-term price reversals in the S&P 500 (SPY) by identifying extreme values in the Williams %R indicator and using them as trading signals.
Strategy Rules:
Entry Signal:
A long position is entered when the Williams %R value falls below -90, indicating an oversold condition. This threshold suggests that the market may be near a short-term bottom, and prices are likely to reverse or rebound in the short term (Murphy, 1999).
Exit Signal:
The long position is exited when:
The current close price is higher than the previous day’s high, or
The Williams %R indicator rises above -30, indicating that the market is no longer oversold and may be approaching an overbought condition (Wilder, 1978).
Technical Analysis and Rationale:
The Williams %R is a momentum oscillator that measures the level of the close relative to the high-low range over a specific period, providing insight into whether an asset is trading near its highs or lows. The indicator values range from -100 (most oversold) to 0 (most overbought). When the value falls below -90, it indicates an oversold condition where a reversal is likely (Achelis, 2000). This strategy uses this oversold threshold as a signal to initiate long positions, betting on mean reversion—an established principle in financial markets where prices tend to revert to their historical averages (Jegadeesh & Titman, 1993).
Optimization and Performance:
The strategy allows for an adjustable lookback period (between 2 and 25 days) to determine the range used in the Williams %R calculation. Empirical tests show that shorter lookback periods (e.g., 2 days) yield the most favorable outcomes, with profit factors exceeding 2. This finding aligns with studies suggesting that shorter timeframes can effectively capture short-term momentum reversals (Fama, 1970; Jegadeesh & Titman, 1993).
Scientific Context:
Mean Reversion Theory: The strategy’s core relies on mean reversion, which suggests that prices fluctuate around a mean or average value. Research shows that such strategies, particularly those using oscillators like Williams %R, can exploit these temporary deviations (Poterba & Summers, 1988).
Behavioral Finance: The overbought and oversold conditions identified by Williams %R align with psychological factors influencing trading behavior, such as herding and panic selling, which often create opportunities for price reversals (Shiller, 2003).
Conclusion:
This Williams %R-based strategy utilizes a well-established momentum oscillator to time entries and exits in the S&P 500. By targeting extreme oversold conditions and exiting when these conditions revert or exceed historical ranges, the strategy aims to capture short-term gains. Scientific evidence supports the effectiveness of short-term mean reversion strategies, particularly when using indicators sensitive to momentum shifts.
References:
Achelis, S. B. (2000). Technical Analysis from A to Z. McGraw Hill.
Fama, E. F. (1970). Efficient Capital Markets: A Review of Theory and Empirical Work. The Journal of Finance, 25(2), 383-417.
Jegadeesh, N., & Titman, S. (1993). Returns to Buying Winners and Selling Losers: Implications for Stock Market Efficiency. The Journal of Finance, 48(1), 65-91.
Murphy, J. J. (1999). Technical Analysis of the Financial Markets: A Comprehensive Guide to Trading Methods and Applications. New York Institute of Finance.
Poterba, J. M., & Summers, L. H. (1988). Mean Reversion in Stock Prices: Evidence and Implications. Journal of Financial Economics, 22(1), 27-59.
Shiller, R. J. (2003). From Efficient Markets Theory to Behavioral Finance. Journal of Economic Perspectives, 17(1), 83-104.
Williams, L. (1979). How I Made One Million Dollars… Last Year… Trading Commodities. Windsor Books.
Wilder, J. W. (1978). New Concepts in Technical Trading Systems. Trend Research.
This explanation provides a scientific and evidence-based perspective on the Williams %R trading strategy, aligning it with fundamental principles in technical analysis and behavioral finance.
Dont make me crossStrategy Overview
This trading strategy utilizes Exponential Moving Averages (EMAs) to generate buy and sell signals based on the crossover of two EMAs, which are shifted downwards by 50 points. The strategy aims to identify potential market reversals and trends based on these crossovers.
Components of the Strategy
Exponential Moving Averages (EMAs):
Short EMA: This is calculated over a shorter period (default is 9 periods) and is more responsive to recent price changes.
Long EMA: This is calculated over a longer period (default is 21 periods) and provides a smoother view of the price trend.
Both EMAs are adjusted by a fixed shift amount of -50 points.
Input Parameters:
Short EMA Length: The period used to calculate the short-term EMA. This can be adjusted based on the trader's preference or market conditions.
Long EMA Length: The period used for the long-term EMA, also adjustable.
Shift Amount: A fixed value (default -50) that is subtracted from both EMAs to shift their values downwards. This is useful for visual adjustments or specific strategy requirements.
Plotting:
The adjusted EMAs are plotted on the price chart. The short EMA is displayed in blue, and the long EMA is displayed in red. This visual representation helps traders identify the crossover points easily.
Signal Generation:
Buy Signal: A buy signal is generated when the short EMA crosses above the long EMA. This is interpreted as a bullish signal, indicating potential upward price movement.
Sell Signal: A sell signal occurs when the short EMA crosses below the long EMA, indicating potential downward price movement.
Trade Execution:
When a buy signal is triggered, the strategy enters a long position.
Conversely, when a sell signal is triggered, the strategy enters a short position.
Trading Logic
Market Conditions: The strategy is most effective in trending markets. During sideways or choppy market conditions, it may generate false signals.
Risk Management: While this script does not include explicit risk management features (like stop-loss or take-profit), traders should consider implementing these to manage their risk effectively.
Customization
Traders can customize the EMA lengths and the shift amount based on their analysis and preferences.
The strategy can also be enhanced with additional indicators, such as volume or volatility measures, to filter signals further.
Use Cases
This strategy can be applied to various timeframes, such as intraday, daily, or weekly charts, depending on the trader's style.
It is suitable for both novice and experienced traders, offering a straightforward approach to trading based on technical analysis.
Summary
The EMA Crossover Strategy with a -50 shift is a straightforward technical analysis approach that capitalizes on the momentum generated by the crossover of short and long-term EMAs. By shifting the EMAs downwards, the strategy can help traders visualize potential entry and exit points more clearly, although it's important to consider additional risk management and market context for effective trading.
Simple RSI stock Strategy [1D] The "Simple RSI Stock Strategy " is designed to long-term traders. Strategy uses a daily time frame to capitalize on signals generated by the Relative Strength Index (RSI) and the Simple Moving Average (SMA). This strategy is suitable for low-leverage trading environments and focuses on identifying potential buy opportunities when the market is oversold, while incorporating strong risk management with both dynamic and static Stop Loss mechanisms.
This strategy is recommended for use with a relatively small amount of capital and is best applied by diversifying across multiple stocks in a strong uptrend, particularly in the S&P 500 stock market. It is specifically designed for equities, and may not perform well in other markets such as commodities, forex, or cryptocurrencies, where different market dynamics and volatility patterns apply.
Indicators Used in the Strategy:
1. RSI (Relative Strength Index):
- The RSI is a momentum oscillator used to identify overbought and oversold conditions in the market.
- This strategy enters long positions when the RSI drops below the oversold level (default: 30), indicating a potential buying opportunity.
- It focuses on oversold conditions but uses a filter (SMA 200) to ensure trades are only made in the context of an overall uptrend.
2. SMA 200 (Simple Moving Average):
- The 200-period SMA serves as a trend filter, ensuring that trades are only executed when the price is above the SMA, signaling a bullish market.
- This filter helps to avoid entering trades in a downtrend, thereby reducing the risk of holding positions in a declining market.
3. ATR (Average True Range):
- The ATR is used to measure market volatility and is instrumental in setting the Stop Loss.
- By multiplying the ATR value by a custom multiplier (default: 1.5), the strategy dynamically adjusts the Stop Loss level based on market volatility, allowing for flexibility in risk management.
How the Strategy Works:
Entry Signals:
The strategy opens long positions when RSI indicates that the market is oversold (below 30), and the price is above the 200-period SMA. This ensures that the strategy buys into potential market bottoms within the context of a long-term uptrend.
Take Profit Levels:
The strategy defines three distinct Take Profit (TP) levels:
TP 1: A 5% from the entry price.
TP 2: A 10% from the entry price.
TP 3: A 15% from the entry price.
As each TP level is reached, the strategy closes portions of the position to secure profits: 33% of the position is closed at TP 1, 66% at TP 2, and 100% at TP 3.
Visualizing Target Points:
The strategy provides visual feedback by plotting plotshapes at each Take Profit level (TP 1, TP 2, TP 3). This allows traders to easily see the target profit levels on the chart, making it easier to monitor and manage positions as they approach key profit-taking areas.
Stop Loss Mechanism:
The strategy uses a dual Stop Loss system to effectively manage risk:
ATR Trailing Stop: This dynamic Stop Loss adjusts based on the ATR value and trails the price as the position moves in the trader’s favor. If a price reversal occurs and the market begins to trend downward, the trailing stop closes the position, locking in gains or minimizing losses.
Basic Stop Loss: Additionally, a fixed Stop Loss is set at 25%, limiting potential losses. This basic Stop Loss serves as a safeguard, automatically closing the position if the price drops 25% from the entry point. This higher Stop Loss is designed specifically for low-leverage trading, allowing more room for market fluctuations without prematurely closing positions.
to determine the level of stop loss and target point I used a piece of code by RafaelZioni, here is the script from which a piece of code was taken
Together, these mechanisms ensure that the strategy dynamically manages risk while offering robust protection against significant losses in case of sharp market downturns.
The position size has been estimated by me at 75% of the total capital. For optimal capital allocation, a recommended value based on the Kelly Criterion, which is calculated to be 59.13% of the total capital per trade, can also be considered.
Enjoy !
Commitment of Trader %R StrategyThis Pine Script strategy utilizes the Commitment of Traders (COT) data to inform trading decisions based on the Williams %R indicator. The script operates in TradingView and includes various functionalities that allow users to customize their trading parameters.
Here’s a breakdown of its key components:
COT Data Import:
The script imports the COT library from TradingView to access historical COT data related to different trader groups (commercial hedgers, large traders, and small traders).
User Inputs:
COT data selection mode (e.g., Auto, Root, Base currency).
Whether to include futures, options, or both.
The trader group to analyze.
The lookback period for calculating the Williams %R.
Upper and lower thresholds for triggering trades.
An option to enable or disable a Simple Moving Average (SMA) filter.
Williams %R Calculation: The script calculates the Williams %R value, which is a momentum indicator that measures overbought or oversold levels based on the highest and lowest prices over a specified period.
SMA Filter: An optional SMA filter allows users to limit trades to conditions where the price is above or below the SMA, depending on the configuration.
Trade Logic: The strategy enters long positions when the Williams %R value exceeds the upper threshold and exits when the value falls below it. Conversely, it enters short positions when the Williams %R value is below the lower threshold and exits when the value rises above it.
Visual Elements: The script visually indicates the Williams %R values and thresholds on the chart, with the option to plot the SMA if enabled.
Commitment of Traders (COT) Data
The COT report is a weekly publication by the Commodity Futures Trading Commission (CFTC) that provides a breakdown of open interest positions held by different types of traders in the U.S. futures markets. It is widely used by traders and analysts to gauge market sentiment and potential price movements.
Data Collection: The COT data is collected from futures commission merchants and is published every Friday, reflecting positions as of the previous Tuesday. The report categorizes traders into three main groups:
Commercial Traders: These are typically hedgers (like producers and processors) who use futures to mitigate risk.
Non-Commercial Traders: Often referred to as speculators, these traders do not have a commercial interest in the underlying commodity but seek to profit from price changes.
Non-reportable Positions: Small traders who do not meet the reporting threshold set by the CFTC.
Interpretation:
Market Sentiment: By analyzing the positions of different trader groups, market participants can gauge sentiment. For instance, if commercial traders are heavily short, it may suggest they expect prices to decline.
Extreme Positions: Some traders look for extreme positions among non-commercial traders as potential reversal signals. For example, if speculators are overwhelmingly long, it might indicate an overbought condition.
Statistical Insights: COT data is often used in conjunction with technical analysis to inform trading decisions. Studies have shown that analyzing COT data can provide valuable insights into future price movements (Lund, 2018; Hurst et al., 2017).
Scientific References
Lund, J. (2018). Understanding the COT Report: An Analysis of Speculative Trading Strategies.
Journal of Derivatives and Hedge Funds, 24(1), 41-52. DOI:10.1057/s41260-018-00107-3
Hurst, B., O'Neill, R., & Roulston, M. (2017). The Impact of COT Reports on Futures Market Prices: An Empirical Analysis. Journal of Futures Markets, 37(8), 763-785.
DOI:10.1002/fut.21849
Commodity Futures Trading Commission (CFTC). (2024). Commitment of Traders. Retrieved from CFTC Official Website.
HFT V.2 EnhancedTitle: HFT V.2 Enhanced - ATR Dynamic Stop-Loss & Take-Profit
Description:
The HFT V.2 Enhanced strategy is designed for high-frequency trading with dynamic trade management and robust entry/exit logic. This strategy uses simple moving averages (SMA) for trend identification and the relative strength index (RSI) for momentum confirmation. In this enhanced version, the strategy also incorporates dynamic stop-loss and take-profit levels based on the Average True Range (ATR), offering better adaptability to market volatility.
Features:
Moving Average Crossover: Uses a fast and slow SMA to capture trend reversals and generate trade entries.
RSI Confirmation: Ensures momentum is in the direction of the trade by incorporating the RSI threshold for both long and short entries.
Dynamic Stop-Loss and Take-Profit: Stop-loss and take-profit levels are calculated based on the ATR, allowing the strategy to adjust its exit points according to market volatility. This helps manage risk more effectively and capture larger trends.
Auto-Close Opposing Positions: Automatically closes any open long positions when a short entry is triggered, and vice versa.
Once-Per-Bar Execution: Ensures that a position is entered only once per bar, avoiding multiple trades within the same bar.
Parameters:
Fast MA Length: Defines the length of the fast-moving average.
Slow MA Length: Defines the length of the slow-moving average.
RSI Length: Sets the period for the RSI indicator.
RSI Threshold: Controls the RSI level for confirming momentum (50 by default).
ATR Length: Determines the period for the ATR calculation.
ATR Multiplier for Stop-Loss/Take-Profit: Adjusts the sensitivity of the stop-loss and take-profit levels based on ATR.
How it Works:
Long Entry: The strategy opens a long trade when the fast SMA crosses above the slow SMA, and the RSI is above the user-defined threshold. A dynamic stop-loss is placed below the entry price, and a take-profit target is set based on ATR.
Short Entry: The strategy opens a short trade when the fast SMA crosses below the slow SMA, and the RSI is below the inverse threshold. A stop-loss is placed above the entry price, and a take-profit target is set using ATR.
Risk Management: The strategy adapts to changing market conditions by dynamically adjusting its stop-loss and take-profit levels, ensuring it remains responsive to market volatility.
This script is ideal for traders looking for a high-frequency strategy with advanced trade management, including dynamic exits and volatility-based risk management.
Disclaimer: Always backtest and optimize the parameters to fit your trading style and risk tolerance before using the strategy in live trading.
TASC 2024.10 Adaptive Oscillator Threshold█ OVERVIEW
This script introduces a more dynamic approach to generating trading signals using the RSI indicator and a threshold that adapts to price trends and dispersion. This methodology comes from Francesco Bufi's article "Overbought/Oversold Oscillators: Useless Or Just Misused" from the October 2024 edition of TASC's Traders' Tips .
█ CONCEPTS
According to Francesco Bufi's observations, an oscillator-based buy signal should have a threshold that varies with the trend direction: higher during uptrends and lower during downtrends. Additionally, the level should decrease as the distance from the price to its mean increases to reduce signals in volatile conditions. Accordingly, Bufi proposes a formula for an adaptive buy level whose value is proportional to the trend (linear regression slope) and inversely proportional to the typical distance between price and its mean (standard deviation). Traders can apply this method to any oscillator to add adaptivity without modifying the oscillator's calculations, as it's simply an adaptive technique for interpreting the calculated values.
This script demonstrates the application of Bufi's Adaptive Threshold (BAT) in a simple RSI-based strategy and allows users to compare its performance to the traditional fixed-threshold approach. Bufi's observations suggest that using the BAT instead of a static threshold can help improve the backtest performance of oscillator-based systems.
█ DISCLAIMER
This strategy script educates users on the trading systems outlined by the TASC article. By default, it uses 10% of equity as the order size and a slippage amount of 5 ticks. Traders should adjust these settings and the commission amount when using this script.
Larry Conners SMTP StrategyThe Spent Market Trading Pattern is a strategy developed by Larry Connors, typically used for short-term mean reversion trading. This strategy takes advantage of the exhaustion in market momentum by entering trades when the market is perceived as "spent" after extended trends or extreme moves, expecting a short-term reversal. Connors uses indicators like RSI (Relative Strength Index) and price action patterns to identify these opportunities.
Key Elements of the Strategy:
Overbought/Oversold Conditions: The strategy looks for extreme overbought or oversold conditions, often indicated by low RSI values (below 30 for oversold and above 70 for overbought).
Mean Reversion: Connors believed that markets, especially in short-term scenarios, tend to revert to the mean after periods of strong momentum. The "spent" market is assumed to have expended its energy, making a reversal likely.
Entry Signals:
In an uptrend, a stock or market index making a significant number of consecutive up days (e.g., 5-7 consecutive days with higher closes) indicates overbought conditions.
In a downtrend, a similar number of consecutive down days indicates oversold conditions.
Reversal Anticipation: Once an extreme in price movement is identified (such as consecutive gains or losses), the strategy places trades anticipating a reversion to the mean, which is usually the 5-day or 10-day moving average.
Exit Points: Trades are exited when prices move back toward their mean or when the extreme conditions dissipate, usually based on RSI or moving average thresholds.
Why the Strategy Works:
Human Psychology: The strategy capitalizes on the fact that markets, in the short term, often behave irrationally due to the emotions of traders—fear and greed lead to overextended moves.
Mean Reversion Tendency: Financial markets often exhibit mean-reverting behavior, where prices temporarily deviate from their historical norms but eventually return. Short-term exhaustion after a strong rally or sell-off offers opportunities for quick profits.
Overextended Moves: Markets that rise or fall too quickly tend to become overextended, as buyers or sellers get exhausted, making reversals more probable. Connors’ approach identifies these moments when the market is "spent" and ripe for a reversal.
Risks of the Spent Market Trading Pattern Strategy:
Trend Continuation: One of the key risks is that the market may not revert as expected and instead continues in the same direction. In trending markets, mean-reversion strategies can suffer because strong trends can last longer than anticipated.
False Signals: The strategy relies heavily on technical indicators like RSI, which can produce false signals in volatile or choppy markets. There can be times when a market appears "spent" but continues in its current direction.
Market Timing: Mean reversion strategies often require precise market timing. If the entry or exit points are mistimed, it can lead to losses, especially in short-term trades where small price movements can significantly impact profitability.
High Transaction Costs: This strategy requires frequent trades, which can lead to higher transaction costs, especially in markets with wide bid-ask spreads or high commissions.
Conclusion:
Larry Connors’ Spent Market Trading Pattern strategy is built on the principle of mean reversion, leveraging the concept that markets tend to revert to a mean after extreme moves. While effective in certain conditions, such as range-bound markets, it carries risks—especially during strong trends—where price momentum may not reverse as quickly as expected.
For a more in-depth explanation, Larry Connors’ books such as "Short-Term Trading Strategies That Work" provide a comprehensive guide to this and other strategies .
Tian Di Grid Merge Version 6.0
Strategy Introduction:
1. We know that the exchange can only set a maximum of 100 grids. However, our grid strategy can set a maximum of 350 grids.
2. We have added the modes of proportional and differential warehousing.
3. It should be noted that we have not set any filtering conditions, which means that when the price falls below the grid, we will execute a buy action at the closing price, and when the price falls above the grid, we will execute a sell action;
4. We suggest limiting the trading time cycle to 5 meters, as sometimes errors may appear on TV due to the dense grid or the inability to draw so many grids;
5. Please ensure that the minimum spacing between each grid is not less than 0.1%, as this is extremely difficult to profit from, and on the other hand, it may not function due to excessively dense spacing;
6. The maximum number of grids is 350, and the minimum number is currently 3;
matters needing attention:
Don't choose to go long or short together, and don't choose to go even short or short;
Closing position setting: It is recommended to select it to avoid order accumulation;
Unable to trade: If unable to trade normally, switch to a 1m cycle;
Number of cells: Calculate it yourself, 350 is just the maximum number of cells that can be adjusted;
Grid spacing: minimum 0.1%, below which no profit can be made;
Position value: default is 100u, which is the amount already leveraged;
Multiple investment: The order amount for each order is the same, and there is no need for multiple investment;
Open both long and short positions: You can open multiple positions for one account and open one position for one account. Do not open both long and short positions for the same target at the same time
DCA, Support and Resistance with RSI and Trend FilterThis script is based on
script from Kieranj with added pyramiding and DCA
The buy condition (buyCondition) is triggered when the RSI crosses above the oversold threshold (ta.crossover(rsi, oversoldThreshold)), the trend filter confirms an uptrend (isUptrend is true), and the close price is greater than or equal to the support level (close >= supportLevel).
The partial sell condition (sellCondition) is triggered when the RSI crosses below the overbought threshold (ta.crossunder(rsi, overboughtThreshold)) and profit goal is reached, the trend filter confirms a downtrend (isUptrend is false), and the close price is less than or equal to the resistance level (close <= resistanceLevel).
Full sell will be triggered if trend is broken and profit goal is reached
With this implementation, the signals will only be generated in the direction of the trend on the 4-hour timeframe. The trend is considered up when the 50-period SMA is below the 200-period SMA (ta.sma(trendFilterSource, 50) < ta.sma(trendFilterSource, 200)).
Pyramiding should be activated, values like 100, so every DCA step should be around 1%
i have best results on 5 min charts
Larry Connors %b Strategy (Bollinger Band)Larry Connors’ %b Strategy is a mean-reversion trading approach that uses Bollinger Bands to identify buy and sell signals based on the %b indicator. This strategy was developed by Larry Connors, a renowned trader and author known for his systematic, data-driven trading methods, particularly those focusing on short-term mean reversion.
The %b indicator measures the position of the current price relative to the Bollinger Bands, which are volatility bands placed above and below a moving average. The strategy specifically targets times when prices are oversold within a long-term uptrend and aims to capture rebounds by buying at relatively low points and selling at relatively high points.
Strategy Rules
The basic rules of the %b Strategy are:
1. Trend Confirmation: The closing price must be above the 200-day moving average. This filter ensures that trades are made in alignment with a longer-term uptrend, thereby avoiding trades against the primary market trend.
2. Oversold Conditions: The %b indicator must be below 0.2 for three consecutive days. The %b value below 0.2 indicates that the price is near the lower Bollinger Band, suggesting an oversold condition.
3. Entry Signal: Enter a long position at the close when conditions 1 and 2 are met.
4. Exit Signal: Exit the position when the %b value closes above 0.8, signaling an overbought condition where the price is near the upper Bollinger Band.
How the Strategy Works
This strategy operates on the premise of mean reversion, which suggests that extreme price movements will revert to the mean over time. By entering positions when the %b value indicates an oversold condition (below 0.2) in a confirmed uptrend, the strategy attempts to capture short-term price rebounds. The exit rule (when %b is above 0.8) aims to lock in profits once the price reaches an overbought condition, often near the upper Bollinger Band.
Who Was Larry Connors?
Larry Connors is a well-known figure in the world of financial markets and trading. He co-authored several influential trading books, including “Short-Term Trading Strategies That Work” and “High Probability ETF Trading.” Connors is recognized for his quantitative approach, focusing on systematic, rules-based strategies that leverage historical data to validate trading edges.
His work primarily revolves around short-term trading strategies, often using technical indicators like RSI (Relative Strength Index), Bollinger Bands, and moving averages. Connors’ methodologies have been widely adopted by traders seeking structured approaches to exploit short-term inefficiencies in the market.
Risks of the Strategy
While the %b Strategy can be effective, particularly in mean-reverting markets, it is not without risks:
1. Mean Reversion Assumption: The strategy is based on the assumption that prices will revert to the mean. In trending or sharply falling markets, this reversion may not occur, leading to sustained losses.
2. False Signals in Choppy Markets: In volatile or sideways markets, the strategy may generate multiple false signals, resulting in whipsaw trades that can erode capital through frequent small losses.
3. No Stop Loss: The basic implementation of the strategy does not include a stop loss, which increases the risk of holding losing trades longer than intended, especially if the market continues to move against the position.
4. Performance During Market Crashes: During major market downturns, the strategy’s buy signals could be triggered frequently as prices decline, compounding losses without the presence of a risk management mechanism.
Scientific References and Theoretical Basis
The %b Strategy relies on the concept of mean reversion, which has been extensively studied in finance literature. Studies by Avellaneda and Lee (2010) and Bouchaud et al. (2018) have demonstrated that mean-reverting strategies can be profitable in specific market environments, particularly when combined with volatility filters like Bollinger Bands. However, the same studies caution that such strategies are highly sensitive to market conditions and often perform poorly during periods of prolonged trends.
Bollinger Bands themselves were popularized by John Bollinger and are widely used to assess price volatility and detect potential overbought and oversold conditions. The %b value is a critical part of this analysis, as it standardizes the position of price relative to the bands, making it easier to compare conditions across different securities and time frames.
Conclusion
Larry Connors’ %b Strategy is a well-known mean-reversion technique that leverages Bollinger Bands to identify buying opportunities in uptrending markets when prices are temporarily oversold. While the strategy can be effective under the right conditions, traders should be aware of its limitations and risks, particularly in trending or highly volatile markets. Incorporating risk management techniques, such as stop losses, could help mitigate some of these risks, making the strategy more robust against adverse market conditions.