MACD + 200 EMA + Support/Resistance Strategy by Phantom_Trader_Global

By Phantom_Trader_Global

Performance Metrics

Description

This open-source strategy is an educational Pine Script implementation of a MACD + 200 EMA + support/resistance trading concept.It was created to convert a visually explained strategy idea into clear, testable rules, so traders can study how the logic behaves under backtesting conditions.The strategy combines three main components:1. MACD momentum logic2. A 200 EMA trend filter3. A pivot-based support and resistance filterFor long setups, the strategy looks for a bullish MACD crossover below the zero line, while price is above the 200 EMA.For short setups, the strategy looks for a bearish MACD crossover above the zero line, while price is below the 200 EMA.A support and resistance filter can also be enabled. This filter uses confirmed pivot levels, wick-based touches, ATR-based tolerance, and a maximum level age to create a more objective interpretation of support and resistance behavior.Main features:- MACD default settings- 200 EMA trend filter- Optional pivot-based support and resistance filter- Confirmed pivots only- Wick-based touch detection- ATR-based tolerance- Long and short logic- Multiple stop-loss modes- Risk/reward based take-profit logic- Optional pyramiding controls- Strategy backtesting supportStop-loss logic:The script includes more than one stop-loss interpretation because the original concept does not define the stop placement with full precision.Stop option 1:A stop placed above or below the 200 EMA by a user-defined number of ticks.Stop option 2:A stop placed at the nearest valid swing within a user-defined lookback window. If no valid swing is found, the script falls back to the EMA-based stop.Take-profit logic:The take-profit target is calculated using a fixed risk/reward multiple based on the distance between entry and stop-loss.Default risk/reward:1.5RExecution assumptions:- Entries are placed on the next candle open after the signal bar.- Exits are handled through stop-loss and take-profit only.- MACD is calculated on close.- EMA is calculated on close.- Support and resistance levels are based on confirmed pivots only.- The strategy is designed for educational backtesting and research, not for automatic live trading.Important backtesting notes:Backtest results can vary significantly depending on the symbol, timeframe, commission, slippage, spread, data provider, and strategy settings.Users should always adjust commission and slippage settings to match the market being tested. A zero-cost setup may produce unrealistic results.This script does not guarantee profitability, future performance, or a specific win rate.This is not the original creator’s code. It is a testable logical interpretation of the strategy idea, built by converting unclear visual rules into explicit Pine Script conditions.If you believe a different interpretation of the unclear parts would be more accurate, you can modify the open-source code and test your own version.Disclaimer:This script is provided for educational and research purposes only. It is not financial advice, investment advice, or a recommendation to buy, sell, short, or trade any asset.Trading involves risk. Past performance and backtested results do not guarantee future results. Always do your own research and test thoroughly before using any strategy in live market conditions.No strategy, indicator, or backtest can guarantee profits or eliminate trading risk.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView