Modular Trend Pullback Strategy by AIScripts
By AIScripts
Performance Metrics
- Author: AIScripts
- Symbol: BMV:AVGO
- Timeframe: 3 minutes
- Net P&L: +457.46 MXN (+0.46%)
- Win Rate: 38.1%
- Profit Factor: 1.043
- Max Drawdown: 2,187.74 MXN (2.13%)
- Total Trades: 215
Description
This strategy focuses on trading pullbacks within established trends. Instead of entering immediately when a trend forms, it waits for a temporary retracement and then looks for confirmation before placing a trade. The goal is to improve entry timing while keeping risk controlled.Core IdeaMarkets often move in waves. During a strong trend, price tends to retrace toward a short-term average before continuing in the dominant direction. This script attempts to participate in those continuation moves.How It Works1. Trend IdentificationTwo exponential moving averages (EMAs) define direction.Fast EMA above Slow EMA → bullish environmentFast EMA below Slow EMA → bearish environment2. Pullback ConditionIn an uptrend, price must retrace below the fast EMA.In a downtrend, price must retrace above the fast EMA.This avoids chasing extended moves.3. Break ConfirmationAfter a pullback, the strategy waits for price to break the previous candle’s high (for longs) or low (for shorts).This acts as confirmation that momentum is returning in the direction of the trend.4. Risk ManagementStop-loss and take-profit levels are based on ATR (Average True Range), allowing exits to adapt to current volatility.A configurable risk-reward ratio defines profit targets.Key FeaturesNon-repainting logicEntries only when flat (no stacking positions)ATR-based dynamic stop and target levelsCommission and slippage included for more realistic backtestsStructured, modular logic for easier testing and adjustmentSuitable Market ConditionsThis type of approach generally performs best in:Trending environmentsInstruments with sustained directional movementTimeframes where pullbacks are clearly visibleIt may underperform in sideways or low-volatility markets.NotesThis script is intended for research and testing purposes. Results will vary depending on symbol, timeframe, and market regime. Always evaluate performance across multiple market conditions before considering live execution.