OPEN-SOURCE SCRIPT
Telah dikemas kini

Multi-Timeframe Parabolic SAR Strategy ver 1.0

532
Multi-Timeframe Parabolic SAR Strategy (MTF PSAR) - Enhanced Trend Trading


This strategy leverages the power of the Parabolic SAR (Stop and Reverse) indicator across multiple timeframes to provide robust trend identification, precise entry/exit signals, and dynamic trailing stop management. By combining the insights of both the current chart's timeframe and a user-defined higher timeframe, this strategy aims to improve trading accuracy, reduce risk, and capture more significant market moves.

Key Features:

Dual Timeframe Analysis: Simultaneously analyzes the Parabolic SAR on the current chart and a higher timeframe (e.g., Daily PSAR on a 1-hour chart). This allows you to align your trades with the dominant trend and filter out noise from lower timeframes.

Configurable PSAR: Fine-tune the PSAR calculation with adjustable Start, Increment, and Maximum values to optimize sensitivity for your trading style and the asset's volatility.

Independent Timeframe Control: Choose to display and trade based on either or both the current timeframe PSAR and the higher timeframe PSAR. Focus on the most relevant information for your analysis.

Clear Visual Signals: Distinct colors for the current and higher timeframe PSAR dots provide a clear visual representation of potential entry and exit points.

Multiple Entry Strategies: The strategy offers flexible entry conditions, allowing you to trade based on:

Confirmation: Both current and higher timeframe PSAR signals agree and the current timeframe PSAR has just flipped direction. (Most conservative)

Current Timeframe Only: Trades based solely on the current timeframe PSAR, ideal for when the higher timeframe is less relevant or disabled.

Higher Timeframe Only: Trades based solely on the higher timeframe PSAR.

Dynamic Trailing Stop (PSAR-Based): Implements a trailing stop-loss based on the current timeframe's Parabolic SAR. This helps protect profits by automatically adjusting the stop-loss as the price moves in your favor. Exits are triggered when either the current or HTF PSAR flips.

No Repainting: Uses lookahead=barmerge.lookahead_off in the security() function to ensure that the higher timeframe data is accessed without any data leakage, preventing repainting issues.

Fully Configurable: All parameters (PSAR settings, higher timeframe, visibility, colors) are adjustable through the strategy's settings panel, allowing for extensive customization and optimization.

Suitable for Various Trading Styles: Applicable to swing trading, day trading, and trend-following strategies across various markets (stocks, forex, cryptocurrencies, etc.).

How it Works:

PSAR Calculation: The strategy calculates the standard Parabolic SAR for both the current chart's timeframe and the selected higher timeframe.

Trend Identification: The direction of the PSAR (dots below price = uptrend, dots above price = downtrend) determines the current trend for each timeframe.

Entry Signals: The strategy generates buy/sell signals based on the chosen entry strategy (Confirmation, Current Timeframe Only, or Higher Timeframe Only). The Confirmation strategy offers the highest probability signals by requiring agreement between both timeframes.

Trailing Stop Exit: Once a position is entered, the strategy uses the current timeframe PSAR as a dynamic trailing stop. The stop-loss is automatically adjusted as the PSAR dots move, helping to lock in profits and limit losses. The strategy exits when either the Current or HTF PSAR changes direction.

Backtesting and Optimization: The strategy automatically backtests on the chart's historical data, allowing you to evaluate its performance and optimize the settings for different assets and timeframes.

Example Use Cases:

Trend Confirmation: A trader on a 1-hour chart observes a bullish PSAR flip on the current timeframe. They check the MTF PSAR strategy and see that the Daily PSAR is also bullish, confirming the strength of the uptrend and providing a high-probability long entry signal.

Filtering Noise: A trader on a 5-minute chart wants to avoid whipsaws caused by short-term price fluctuations. They use the strategy with a 1-hour higher timeframe to filter out noise and only trade in the direction of the dominant trend.

Dynamic Risk Management: A trader enters a long position and uses the current timeframe PSAR as a trailing stop. As the price rises, the PSAR dots move upwards, automatically raising the stop-loss and protecting profits. The trade is exited when the current (or HTF) PSAR flips to bearish.

Disclaimer:

The Parabolic SAR is a lagging indicator and can produce false signals, particularly in ranging or choppy markets. This strategy is intended for educational and informational purposes only and should not be considered financial advice. It is essential to backtest and optimize the strategy thoroughly, use it in conjunction with other technical analysis tools, and implement sound risk management practices before using it with real capital. Past performance is not indicative of future results. Always conduct your own due diligence and consider your risk tolerance before making any trading decisions.
Nota Keluaran
This is the Version 6 update of my PSAR MTF Strategy.

Best use to apply Higher Timeframe filter and trades their PSAR changes on current timeframe.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.