コンテンツにスキップ

Factor Anomaly Mean Reversion

EA0053_Factor_Anomaly_Mean_Reversion_v1.0 / 🧪 候補 — 生成済み・検証待ち

ワンライナー

Factor Anomaly Mean Reversion

基本情報

項目 項目
シンボル USDJPY エントリー種別 oscillator_reversal
時間足 H1 エグジット fixed_sl
方向 both 主要インジケータ

🧬 DNA 4軸

primary_style entry_mechanism regime_target position_logic
mean_reversion oscillator_reversal ranging fixed_sl

📊 バックテスト結果

未実行

📝 仕様書 / Specification

🇯🇵 クリックで展開(日本語版)

Research EA Spec: Factor Anomaly Mean Reversion

EA Identity

  • EA name: REF0430_02_Factor_Anomaly_Mean_Reversion_v1
  • Symbol: USDJPY
  • Timeframe: H1
  • Primary style: mean_reversion
  • Entry mechanism: oscillator_reversal
  • Regime target: ranging
  • Position logic: fixed_sl

Research Thesis

Factor Anomaly Mean Reversion candidate generated from 1 research source(s). The strategy must preserve the source idea while keeping parameters broad enough to survive out-of-sample testing.

Source Evidence

  • Carry Trade & Seasonal Strategies
  • [SEASONAL] [STATS] 月末最終3営業日はWMロイター仲値レートへの収束でドルが一時的に強くなる傾向が統計的に観測される
  • [SEASONAL] [TREND] 12月はクリスマス休暇による流動性低下でスプレッド拡大、トレンド系は機能しにくい
  • [SEASONAL] [FILTER] 米雇用統計 (NFP) 発表後最初の30分は方向性が確定しやすく、ブレイクアウトエントリー優位

Tradable Spec

  • Entry logic: BUY entry: RSI(14) on bar[1] crosses above oversold threshold from below — rsi[1] > InpOversold && rsi[2] <= InpOversold (input default InpOversold=30). SELL entry: RSI crosses below overbought — rsi[1] < InpOverbought && rsi[2] >= InpOverbought (default=70). Regime filter: define using a separate 50-bar SMA — bullishRegime = (close[1] > sma50[1]). Do NOT use RSI thresholds to define regime, as that reuses the same indicator as the entry signal. ONE regime variable only: use ONLY bullishRegime in the entry AND condition — do NOT also add regimeUp or any slope check.
  • Exit logic: Take profit: (1) price returns to N-bar SMA (default N=20), OR (2) RSI crosses back through midline (from oversold: RSI[1] > 50; from overbought: RSI[1] < 50) — whichever fires first. Stop loss: ATR(14)*1.5 beyond entry bar, FIXED (never trail — trailing converts reversion to trend trade). Time exit: close at bar InpMaxBars (default=12) if neither TP nor SL triggered (stale reversion = structural failure, not an opportunity). Do NOT hold mean reversion trades past session boundary.
  • Risk management: Fixed fractional risk per trade, no martingale, no grid expansion, max one position per symbol, and hard daily loss guard.

Filters

  • Spread and session filter
  • Minimum ATR activity filter
  • Regime-specific confirmation filter from source evidence
  • Minimum sample count filter before accepting optimization

Logic Independence Requirements

必須チェック(実装前に確認すること):

  • エントリーシグナル変数とレジームフィルター変数は独立したデータ源または独立したlookbackから計算すること
  • 悪い例: bullishCross = fastMA[1] > slowMA[1]isBearishRegime = fastMA[1] < slowMA[1] を AND 結合 → 同一バーで両立不可、取引ゼロになる
  • 正しいレジーム定義: slowMA[1] - slowMA[10] の傾き、上位足のMA方向、長い lookback(50本以上)の傾き
  • 全フィルターを AND 結合した時に、理論上発火できるバーが存在することをスケッチで確認すること
  • 逆張り戦略では「エントリー条件の否定 ≠ レジーム条件」になっているか必ず確認すること
  • RSI・BB・ATR など同一インジケーターを「シグナル源」と「フィルター源」の両方に使う場合、同じバーで矛盾する不等式を要求していないか確認すること
  • レジーム変数は1本のみ: bullishRegime (または uptrend 等) という bool 変数を1つ定義し、エントリー条件の AND に使うのはその1変数のみにすること。bullishRegime && regimeUp のように2本のレジーム変数を AND 結合することを禁止する。スロープ・価格位置・ADX など複数軸で判断したい場合は、それらを統合した1本の bool 変数にまとめてから AND に組み込むこと。

Optimization Envelope

  • Relaxable: confirmation thresholds, ATR activity threshold, session window, signal confirmation bars.
  • Not relaxable: stop-loss discipline, max one position, no martingale, no fixed historical price levels.
  • Initial optimization scope: 3-5 parameters only.
  • If no trades: loosen entry confirmation first, then session restriction, then ATR threshold.
  • If too many trades: strengthen regime filter and minimum signal distance.

Backtest Acceptance

  • Backtest at least 9 months with the latest 3 months held out.
  • Use walk-forward setting when MT5 runner is available.
  • Reject if OOS/IS PF ratio is below 0.70 or if OOS PF min is below 1.10.
  • Reject if OOS trade count is too low; first loosen entry filters before optimizing profit targets.

Overfitting Controls

  • Keep each numeric parameter in a wide theory-backed range; do not tune to a single date range.
  • Limit optimization to 3-5 core parameters in the first pass.
  • Prefer regime filters with clear market meaning over curve-fitted thresholds.
  • Stop improving the candidate after repeated NO_TRADE/LOW_SAMPLE failures.

Learning Feedback

  • No prior ledger signal was available for this DNA.

Implementation Guardrails

  • [TREND] [BREAKOUT] [FILTER] [META] マルチタイムフレームEAでATR等のボラティリティ指標をCopyBufferする際、エントリー判定用の価格・MA(start_pos=1で確定足参照)とATR(start_pos=0で未確定バー参照)でstart_posが混在しやすい。設計方針として「全バッファのstart_posを統一する」か「ATRのみ最新値を使う理由をコメントで明記する」かを決めておくべき。 (.clinerules)
  • [TREND] [FILTER] スプレッドリトライパターン(予約エントリーのスプレッド不良時リトライ): 予約フラグ方式でスプレッド不良時に即破棄せず、MAX_SPREAD_RETRY回まで次バーで再試行する設計。リトライカウンターは予約フラグと同時にリセットし、クールダウンや金曜制限等の他条件で予約破棄する際もリセットを忘れないこと。リトライの粒度(ティック単位 vs バー単位)を設計時に明確にすべき。 (.clinerules)
  • [META] [RISK] [CONTRA] MT5 Strategy Testerは同名EAのinput値をキャッシュすることがあり、mq5側のinputデフォルトを変更して再コンパイルしても、BTでは前回値が使われる場合がある。inputデフォルト変更の検証では、別EA名/別ファイル名にするか、tester.ini/ExpertParametersで明示的に値を渡し、Testerログの「started with inputs」を必ず確認する。 (.clinerules)
  • [RISK] [META] [CONTRA] 【部分決済後のコメント管理パターン】MQL5ではPositionModifyでコメントを変更できないため、TP1部分決済後の状態管理にコメントプレフィックスを使う設計は「二重部分決済」リスクを内包する。対策として: (1)グローバルなulong配列でTP1済みチケットを管理する、(2)部分決済後に残りを即クローズ→新コメントで再エントリーする、のいずれかのパターンを採用すること。 (.clinerules)
  • [STATS] [META] スリッページ許容値(SetDeviationInPoints)はinputパラメータ化することで、バックテストや運用時の調整が容易になる (.clinerules)
  • [TREND] [BREAKOUT] [META] [A2] closes[], highs[], lows[]にはArraySetAsSeries(true)が設定されているが、adxValBufferにはArraySetAsSeries設定がない。また、TRBuffer/ATRBuffer/SMABufferはArrayResizeで固定長確保後にArraySetAsSeriesを呼んでいない(ただしこれらは実際にはCopyBufferで使用されていないため実害は限定的)。 (.clinerules)
  • [TREND] [META] CTrade を複数マジックナンバーで使い回す場合、SetExpertMagicNumber() を発注直前に都度切り替える設計は機能するが、インスタンスを用途別に分ける(g_tradeLong / g_tradeShort)方が安全で拡張性が高い。 (.clinerules)
  • [FILTER] SYMBOL_SPREADはポイント単位のlong値を返すため、価格単位に変換するには* _Pointを直接使用する (.clinerules)

Story Package

  • Hook: AIが研究メモから自律発掘した「Factor Anomaly Mean Reversion」をEA化して検証。
  • Blog angle: 研究アイデアは本当にMT5で再現できるのか、OOSで崩れるかまで公開する。
  • Failure angle: 失敗時は NO_TRADE / LOW_SAMPLE / OVERFIT / HIGH_DD に分類して次の研究候補へ進む。

Spec Validation Warnings (auto-generated)

  • CONTRADICTION: The spec mandates 'ONE regime variable only' and states 'use ONLY bullishRegime in the entry AND condition — do NOT also add regimeUp or any slope check.' However, the entry logic for SELL is defined as 'rsi[1] < InpOverbought && rsi[2] >= InpOverbought' (overbought cross below) AND implicitly bullishRegime. For a mean reversion SELL in a bullish regime (close[1] > sma50[1]), the logic is: 'sell when RSI is overbought AND price is above its 50-bar MA.' This is theoretically valid (overbought in an uptrend is a reversion opportunity), but the spec does not explicitly state whether SELL entries should use bullishRegime or a separate bearishRegime. If SELL entries are required to fire only in bearish regime (close[1] < sma50[1]), then the condition becomes: rsi[1] < 70 AND close[1] < sma50[1]. But the spec only defines bullishRegime = (close[1] > sma50[1]) and does not define a bearishRegime variable. If the implementation uses bullishRegime for both BUY and SELL, then SELL entries will only fire when price is above SMA50 (bullish), which contradicts mean reversion logic (selling into strength). This is a specification ambiguity that could result in SELL entries never firing or firing in the wrong regime.
  • Fix: Define a second regime variable explicitly: bearishRegime = (close[1] < sma50[1]). Then specify: BUY entry uses bullishRegime (enter long in uptrend when oversold), SELL entry uses bearishRegime (enter short in downtrend when overbought). Alternatively, if the intent is to trade reversions in both regimes, clarify that bullishRegime applies to BUY only and SELL uses !bullishRegime or a separate condition.
  • WARNING: RSI entry signal and regime filter use the same indicator (RSI) with opposite conditions on the same bar index, creating a logical impossibility. BUY entry requires rsi[1] > InpOversold (e.g., >30), but regime filter bullishRegime is defined as close[1] > sma50[1], which is independent. However, the spec states 'Do NOT use RSI thresholds to define regime' — implying RSI was initially considered for regime. If any implementation interprets the regime filter as RSI-based (e.g., rsi[1] > 50 for bullish), then BUY entry (rsi[1] > 30) AND bullishRegime (rsi[1] > 50) would require rsi[1] to satisfy both >30 AND >50 simultaneously, which is possible. But the critical issue is the SELL entry: rsi[1] < InpOverbought (e.g., <70) AND bullishRegime (close[1] > sma50[1]). This means selling when price is above its 50-bar MA (bullish regime) while RSI is below 70 (not overbought). This is theoretically possible but creates a regime contradiction: selling in a bullish regime is counter to mean reversion logic. More critically, if regime were ever defined as rsi[1] > 50 (bullish RSI), then SELL entry rsi[1] < 70 AND rsi[1] > 50 would be valid (50 < rsi < 70), but BUY entry rsi[1] > 30 AND rsi[1] > 50 would collapse to rsi[1] > 50, losing the oversold signal. The spec's explicit prohibition 'Do NOT use RSI thresholds to define regime' suggests this was a known risk. As written with close[1] > sma50[1] regime, no direct contradiction exists, but the warning is structural.
  • Fix: Confirm that bullishRegime is defined exclusively as (close[1] > sma50[1]) and never as any RSI-based condition. For SELL entry, consider whether selling in a bullish regime (close above SMA50) contradicts mean reversion intent; if so, add a separate bearishRegime check for SELL entries, or clarify that SELL entries should only fire in bearish regime (close[1] < sma50[1]).
  • WARNING: Exit logic specifies 'RSI crosses back through midline (from oversold: RSI[1] > 50; from overbought: RSI[1] < 50)' as a take-profit condition. However, the entry signal for BUY is 'rsi[1] > InpOversold (default 30)', which means the trade is entered when RSI crosses above 30. The exit condition 'RSI[1] > 50' will almost certainly trigger before the trade reaches the N-bar SMA target in a mean reversion context, because RSI moving from 30 to 50 is a natural part of the reversion move. This is not a logical contradiction (both can be true), but it creates a structural issue: the exit fires too early, before the mean reversion completes. This is a design flaw, not a trade-zero contradiction, but it undermines the strategy thesis.
  • Fix: Clarify whether 'RSI crosses back through midline' means RSI[1] > 50 AND rsi[2] <= 50 (a true cross), or just RSI[1] > 50 (a level). If the latter, consider raising the midline threshold (e.g., 60) or removing this exit condition in favor of the SMA-based exit only. If the former, implement the cross logic explicitly to avoid premature exits.
  • WARNING: Spec prohibits 'Do NOT hold mean reversion trades past session boundary' but does not define session boundaries (e.g., Tokyo, London, NY open/close times). Implementation must clarify which session(s) apply to USDJPY H1 trading.
  • WARNING: Exit logic includes 'Time exit: close at bar InpMaxBars (default=12)' but does not specify whether this is 12 bars from entry or 12 bars from signal confirmation. If signal confirmation takes multiple bars (e.g., rsi[1] > 30 && rsi[2] <= 30), the effective hold time is ambiguous.
  • WARNING: Regime filter uses 50-bar SMA (sma50[1]) but entry signal uses RSI(14). The lookback mismatch (50 vs 14) is intentional per spec, but no guidance is given on how to handle the first 50 bars of backtest when SMA50 is not yet available. Implementation must handle this edge case.
  • WARNING: Spec states 'Minimum ATR activity filter' in Filters section but does not define the threshold or how it interacts with entry logic. If ATR threshold is too high, it may prevent entries during low-volatility mean reversion opportunities.
  • WARNING: Spec references 'Regime-specific confirmation filter from source evidence' but source evidence discusses seasonal patterns (month-end, December, NFP) that are not reflected in the entry/exit logic. Clarify whether these seasonal filters are mandatory or optional.
  • WARNING: Risk management section states 'hard daily loss guard' but does not specify the daily loss limit or how it is calculated (e.g., % of account, fixed amount). Implementation must define this explicitly.
  • WARNING: Backtest acceptance criteria require 'OOS/IS PF ratio is below 0.70' but do not define whether this is a hard reject or a warning. If hard reject, the strategy may fail to pass validation even if OOS performance is acceptable in absolute terms.
🇬🇧 Click to expand (English version)

Research EA Spec: Factor Anomaly Mean Reversion

EA Identity

  • EA name: REF0430_02_Factor_Anomaly_Mean_Reversion_v1
  • Symbol: USDJPY
  • Timeframe: H1
  • Primary style: mean_reversion
  • Entry mechanism: oscillator_reversal
  • Regime target: ranging
  • Position logic: fixed_sl

Research Thesis

Factor Anomaly Mean Reversion candidate generated from 1 research source(s). The strategy must preserve the source idea while keeping parameters broad enough to survive out-of-sample testing.

Source Evidence

  • Carry Trade & Seasonal Strategies
  • [SEASONAL] [STATS] 月末最終3営業日はWMロイター仲値レートへの収束でドルが一時的に強くなる傾向が統計的に観測される
  • [SEASONAL] [TREND] 12月はクリスマス休暇による流動性低下でスプレッド拡大、トレンド系は機能しにくい
  • [SEASONAL] [FILTER] 米雇用統計 (NFP) 発表後最初の30分は方向性が確定しやすく、ブレイクアウトエントリー優位

Tradable Spec

  • Entry logic: BUY entry: RSI(14) on bar[1] crosses above oversold threshold from below — rsi[1] > InpOversold && rsi[2] <= InpOversold (input default InpOversold=30). SELL entry: RSI crosses below overbought — rsi[1] < InpOverbought && rsi[2] >= InpOverbought (default=70). Regime filter: define using a separate 50-bar SMA — bullishRegime = (close[1] > sma50[1]). Do NOT use RSI thresholds to define regime, as that reuses the same indicator as the entry signal. ONE regime variable only: use ONLY bullishRegime in the entry AND condition — do NOT also add regimeUp or any slope check.
  • Exit logic: Take profit: (1) price returns to N-bar SMA (default N=20), OR (2) RSI crosses back through midline (from oversold: RSI[1] > 50; from overbought: RSI[1] < 50) — whichever fires first. Stop loss: ATR(14)*1.5 beyond entry bar, FIXED (never trail — trailing converts reversion to trend trade). Time exit: close at bar InpMaxBars (default=12) if neither TP nor SL triggered (stale reversion = structural failure, not an opportunity). Do NOT hold mean reversion trades past session boundary.
  • Risk management: Fixed fractional risk per trade, no martingale, no grid expansion, max one position per symbol, and hard daily loss guard.

Filters

  • Spread and session filter
  • Minimum ATR activity filter
  • Regime-specific confirmation filter from source evidence
  • Minimum sample count filter before accepting optimization

Logic Independence Requirements

Mandatory check (must verify before implementation):

  • Entry signal variables and regime filter variables must be calculated from independent data sources or independent lookback periods.
  • Bad example: bullishCross = fastMA[1] > slowMA[1] AND isBearishRegime = fastMA[1] < slowMA[1] — these cannot both be true on the same bar, resulting in zero trades.
  • Correct regime definition: slope of slowMA[1] - slowMA[10], higher timeframe MA direction, or slope over a long lookback (50+ bars).
  • When all filters are AND-combined, sketch-verify that at least one bar can theoretically trigger.
  • For mean-reversion strategies, always verify that "negation of entry condition ≠ regime condition".
  • When using the same indicator (RSI, BB, ATR, etc.) as both "signal source" and "filter source", confirm you are not demanding contradictory inequalities on the same bar.
  • Single regime variable only: Define exactly one bool variable (e.g., bullishRegime or uptrend) and use only that one variable in the entry AND condition. Ban combining two regime variables with AND (e.g., bullishRegime && regimeUp). If you need to judge across multiple axes (slope, price position, ADX), merge them into a single composite bool variable before AND-combining.

Optimization Envelope

  • Relaxable: confirmation thresholds, ATR activity threshold, session window, signal confirmation bars.
  • Not relaxable: stop-loss discipline, max one position, no martingale, no fixed historical price levels.
  • Initial optimization scope: 3-5 parameters only.
  • If no trades: loosen entry confirmation first, then session restriction, then ATR threshold.
  • If too many trades: strengthen regime filter and minimum signal distance.

Backtest Acceptance

  • Backtest at least 9 months with the latest 3 months held out.
  • Use walk-forward setting when MT5 runner is available.
  • Reject if OOS/IS PF ratio is below 0.70 or if OOS PF min is below 1.10.
  • Reject if OOS trade count is too low; first loosen entry filters before optimizing profit targets.

Overfitting Controls

  • Keep each numeric parameter in a wide theory-backed range; do not tune to a single date range.
  • Limit optimization to 3-5 core parameters in the first pass.
  • Prefer regime filters with clear market meaning over curve-fitted thresholds.
  • Stop improving the candidate after repeated NO_TRADE/LOW_SAMPLE failures.

Learning Feedback

  • No prior ledger signal was available for this DNA.

Implementation Guardrails

  • [TREND] [BREAKOUT] [FILTER] [META] マルチタイムフレームEAでATR等のボラティリティ指標をCopyBufferする際、エントリー判定用の価格・MA(start_pos=1で確定足参照)とATR(start_pos=0で未確定バー参照)でstart_posが混在しやすい。設計方針として「全バッファのstart_posを統一する」か「ATRのみ最新値を使う理由をコメントで明記する」かを決めておくべき。 (.clinerules)
  • [TREND] [FILTER] スプレッドリトライパターン(予約エントリーのスプレッド不良時リトライ): 予約フラグ方式でスプレッド不良時に即破棄せず、MAX_SPREAD_RETRY回まで次バーで再試行する設計。リトライカウンターは予約フラグと同時にリセットし、クールダウンや金曜制限等の他条件で予約破棄する際もリセットを忘れないこと。リトライの粒度(ティック単位 vs バー単位)を設計時に明確にすべき。 (.clinerules)
  • [META] [RISK] [CONTRA] MT5 Strategy Testerは同名EAのinput値をキャッシュすることがあり、mq5側のinputデフォルトを変更して再コンパイルしても、BTでは前回値が使われる場合がある。inputデフォルト変更の検証では、別EA名/別ファイル名にするか、tester.ini/ExpertParametersで明示的に値を渡し、Testerログの「started with inputs」を必ず確認する。 (.clinerules)
  • [RISK] [META] [CONTRA] 【部分決済後のコメント管理パターン】MQL5ではPositionModifyでコメントを変更できないため、TP1部分決済後の状態管理にコメントプレフィックスを使う設計は「二重部分決済」リスクを内包する。対策として: (1)グローバルなulong配列でTP1済みチケットを管理する、(2)部分決済後に残りを即クローズ→新コメントで再エントリーする、のいずれかのパターンを採用すること。 (.clinerules)
  • [STATS] [META] スリッページ許容値(SetDeviationInPoints)はinputパラメータ化することで、バックテストや運用時の調整が容易になる (.clinerules)
  • [TREND] [BREAKOUT] [META] [A2] closes[], highs[], lows[]にはArraySetAsSeries(true)が設定されているが、adxValBufferにはArraySetAsSeries設定がない。また、TRBuffer/ATRBuffer/SMABufferはArrayResizeで固定長確保後にArraySetAsSeriesを呼んでいない(ただしこれらは実際にはCopyBufferで使用されていないため実害は限定的)。 (.clinerules)
  • [TREND] [META] CTrade を複数マジックナンバーで使い回す場合、SetExpertMagicNumber() を発注直前に都度切り替える設計は機能するが、インスタンスを用途別に分ける(g_tradeLong / g_tradeShort)方が安全で拡張性が高い。 (.clinerules)
  • [FILTER] SYMBOL_SPREADはポイント単位のlong値を返すため、価格単位に変換するには* _Pointを直接使用する (.clinerules)

Story Package

  • Hook: AI autonomously discovered "Factor Anomaly Mean Reversion" from research notes and converted it into an EA for verification.
  • Blog angle: Can a research idea truly be reproduced on MT5? We publish results all the way through to OOS decay.
  • Failure angle: Failures are classified as NO_TRADE / LOW_SAMPLE / OVERFIT / HIGH_DD and fed into the next research candidate pipeline.

Spec Validation Warnings (auto-generated)

  • CONTRADICTION: The spec mandates 'ONE regime variable only' and states 'use ONLY bullishRegime in the entry AND condition — do NOT also add regimeUp or any slope check.' However, the entry logic for SELL is defined as 'rsi[1] < InpOverbought && rsi[2] >= InpOverbought' (overbought cross below) AND implicitly bullishRegime. For a mean reversion SELL in a bullish regime (close[1] > sma50[1]), the logic is: 'sell when RSI is overbought AND price is above its 50-bar MA.' This is theoretically valid (overbought in an uptrend is a reversion opportunity), but the spec does not explicitly state whether SELL entries should use bullishRegime or a separate bearishRegime. If SELL entries are required to fire only in bearish regime (close[1] < sma50[1]), then the condition becomes: rsi[1] < 70 AND close[1] < sma50[1]. But the spec only defines bullishRegime = (close[1] > sma50[1]) and does not define a bearishRegime variable. If the implementation uses bullishRegime for both BUY and SELL, then SELL entries will only fire when price is above SMA50 (bullish), which contradicts mean reversion logic (selling into strength). This is a specification ambiguity that could result in SELL entries never firing or firing in the wrong regime.
  • Fix: Define a second regime variable explicitly: bearishRegime = (close[1] < sma50[1]). Then specify: BUY entry uses bullishRegime (enter long in uptrend when oversold), SELL entry uses bearishRegime (enter short in downtrend when overbought). Alternatively, if the intent is to trade reversions in both regimes, clarify that bullishRegime applies to BUY only and SELL uses !bullishRegime or a separate condition.
  • WARNING: RSI entry signal and regime filter use the same indicator (RSI) with opposite conditions on the same bar index, creating a logical impossibility. BUY entry requires rsi[1] > InpOversold (e.g., >30), but regime filter bullishRegime is defined as close[1] > sma50[1], which is independent. However, the spec states 'Do NOT use RSI thresholds to define regime' — implying RSI was initially considered for regime. If any implementation interprets the regime filter as RSI-based (e.g., rsi[1] > 50 for bullish), then BUY entry (rsi[1] > 30) AND bullishRegime (rsi[1] > 50) would require rsi[1] to satisfy both >30 AND >50 simultaneously, which is possible. But the critical issue is the SELL entry: rsi[1] < InpOverbought (e.g., <70) AND bullishRegime (close[1] > sma50[1]). This means selling when price is above its 50-bar MA (bullish regime) while RSI is below 70 (not overbought). This is theoretically possible but creates a regime contradiction: selling in a bullish regime is counter to mean reversion logic. More critically, if regime were ever defined as rsi[1] > 50 (bullish RSI), then SELL entry rsi[1] < 70 AND rsi[1] > 50 would be valid (50 < rsi < 70), but BUY entry rsi[1] > 30 AND rsi[1] > 50 would collapse to rsi[1] > 50, losing the oversold signal. The spec's explicit prohibition 'Do NOT use RSI thresholds to define regime' suggests this was a known risk. As written with close[1] > sma50[1] regime, no direct contradiction exists, but the warning is structural.
  • Fix: Confirm that bullishRegime is defined exclusively as (close[1] > sma50[1]) and never as any RSI-based condition. For SELL entry, consider whether selling in a bullish regime (close above SMA50) contradicts mean reversion intent; if so, add a separate bearishRegime check for SELL entries, or clarify that SELL entries should only fire in bearish regime (close[1] < sma50[1]).
  • WARNING: Exit logic specifies 'RSI crosses back through midline (from oversold: RSI[1] > 50; from overbought: RSI[1] < 50)' as a take-profit condition. However, the entry signal for BUY is 'rsi[1] > InpOversold (default 30)', which means the trade is entered when RSI crosses above 30. The exit condition 'RSI[1] > 50' will almost certainly trigger before the trade reaches the N-bar SMA target in a mean reversion context, because RSI moving from 30 to 50 is a natural part of the reversion move. This is not a logical contradiction (both can be true), but it creates a structural issue: the exit fires too early, before the mean reversion completes. This is a design flaw, not a trade-zero contradiction, but it undermines the strategy thesis.
  • Fix: Clarify whether 'RSI crosses back through midline' means RSI[1] > 50 AND rsi[2] <= 50 (a true cross), or just RSI[1] > 50 (a level). If the latter, consider raising the midline threshold (e.g., 60) or removing this exit condition in favor of the SMA-based exit only. If the former, implement the cross logic explicitly to avoid premature exits.
  • WARNING: Spec prohibits 'Do NOT hold mean reversion trades past session boundary' but does not define session boundaries (e.g., Tokyo, London, NY open/close times). Implementation must clarify which session(s) apply to USDJPY H1 trading.
  • WARNING: Exit logic includes 'Time exit: close at bar InpMaxBars (default=12)' but does not specify whether this is 12 bars from entry or 12 bars from signal confirmation. If signal confirmation takes multiple bars (e.g., rsi[1] > 30 && rsi[2] <= 30), the effective hold time is ambiguous.
  • WARNING: Regime filter uses 50-bar SMA (sma50[1]) but entry signal uses RSI(14). The lookback mismatch (50 vs 14) is intentional per spec, but no guidance is given on how to handle the first 50 bars of backtest when SMA50 is not yet available. Implementation must handle this edge case.
  • WARNING: Spec states 'Minimum ATR activity filter' in Filters section but does not define the threshold or how it interacts with entry logic. If ATR threshold is too high, it may prevent entries during low-volatility mean reversion opportunities.
  • WARNING: Spec references 'Regime-specific confirmation filter from source evidence' but source evidence discusses seasonal patterns (month-end, December, NFP) that are not reflected in the entry/exit logic. Clarify whether these seasonal filters are mandatory or optional.
  • WARNING: Risk management section states 'hard daily loss guard' but does not specify the daily loss limit or how it is calculated (e.g., % of account, fixed amount). Implementation must define this explicitly.
  • WARNING: Backtest acceptance criteria require 'OOS/IS PF ratio is below 0.70' but do not define whether this is a hard reject or a warning. If hard reject, the strategy may fail to pass validation even if OOS performance is acceptable in absolute terms.

免責事項

本EAは自動生成された検証用コードです。実運用可否はご自身で検証してください。

EA1000 一覧に戻る


関連用語

— SPONSORED —