OPEN-SOURCE SCRIPT
Telah dikemas kini MVO Strategy Full

Beter if used with Heikin Ashi Candles chart
Overview
This strategy is an enhanced version of a Heikin Ashi-based trading system that enters long positions on the second consecutive green Heikin Ashi candle (when the current candle is larger than the previous one) and exits on the first red Heikin Ashi candle. The strategy incorporates advanced risk management, trend filtering, volume confirmation, and time-based restrictions to improve trade reliability and performance. It is designed for traders seeking a trend-following approach with robust risk controls.
Strategy Logic
• Entry Condition:
• Enters a long position when:
• The previous Heikin Ashi candle is green.
• The current Heikin Ashi candle is green and larger than the previous one.
• The price is above a 50-period Simple Moving Average (SMA) to confirm a bullish trend.
• Volume exceeds the 10-period SMA of volume to ensure market conviction.
• The trade occurs within specified trading hours (default: 9 AM to 5 PM UTC).
• No open trades exist.
• Exit Condition:
• Exits the long position on the first red Heikin Ashi candle.
• Optional stop-loss and take-profit levels (based on ATR) can trigger an exit if hit before a red candle.
• An optional trailing stop can be enabled to lock in profits during strong trends.
• Risk Management:
• Uses a dynamic stop-loss and take-profit based on the 14-period Average True Range (ATR).
• Default position size is 10% of equity to limit risk exposure.
• Visualization:
• Plots Heikin Ashi candles, the trend SMA, stop-loss, and take-profit levels.
• Displays “BUY” and “SELL” labels for trade entries and exits.
• Shows closed trade profits as a histogram for performance tracking.
Inputs
• Stop Loss ATR Multiplier (Default: 2.0): Sets the stop-loss distance as a multiple of ATR.
• Take Profit ATR Multiplier (Default: 3.0): Sets the take-profit distance as a multiple of ATR.
• Use Trailing Stop (Default: False): Enables/disables a trailing stop.
• Trailing Stop ATR Multiplier (Default: 1.5): Sets the trailing stop distance as a multiple of ATR.
• Trend MA Length (Default: 50): Length of the SMA used for trend filtering.
• Use Trading Hours Filter (Default: True): Restricts trading to specified hours.
• Start Hour (UTC) (Default: 9): Start of allowed trading hours.
• End Hour (UTC) (Default: 17): End of allowed trading hours.
Features
• Trend Filter: Ensures entries align with a bullish trend (price above SMA).
• Volume Confirmation: Requires above-average volume for entries to confirm market strength.
• Time Filter: Avoids trading during low-liquidity periods (e.g., outside major market hours).
• Dynamic Risk Management: ATR-based stop-loss and take-profit adjust to market volatility.
• Optional Trailing Stop: Captures larger profits in trending markets when enabled.
• Enhanced Visualization: Clear plots and labels for easy trade monitoring.
Usage Instructions
1. Apply to Chart: Add the strategy to your TradingView chart.
2. Adjust Inputs: Customize the ATR multipliers, SMA length, and trading hours based on your market and timeframe.
3. Backtest: Test the strategy on your chosen market (e.g., forex, stocks, crypto) and timeframe (e.g., 1H, 4H, Daily).
4. Optimize Parameters: Experiment with input settings to maximize performance for your market.
5. Monitor Trades: Use the plotted SMA, stop-loss, take-profit, and trade labels to track strategy behavior.
6. Consider Market Conditions: The strategy performs best in trending markets. Consider adding an ADX filter for choppy markets.
Notes
• Markets and Timeframes: Test the strategy across different markets and timeframes to ensure robustness.
• Risk Management: The default 10% equity position size and ATR-based stops help manage risk, but adjust based on your risk tolerance.
• Trading Hours: Modify Start Hour and End Hour to match your market’s active sessions (e.g., London/New York for forex).
• Commissions and Slippage: Include realistic commission and slippage in backtests for accurate results.
• Limitations: The red candle exit may lead to early exits in choppy markets. Consider enabling the trailing stop for trending conditions.
Example Use Case
• Forex (EUR/USD, 1H): Set Start Hour to 8 and End Hour to 17 to trade during London/New York sessions. Adjust Stop Loss ATR Multiplier to 1.5 and Take Profit ATR Multiplier to 3.0 for tighter risk control.
• Crypto (BTC/USD, 4H): Enable the trailing stop for trending markets and increase Trend MA Length to 100 for smoother trend filtering.
Disclaimer
This strategy is for educational purposes only and does not constitute financial advice. Always backtest and validate the strategy with your own risk management rules before trading with real capital.
Overview
This strategy is an enhanced version of a Heikin Ashi-based trading system that enters long positions on the second consecutive green Heikin Ashi candle (when the current candle is larger than the previous one) and exits on the first red Heikin Ashi candle. The strategy incorporates advanced risk management, trend filtering, volume confirmation, and time-based restrictions to improve trade reliability and performance. It is designed for traders seeking a trend-following approach with robust risk controls.
Strategy Logic
• Entry Condition:
• Enters a long position when:
• The previous Heikin Ashi candle is green.
• The current Heikin Ashi candle is green and larger than the previous one.
• The price is above a 50-period Simple Moving Average (SMA) to confirm a bullish trend.
• Volume exceeds the 10-period SMA of volume to ensure market conviction.
• The trade occurs within specified trading hours (default: 9 AM to 5 PM UTC).
• No open trades exist.
• Exit Condition:
• Exits the long position on the first red Heikin Ashi candle.
• Optional stop-loss and take-profit levels (based on ATR) can trigger an exit if hit before a red candle.
• An optional trailing stop can be enabled to lock in profits during strong trends.
• Risk Management:
• Uses a dynamic stop-loss and take-profit based on the 14-period Average True Range (ATR).
• Default position size is 10% of equity to limit risk exposure.
• Visualization:
• Plots Heikin Ashi candles, the trend SMA, stop-loss, and take-profit levels.
• Displays “BUY” and “SELL” labels for trade entries and exits.
• Shows closed trade profits as a histogram for performance tracking.
Inputs
• Stop Loss ATR Multiplier (Default: 2.0): Sets the stop-loss distance as a multiple of ATR.
• Take Profit ATR Multiplier (Default: 3.0): Sets the take-profit distance as a multiple of ATR.
• Use Trailing Stop (Default: False): Enables/disables a trailing stop.
• Trailing Stop ATR Multiplier (Default: 1.5): Sets the trailing stop distance as a multiple of ATR.
• Trend MA Length (Default: 50): Length of the SMA used for trend filtering.
• Use Trading Hours Filter (Default: True): Restricts trading to specified hours.
• Start Hour (UTC) (Default: 9): Start of allowed trading hours.
• End Hour (UTC) (Default: 17): End of allowed trading hours.
Features
• Trend Filter: Ensures entries align with a bullish trend (price above SMA).
• Volume Confirmation: Requires above-average volume for entries to confirm market strength.
• Time Filter: Avoids trading during low-liquidity periods (e.g., outside major market hours).
• Dynamic Risk Management: ATR-based stop-loss and take-profit adjust to market volatility.
• Optional Trailing Stop: Captures larger profits in trending markets when enabled.
• Enhanced Visualization: Clear plots and labels for easy trade monitoring.
Usage Instructions
1. Apply to Chart: Add the strategy to your TradingView chart.
2. Adjust Inputs: Customize the ATR multipliers, SMA length, and trading hours based on your market and timeframe.
3. Backtest: Test the strategy on your chosen market (e.g., forex, stocks, crypto) and timeframe (e.g., 1H, 4H, Daily).
4. Optimize Parameters: Experiment with input settings to maximize performance for your market.
5. Monitor Trades: Use the plotted SMA, stop-loss, take-profit, and trade labels to track strategy behavior.
6. Consider Market Conditions: The strategy performs best in trending markets. Consider adding an ADX filter for choppy markets.
Notes
• Markets and Timeframes: Test the strategy across different markets and timeframes to ensure robustness.
• Risk Management: The default 10% equity position size and ATR-based stops help manage risk, but adjust based on your risk tolerance.
• Trading Hours: Modify Start Hour and End Hour to match your market’s active sessions (e.g., London/New York for forex).
• Commissions and Slippage: Include realistic commission and slippage in backtests for accurate results.
• Limitations: The red candle exit may lead to early exits in choppy markets. Consider enabling the trailing stop for trending conditions.
Example Use Case
• Forex (EUR/USD, 1H): Set Start Hour to 8 and End Hour to 17 to trade during London/New York sessions. Adjust Stop Loss ATR Multiplier to 1.5 and Take Profit ATR Multiplier to 3.0 for tighter risk control.
• Crypto (BTC/USD, 4H): Enable the trailing stop for trending markets and increase Trend MA Length to 100 for smoother trend filtering.
Disclaimer
This strategy is for educational purposes only and does not constitute financial advice. Always backtest and validate the strategy with your own risk management rules before trading with real capital.
Nota Keluaran
version upgradeSkrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
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.