This is an example Pine Script v5 strategy template that combines trend-following logic with an automated drawdown check. The script uses a 200 EMA filter and RSI threshold for entries, along with adjustable stop-loss/take-profit parameters. It also includes a dynamic drawdown tracker that closes all positions if total strategy drawdown exceeds 30%.