Enhanced Gold Scalping Strategy (Backtest with Time Filter) This script is a scalping strategy designed specifically for trading gold on lower timeframes, incorporating popular technical indicators and a session filter for optimal performance. The strategy aims to achieve consistency by combining trend-following and volatility-based conditions.
Key Features: Indicators Used:
Exponential Moving Average (EMA): Filters trades based on the trend direction using a 50-period EMA. Relative Strength Index (RSI): Ensures trades are taken in favorable momentum conditions (above 30 for longs and below 70 for shorts). MACD Crossover: Identifies potential trade entries based on MACD line crossing above/below the signal line. Average True Range (ATR): Used to dynamically calculate Stop Loss and Take Profit levels and ensure trades occur in high-volatility conditions. Risk-Reward Optimization:
The strategy uses a customizable Risk-Reward Ratio (default is 2:1) for setting Stop Loss (SL) and Take Profit (TP) levels, ensuring that winning trades outweigh losses. Volatility Filter:
Trades are only executed when the current ATR exceeds the 14-period ATR moving average by a defined threshold, filtering out low-volatility periods. Session Filter:
The strategy only trades during active market hours (8:00 AM to 8:00 PM Amsterdam Time) on weekdays. This ensures trades align with periods of high liquidity and market activity. Dynamic Entry and Exit Levels:
SL and TP levels are plotted dynamically on the chart to provide a clear visual of potential risk and reward for each trade. Buy and Sell Signals:
Visual markers (green triangles for buy, red triangles for sell) on the chart to highlight entry points for better trade visibility. How It Works: Long Conditions:
MACD crossover (MACD line above the signal line). RSI above 30. Price is above the 50-period EMA. ATR-based volatility condition is met. Trade must occur within the defined session hours. Short Conditions:
MACD crossunder (MACD line below the signal line). RSI below 70. Price is below the 50-period EMA. ATR-based volatility condition is met. Trade must occur within the defined session hours. The strategy calculates dynamic SL and TP levels based on the ATR, ensuring flexibility to market conditions.
Customization Options: EMA length, RSI length, and MACD parameters. Risk-Reward Ratio for SL/TP calculations. Volatility threshold for filtering trades. Session start and end times for active trading hours. Recommended Use: Best suited for scalping gold on lower timeframes (15-min charts).
Disclaimer: This strategy is intended for educational and backtesting purposes. Past performance is not indicative of future results. Use appropriate risk management and test thoroughly before applying to live trading.
Этот скрипт опубликован с закрытым исходным кодом, вы можете свободно им пользоваться. Можно добавить его в избранное и использовать на графике. Вы не можете просматривать или менять его исходный код.
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.