Factor Anomaly Mean Reversion¶
EA0054_Factor_Anomaly_Mean_Reversion_v1.0 / ✅ LIVE — バックテスト合格・運用中
ワンライナー
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 | low_vol | fixed_sl |
📊 バックテスト結果¶
判定: ✅ PASS / 期間: 2024.08.15 〜 2026.02.06
| PF | 損益率 | 勝率 | 最大DD | シャープ | 取引数 |
|---|---|---|---|---|---|
| 1.26 | +3.22% | 55.0% | 4.00% | 3.51 | 35 |
📝 仕様書 / Specification¶
🇯🇵 クリックで展開(日本語版)
Research EA Spec: Factor Anomaly Mean Reversion¶
EA Identity¶
- EA name: REF0504_02_Factor_Anomaly_Mean_Reversion_v1
- Symbol: USDJPY
- Timeframe: H1
- Primary style: mean_reversion
- Entry mechanism: oscillator_reversal
- Regime target: low_vol
- 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: Keltner-CCI Mean Reversion entry (low-volatility regime only): Step 1 — Keltner squeeze check on bar[1]:
kcUpper = ema20[1] + 1.5*atr14[1],kcLower = ema20[1] - 1.5*atr14[1]. Active only when BB(20,2) width < KC width:(bbUpper[1] - bbLower[1]) < (kcUpper - kcLower)(low-vol squeeze). Step 2 — CCI(14) reversal signal on bar[1]: BUY:cci[1] > InpCCIOversold && cci[2] <= InpCCIOversold(default InpCCIOversold=-100). SELL:cci[1] < InpCCIOverbought && cci[2] >= InpCCIOverbought(default InpCCIOverbought=100). Regime filter (independent):bullishRegime = (close[1] > ema20[1])— uses price vs EMA20, completely separate from the CCI signal. KC squeeze uses ATR; regime uses close vs EMA; entry signal uses CCI — three different indicators, no contradiction risk. ONE regime variable only: use ONLYbullishRegimein the entry condition — do NOT add a second slope check. NOTE: oscillator_reversal + ranging regime has been REMOVED from the DNA pool due to statistical contradiction (RSI extremes require strong price moves that typically push price outside ranging bounds). This low_vol variant is retained because Keltner squeeze + CCI operates on volatility compression, not ranging regime. - 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.
- Regime filter: low_vol regime confirmation using SAME timeframe indicators only
- Invalidation condition: If walk-forward repeatedly shows OOS PF < 1.0 or trades collapse after loosening entry filters, archive the DNA.
Filters¶
- Spread and session 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 fixed historical price levels.
- Special approaches ALLOWED if explicitly justified: broker asymmetry exploitation, martingale-with-withdrawal strategy, contrarian-sentiment fade, geopolitical event arbitrage, structural latency edges, quantum-inspired optimization, swarm-intelligence position sizing, game-theoretic market-making.
- For any special approach, you MUST include: (1) exact risk cap in pips/% per trade and per day, (2) kill-switch condition (when to stop trading), (3) explanation of why the structural edge is believed to exist, (4) fallback to standard rules if the edge disappears.
- Diversity mandate: if previous EAs in registry are mostly TREND, generate MR or BREAKOUT. If mostly technical indicator-based, generate anomaly/seasonal/regime-based or cross-disciplinary (physics/bio/psychology) approaches. Seek the UNEXPLORED angle.
- 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 18 months with the latest 3 months held out.
- Use walk-forward setting 6:2 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 below 10 trades per held-out window; 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: Keltner squeeze条件とCCI逆張りシグナルが同一バー[1]でAND結合されるが、KC squeezeはボラティリティ圧縮状態を要求し、CCIが-100を下回る(売られすぎ)から-100を上回る反転を同一バーで要求する。BB幅
-100 && cci[2] <= -100は「cci[2]が-100以下でcci[1]が-100より上」=CCIが上昇したことを示す。しかしlow_vol regimeでclose[1] > ema20[1](bullishRegime)を要求すると、価格がEMA20上にある状態でCCIが-100以下(強い売られすぎ)に達することがlow_vol環境で起きにくく、さらにその直後の反転でエントリーする組み合わせは極めて稀。最も致命的なのは、SELL条件のcci[1] < 100 && cci[2] >= 100(CCIが100以上から下落)とbullishRegime = close[1] > ema20[1](価格がEMA上)をAND結合すること。SELLエントリーなのに「価格がEMA20より上」という上昇トレンドレジームを要求しており、これは逆張り売りの方向性とレジームフィルターが同方向ではなく、mean_reversionのSELLとしては価格がEMA20より下(bearishRegime)であるべきところを誤ってbullishRegimeを指定している。仕様書は「ONE regime variable only: use ONLY bullishRegime」と明記しているが、SELLエントリーにbullishRegimeを適用すると、SELL条件はcci[1] < 100(CCIが下降)かつ close[1] > ema20[1](価格上昇)となり、CCIと価格の両方が同時に下降/上昇という矛盾した状態を要求する。これは仕様書の意図では「BUYのみbullishRegime、SELLはbearishRegime(= !bullishRegime)」とすべきところを、強制的に1変数のみ使用する設計方針の誤適用と思われる。 - Fix: レジーム変数を方向別に切り替えるか、または1本のレジーム変数として「トレンド方向なしのlow_vol状態」を定義し直す。例:
lowVolRegime = (BB幅 < KC幅)のみをレジームとし、価格vsEMAの方向フィルターを廃止する。あるいはBUY/SELLでレジームを反転: BUYならclose[1] > ema20[1]、SELLならclose[1] < ema20[1]を使う(但しこれは仕様書の「1変数のみ」制約に違反するため、レジーム変数をregimeAligned = (direction == BUY) ? close[1] > ema20[1] : close[1] < ema20[1]のように統合1変数として定義する)。 - WARNING: [CONTRA] CCI(14)のデフォルト閾値±100は標準的だが、low_vol regimeではCCIが±100に到達しにくく、エントリー機会が極端に減る可能性。InpCCIOversold=-100のままでは取引ゼロに近づくリスク。仕様書の「If no trades: loosen entry confirmation first」に該当する。
- WARNING: [CONTRA] Keltner squeeze + CCI mean reversionは、ボラティリティ圧縮後の拡張でCCIが極値に達するが、low_vol regimeではその拡張自体が稀。スクイーズ確認とエントリーシグナルの時系列分離が不十分。
- WARNING: [CONTRA] Exit条件の「RSI crosses back through midline」と「price returns to N-bar SMA」は、mean reversionでは一般的だが、low_vol環境ではRSIが50付近で停滞し、midlineクロスが早期に起きて利益が小さくなるリスク。
- WARNING: [CONTRA] 12月のクリスマス休暇フィルターと月末3営業日のWMロイター収束は、USDJPYのseasonal要素として統計的に観測されるが、H1時間足での実装では「発表後30分」などの短時間枠指定がないと、seasonal効果がノイズに埋もれる。
- WARNING: [CONTRA] 仕様書の「oscillator_reversal + ranging regime has been REMOVED from the DNA pool due to statistical contradiction」という注記は、low_vol regimeへの置き換え理由を説明しているが、Keltner squeezeがlow_volを保証するかは別問題。BB幅<KC幅は相対的なボラティリティ低下を示すだけで、絶対的なlow_volではない。
🇬🇧 Click to expand (English version)
Research EA Spec: Factor Anomaly Mean Reversion¶
EA Identity¶
- EA name: REF0504_02_Factor_Anomaly_Mean_Reversion_v1
- Symbol: USDJPY
- Timeframe: H1
- Primary style: mean_reversion
- Entry mechanism: oscillator_reversal
- Regime target: low_vol
- 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: Keltner-CCI Mean Reversion entry (low-volatility regime only): Step 1 — Keltner squeeze check on bar[1]:
kcUpper = ema20[1] + 1.5*atr14[1],kcLower = ema20[1] - 1.5*atr14[1]. Active only when BB(20,2) width < KC width:(bbUpper[1] - bbLower[1]) < (kcUpper - kcLower)(low-vol squeeze). Step 2 — CCI(14) reversal signal on bar[1]: BUY:cci[1] > InpCCIOversold && cci[2] <= InpCCIOversold(default InpCCIOversold=-100). SELL:cci[1] < InpCCIOverbought && cci[2] >= InpCCIOverbought(default InpCCIOverbought=100). Regime filter (independent):bullishRegime = (close[1] > ema20[1])— uses price vs EMA20, completely separate from the CCI signal. KC squeeze uses ATR; regime uses close vs EMA; entry signal uses CCI — three different indicators, no contradiction risk. ONE regime variable only: use ONLYbullishRegimein the entry condition — do NOT add a second slope check. NOTE: oscillator_reversal + ranging regime has been REMOVED from the DNA pool due to statistical contradiction (RSI extremes require strong price moves that typically push price outside ranging bounds). This low_vol variant is retained because Keltner squeeze + CCI operates on volatility compression, not ranging regime. - 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.
- Regime filter: low_vol regime confirmation using SAME timeframe indicators only
- Invalidation condition: If walk-forward repeatedly shows OOS PF < 1.0 or trades collapse after loosening entry filters, archive the DNA.
Filters¶
- Spread and session 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]ANDisBearishRegime = 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.,
bullishRegimeoruptrend) 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 fixed historical price levels.
- Special approaches ALLOWED if explicitly justified: broker asymmetry exploitation, martingale-with-withdrawal strategy, contrarian-sentiment fade, geopolitical event arbitrage, structural latency edges, quantum-inspired optimization, swarm-intelligence position sizing, game-theoretic market-making.
- For any special approach, you MUST include: (1) exact risk cap in pips/% per trade and per day, (2) kill-switch condition (when to stop trading), (3) explanation of why the structural edge is believed to exist, (4) fallback to standard rules if the edge disappears.
- Diversity mandate: if previous EAs in registry are mostly TREND, generate MR or BREAKOUT. If mostly technical indicator-based, generate anomaly/seasonal/regime-based or cross-disciplinary (physics/bio/psychology) approaches. Seek the UNEXPLORED angle.
- 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 18 months with the latest 3 months held out.
- Use walk-forward setting 6:2 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 below 10 trades per held-out window; 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: Keltner squeeze条件とCCI逆張りシグナルが同一バー[1]でAND結合されるが、KC squeezeはボラティリティ圧縮状態を要求し、CCIが-100を下回る(売られすぎ)から-100を上回る反転を同一バーで要求する。BB幅
-100 && cci[2] <= -100は「cci[2]が-100以下でcci[1]が-100より上」=CCIが上昇したことを示す。しかしlow_vol regimeでclose[1] > ema20[1](bullishRegime)を要求すると、価格がEMA20上にある状態でCCIが-100以下(強い売られすぎ)に達することがlow_vol環境で起きにくく、さらにその直後の反転でエントリーする組み合わせは極めて稀。最も致命的なのは、SELL条件のcci[1] < 100 && cci[2] >= 100(CCIが100以上から下落)とbullishRegime = close[1] > ema20[1](価格がEMA上)をAND結合すること。SELLエントリーなのに「価格がEMA20より上」という上昇トレンドレジームを要求しており、これは逆張り売りの方向性とレジームフィルターが同方向ではなく、mean_reversionのSELLとしては価格がEMA20より下(bearishRegime)であるべきところを誤ってbullishRegimeを指定している。仕様書は「ONE regime variable only: use ONLY bullishRegime」と明記しているが、SELLエントリーにbullishRegimeを適用すると、SELL条件はcci[1] < 100(CCIが下降)かつ close[1] > ema20[1](価格上昇)となり、CCIと価格の両方が同時に下降/上昇という矛盾した状態を要求する。これは仕様書の意図では「BUYのみbullishRegime、SELLはbearishRegime(= !bullishRegime)」とすべきところを、強制的に1変数のみ使用する設計方針の誤適用と思われる。 - Fix: レジーム変数を方向別に切り替えるか、または1本のレジーム変数として「トレンド方向なしのlow_vol状態」を定義し直す。例:
lowVolRegime = (BB幅 < KC幅)のみをレジームとし、価格vsEMAの方向フィルターを廃止する。あるいはBUY/SELLでレジームを反転: BUYならclose[1] > ema20[1]、SELLならclose[1] < ema20[1]を使う(但しこれは仕様書の「1変数のみ」制約に違反するため、レジーム変数をregimeAligned = (direction == BUY) ? close[1] > ema20[1] : close[1] < ema20[1]のように統合1変数として定義する)。 - WARNING: [CONTRA] CCI(14)のデフォルト閾値±100は標準的だが、low_vol regimeではCCIが±100に到達しにくく、エントリー機会が極端に減る可能性。InpCCIOversold=-100のままでは取引ゼロに近づくリスク。仕様書の「If no trades: loosen entry confirmation first」に該当する。
- WARNING: [CONTRA] Keltner squeeze + CCI mean reversionは、ボラティリティ圧縮後の拡張でCCIが極値に達するが、low_vol regimeではその拡張自体が稀。スクイーズ確認とエントリーシグナルの時系列分離が不十分。
- WARNING: [CONTRA] Exit条件の「RSI crosses back through midline」と「price returns to N-bar SMA」は、mean reversionでは一般的だが、low_vol環境ではRSIが50付近で停滞し、midlineクロスが早期に起きて利益が小さくなるリスク。
- WARNING: [CONTRA] 12月のクリスマス休暇フィルターと月末3営業日のWMロイター収束は、USDJPYのseasonal要素として統計的に観測されるが、H1時間足での実装では「発表後30分」などの短時間枠指定がないと、seasonal効果がノイズに埋もれる。
- WARNING: [CONTRA] 仕様書の「oscillator_reversal + ranging regime has been REMOVED from the DNA pool due to statistical contradiction」という注記は、low_vol regimeへの置き換え理由を説明しているが、Keltner squeezeがlow_volを保証するかは別問題。BB幅<KC幅は相対的なボラティリティ低下を示すだけで、絶対的なlow_volではない。
免責事項
本EAは自動生成された検証用コードです。実運用可否はご自身で検証してください。
関連用語¶
— SPONSORED —