Auditable Trend Continuation: Operationalizing Price-Action Discretion
Discretionary traders often describe setups using qualitative language: "strong uptrend", "clean pullback", "support looks solid". Such descriptions cannot be backtested directly, and without testing, it is impossible to distinguish genuine edges from post-hoc pattern-finding. This paper demonstrates how to translate one discretionary observation, trend continuation off pullback recovery, into precise mechanical rules suitable for automated analysis. The underlying methodology applies to any subjective trading intuition: specification forces clarity, eliminates hindsight bias in rule selection, and enables honest evaluation.
Why this might work
Trend-following strategies have generated documented evidence of persistent returns across asset classes, time horizons, and geographic markets [1]. The mechanism is straightforward: momentum and information cascades drive sustained directional moves. Behavioral factors, technical stop placement, and feedback loops reinforce trends in the near term.
Within a trend, pullbacks are common, temporary reversals of 30-50% that present lower-risk entry points if the dominant direction is intact [2]. Practitioners observe that pullbacks often stop at intermediate support or resistance levels and resume the original trend. The intuition is mechanical: if an uptrend has established two higher highs separated by a higher low, then a pullback that holds that intermediate low signals trend continuation when broken to the upside.
However, "strong uptrend," "solid support," and "good pullback setup" lack precision. A trader perceiving these conditions in real time would struggle to specify the rules for a computer to apply automatically and without judgment. This is where specification becomes critical: it forces conceptual clarity and prevents selection bias. A trader might test ten definitions of "pullback" and choose whichever one backtests best, unknowingly fitting rules to past data. A specification written before any backtest avoids this bias and reveals whether the intuition has substance.
The strategy presented here uses price action structure: uptrends identified via simple moving averages, pullbacks marked by temporary dips below a shorter-period SMA, and entries triggered on pullback recovery above that level. No judgment calls. Whether these particular rules generate profit is an empirical question this paper does not answer; rules are stated untested.
The rules
Instrument and timeframe: EUR/USD foreign exchange pair, 4-hour chart. This highly liquid market has low transaction costs and sufficient volatility to generate ~150-200 annual signals on this timeframe, adequate for statistical validation.
Uptrend definition: A close above the 50-period simple moving average (SMA) for at least two consecutive bars signals an uptrend environment.
Pullback onset: A pullback begins when the close falls below the 20-period SMA while an uptrend is in place.
Pullback recovery: A pullback is considered complete and exited when the close returns above the 20-period SMA on any bar.
Entry trigger: Place a buy order at the market on the bar when a pullback recovery occurs, provided the close is still above the 50-period SMA and no position is currently open. Entry price is the close of the signal bar.
Stop-loss placement: Set the stop-loss one-half pip (0.0005 in four-digit notation) below the lowest low recorded during the pullback phase.
Profit target: Calculate risk as entry price minus stop-loss. Set the profit target at entry price plus (risk × 2), implementing a 2:1 risk-to-reward ratio.
Position sizing: Risk exactly 2% of account equity on each trade. Determine position size as: (0.02 × account balance) / (stop-loss distance in price units × 10,000).
Session and time filters: Enter trades only between 08:00 and 20:00 UTC to avoid low-liquidity sessions. Do not initiate new positions on Friday after 16:00 UTC to prevent weekend holding of overnight positions. Avoid trading 30 minutes before and 30 minutes after the FOMC rate decision (check the Federal Reserve calendar [3] for exact dates and times).
Exit rules: Exit when the profit target is hit, or when the stop-loss is triggered, or 18 bars (3 days on a 4-hour chart) have elapsed without reaching the target, exit at the market to conserve capital for the next signal.
Position limit: Only one active long position at a time; do not stack multiple trades.
Pine Script Implementation
//@version=6
strategy("Auditable Trend Continuation", overlay=true,
default_qty_type=strategy.percent_of_equity, default_qty_value=2,
commission_type=strategy.commission.percent, commission_value=0.001,
slippage=2)
// ===== INPUTS =====
sma_trend_len = input(50, "Trend SMA Length")
sma_pull_len = input(20, "Pullback SMA Length")
risk_reward_mul = input(2.0, "Risk-Reward Multiplier")
max_hold_bars = input(18, "Max Hold Bars")
risk_pct = input(2.0, "Risk % of Equity")
stop_offset = input(0.0005, "Stop Offset (pips as decimal)")
// Time filters
start_hour = input(8, "Start Hour UTC")
end_hour = input(20, "End Hour UTC")
// ===== CALCULATIONS =====
sma50 = ta.sma(close, sma_trend_len)
sma20 = ta.sma(close, sma_pull_len)
// Trend condition: close above 50 SMA for at least 2 consecutive bars
in_trend = close > sma50 and close[1] > sma50
// Pullback: close below 20 SMA
in_pullback = close < sma20
// Pullback recovery: close crosses above 20 SMA
pull_exit = ta.crossover(close, sma20)
// Track the lowest low during pullback
var float pullback_low = high
if in_pullback
pullback_low := math.min(pullback_low, low)
// Entry signal: pullback recovery + uptrend intact + no position open
entry_signal = pull_exit and in_trend and strategy.position_size == 0
// Session filter
in_session = hour >= start_hour and hour <= end_hour
// ===== TRADE LOGIC =====
if entry_signal and in_session
// Calculate stop and target
stop_level = pullback_low - stop_offset
risk_distance = close - stop_level
target_level = close + (risk_distance * risk_reward_mul)
position_qty = (strategy.equity * risk_pct / 100) / (risk_distance * 10000)
// Enter position
strategy.entry("Long", strategy.long, qty=position_qty)
// Set exit conditions (both triggered on same position)
strategy.exit("Exit", "Long", stop=stop_level, limit=target_level)
// Reset pullback low for next cycle
pullback_low := high
// Time-based exit after max hold
if strategy.position_size > 0
if ta.barssince(strategy.opentrades.entry_bar_index(0)) >= max_hold_bars
strategy.close("Long", comment="Time exit")
// ===== VISUALIZATION =====
plot(sma50, "50 SMA Trend", color=color.blue, linewidth=2)
plot(sma20, "20 SMA Pullback", color=color.orange, linewidth=1)
// Highlight entry signal bars
bgcolor(entry_signal and in_session ? color.new(color.green, 90) : na)
bgcolor(entry_signal and not in_session ? color.new(color.red, 90) : na)
How the code works
The strategy calculates two simple moving averages on each bar: the 50-period (trend) and 20-period (pullback recovery level). An uptrend is confirmed when the close is above the 50-period SMA and the prior bar's close was also above it, reducing false signals during choppy price action.
A pullback begins when the close drops below the 20-period SMA. The strategy tracks the lowest low while below this SMA using the pullback_low variable, which accumulates the minimum low of the pullback phase.
When the close crosses above the 20-period SMA (detected via ta.crossover(close, sma20)), a pullback recovery signal fires. The code checks that an uptrend is still in place and no position is open, then initiates a long trade at the market price on that bar.
The stop-loss is placed one-half pip below the recorded pullback low. Risk is calculated as entry price minus stop. The profit target is set at entry price plus (risk × 2), implementing the 2:1 ratio. Position size is derived from 2% of account equity divided by the stop distance, scaling automatically with account size and volatility.
The strategy.exit() call sets both stop and limit prices, triggering a close when either level is hit. The time-based exit triggers after 18 bars have elapsed without reaching the target, preserving capital.
Commission is set to 0.001 (0.1% per round-trip) and slippage to 2 pips, realistic for EUR/USD on standard retail forex brokers [4]. The code includes green/red background highlighting of entry signals, green when in session and red when time filters block entry.
Testing it honestly
To evaluate this strategy, follow a disciplined backtesting procedure:
-
In-sample test: Run the strategy on 3-5 years of historical data from a specific prior period (e.g., 2016-2020). Record total trades, win rate, profit factor, maximum drawdown, and return.
-
Out-of-sample test: Run the same rules with no changes on a held-out period (e.g., 2021-2024) that was not used to develop or tune the rules. This period must be contiguous and recent.
-
Realistic costs: Commission and slippage are set as above. Retail forex often inflates slippage during volatile news events; consider a stress test with 5-pip slippage.
-
Minimum sample size: Fifty trades prove almost nothing due to variance. Aim for at least 150-200 out-of-sample trades before forming any opinion. A 60% win rate with 2:1 risk-reward is still consistent with pure chance over a small sample.
-
Cross-instrument validation: Test on GBP/USD, USD/JPY, AUD/USD, and other liquid pairs. If the strategy works only on EUR/USD, it is likely overfit to that instrument's recent price action. A solid system should show similar results across multiple liquid forex pairs.
-
Regime filter absent: This strategy has no market regime filter (trending vs. range-bound). Performance will likely degrade sharply during choppy consolidations. Testing should separately report results in strongly trending vs. ranging periods.
-
No live validation: Backtesting is necessary but not sufficient. The only proof of a strategy's edge is consistent live profitability over months or years. A good backtest is a hypothesis, not evidence.
Limitations
This strategy has several material limitations:
Specification bias: The thresholds (50-period SMA, 20-period SMA, 2:1 risk-reward, 2% risk per trade, 0.0005-pip stop) were chosen without optimization against historical data, reducing but not eliminating the risk of curve-fitting. A proper research process would optimize parameters on a training set, then validate on a hold-out set before claiming the rules have merit. This paper presents the rules raw and untested.
Regime dependence: Trend-following strategies typically perform well in markets with persistent directional moves but suffer in sideways, range-bound regimes. EUR/USD has extended consolidation periods (e.g., 2014-2015) where the 50-period SMA chops back and forth, generating frequent false entry signals. Testing on the full data set without regime filtering will understate true performance in trending periods and overstate it in mean-reverting ones.
Cost structure: Forex transaction costs, bid-ask spread, commission, slippage, and funding charges, are non-trivial. Real EUR/USD spreads range from 1-3 pips on standard accounts, and slippage during news events can reach 5-10 pips. The 0.1% commission and 2-pip slippage assumption may underestimate real costs, reducing or eliminating the edge entirely.
No optimization discipline: Parameters were set arbitrarily without data. Different SMA lengths, risk-reward ratios, and stop offsets will produce vastly different results. The strategy as written has no claim to optimality. A trader testing this should run parameter scans and then validate on completely separate data.
Missing live evidence: This strategy has not been backtested, walk-forward tested, or traded live. No performance data is presented. The paper demonstrates a methodology (specifying discretionary rules precisely) but provides zero evidence that this particular rule set is profitable. The strategy is untested by design.
Overfitting risk: Any backtest of a strategy optimized to historical data is unreliable. Out-of-sample testing reduces but does not eliminate this risk. A strategy that works perfectly on 10 years of EUR/USD data may fail immediately after deployment due to regime shift, evolving trader behavior, or random variance.
Survivor bias in discretion: Experienced traders may believe pullback continuations are reliable because they consciously trade only the setups that "feel right" in real time. Mechanically, they skip ambiguous setups and count only successful trades, a form of selection bias. Mechanical rules reveal the full distribution of outcomes, which is often far worse than felt experience suggests.
Key definitions
Pullback: A temporary reversal of price against the dominant trend direction, typically retracing 30-50% of the prior leg before the trend resumes.
Risk-reward ratio: The ratio of potential loss (distance to stop-loss) to potential profit (distance to target); a 2:1 ratio means the target distance is twice the stop distance.
Simple moving average (SMA): The arithmetic average of closing prices over the past N bars; used here as a trend filter and pullback level.
Swing high/low: A local price peak or trough, typically defined as a bar's high/low greater than the highs/lows of bars immediately before and after it; indicates structure in the price action.
Support level: A price level where buying pressure has historically emerged, causing price to reverse upward or consolidate rather than decline further; used here as a stop placement reference.
Specification: The process of translating qualitative trading observations into exact, mechanical, if-then rules that contain no subjective judgment and can be implemented by code.
Trend environment: A market condition characterized by higher highs and higher lows (uptrend) or lower highs and lower lows (downtrend), persisting over a defined period (e.g., several bars or weeks).
References
-
[1] Moskowitz, T.J., Ooi, Y.H., Pedersen, L.H., "Time Series Momentum", Journal of Financial Economics, Vol. 104, No. 2, pp. 228-250 (2012). Https://doi.org/10.1016/j.jfineco.2011.11.003
-
[2] Fibonacci, L., Liber Abaci (The Book of Calculation) (1202). Modern Fibonacci retracement ratios (38.2%, 50%, 61.8%) are practitioner convention, not rigorously derived from the original work; commonly cited in price-action literature as typical pullback depths.
-
[3] Board of Governors of the Federal Reserve System, "Federal Open Market Committee Calendar", Federal Reserve, U.S.A. (2025). Https://www.federalreserve.gov/monetarypolicy/fomccalendars.htm
-
[4] CME Group, "E-mini Currency Futures Contract Specifications", CME (2025). Https://www.cmegroup.com/ (see FX micro and standard contracts for typical bid-ask spreads and minimum tick sizes).
Educational research on historical data only. Not investment advice, not a signal, and never a performance promise. Past results do not predict future performance. Every reference is link-verified before publication and every paper is re-audited weekly against the library's editorial standard.
Last reviewed by the PropLedger research pipeline: 2026-11-15. Educational research on historical data, not financial advice.
Keep reading
Donchian Channel Breakout: Entry Signals from Highest-High and Lowest-Low Volatility Bands
A complete, testable trading strategy: a Donchian channel breakout strategy: the classic trend-following rules, why they worked for decades, and the drawdown profile nobody advertises. Exact rules, full Pine Script code, and an honest reading of the evidence.
Gap-Fill Strategy: Trading Base Rates, Not Hopes
A complete, testable trading strategy: a systematic gap-fill strategy: measuring base rates first, then building rules around the cases where the base rate is actually favourable. Exact rules, full Pine Script code, and an honest reading of the evidence.
Liquidity Sweep Reversal at Session Extremes
A complete, testable trading strategy: a liquidity-sweep reversal strategy: sweeping a prior session high or low then reclaiming it, with precise rules and the failure cases that dominate. Exact rules, full Pine Script code, and an honest reading of the evidence.