Asian_Session_MA_Cross_Scalp¶
EA0179_Asian_Session_MA_Cross_Scalp_v1.0 / ⚠️ FAILED — 生成失敗・修正失敗・BT不合格
ワンライナー
Asian Session MA Cross Scalp
判定: 🟡 C(ひとクセあり)
自律生成EA。優位性は限定的(PF0.03)。データとしては残すが運用向きではない。
自律生成ライン(網羅的に量産)
基本情報¶
| 項目 | 値 | 項目 | 値 | |
|---|---|---|---|---|
| シンボル | EURUSD | エントリー種別 | mean_cross | |
| 時間足 | M15 | エグジット | fixed_sl | |
| 方向 | both | 主要インジケータ | — |
🧬 DNA 5軸¶
| primary_style | entry_mechanism | regime_target | position_logic | core_indicator_family |
|---|---|---|---|---|
scalp | mean_cross | ranging | fixed_sl | moving_average |
📊 バックテスト結果¶
判定: ❌ FAIL / 期間: — 〜 —
| PF | 損益率 | 勝率 | 最大DD | シャープ | 取引数 |
|---|---|---|---|---|---|
| 0.03 | -96.52% | 61.7% | 96.55% | -5.00 | 47 |
📝 仕様書 / Specification¶
クリックで展開
リサーチEA仕様書: Asian Session MA Cross Scalp¶
EA識別情報¶
- EA名: REF0704_01_Asian_Session_MA_Cross_Scalp_v1
- 通貨ペア: GBPJPY
- 時間足: M15
- プライマリスタイル: scalp
- エントリーメカニズム: mean_cross
- レジームターゲット: ranging
- ポジションロジック: fixed_sl
- コアインジケーター系統: moving_average
- キャプチャ意図: middle (head=新規の頭を取る / middle=頭と尻尾を渡す / tail=枯れ際の反転を取る)
リサーチテーゼ¶
Asian Session MA Cross Scalp candidate generated from 4 research source(s). The strategy must preserve the source idea while keeping parameters broad enough to survive out-of-sample testing.
根拠ソース¶
- [FILTER] 現在のレジーム指紋リーダーは逆張り/リバージョン系。同族の新規EAはまず発火しやすく、逆族はエントリー0本リスクが相対的に高い。
- [META] [FILTER] ブローカー毎のスプレッド・約定遅延で EA の実効利益は 20-50% 変動する
- [FILTER] [STATS] 東京市場 (09:00-15:00 JST) はスプレッド拡大・流動性低下で短期戦略のコスト負けが多い
- [FILTER] ADX trend strength フィルター: 閾値 20-30 の間が実用域、30超は過剰に絞り込みすぎ
トレード仕様¶
以下5点は必須です。いずれかが欠落・空欄の場合、この仕様書は不合格としてください。
1. Entry logic(エントリー条件)¶
BUY entry (trend-following): fast SMA crosses above slow SMA on confirmed bar[1] (fastMA[1] > slowMA[1] && fastMA[2] <= slowMA[2]) AND bullishRegime. This is a CLASSIC trend-following MA cross: buy when the faster MA crosses above the slower MA in an uptrend. SELL entry (trend-following): fast SMA crosses below slow SMA (fastMA[1] < slowMA[1] && fastMA[2] >= slowMA[2]) AND bearishRegime. This is a CLASSIC trend-following MA cross: sell when the faster MA crosses below the slower MA in a downtrend. CRITICAL — Regime MUST be independent from cross signal, SAME timeframe: Define regime using a 50-bar SMA slope on the SAME timeframe — completely independent from the fast/slow MA cross. bullishRegime = (sma50[1] - sma50[10]) > slopeThreshold (default slopeThreshold = 0.0001 * _Point). bearishRegime = (sma50[1] - sma50[10]) < -slopeThreshold. SMA50 slope uses a DIFFERENT lookback (50 vs 10 for cross) and DIFFERENT calculation (slope vs cross) than the entry signal. ONE regime variable only: declare a single bool bullishRegime and use it in the entry AND condition — do NOT add a second slope variable. SAME timeframe rule: NEVER use D1 RSI or higher-timeframe indicators for regime when entry is on H1/H4. Regime and trigger must be evaluated on the same timeframe to avoid temporal misalignment and zero trades.
2. Exit logic(決済条件)¶
Exit trigger: reverse MA cross (fast SMA crosses back through slow SMA in opposite direction). Regime exit (faster): if the SMA50 slope flips against the position (bullishRegime -> bearishRegime or vice versa), close before reverse cross. Hard stop: initial ATR-based SL (InpSLATR * atr[1], default=1.5) — fixed, not trailed. No fixed TP target — the cross itself manages the exit. Time exit: close if held more than InpMaxBars (default=18 bars on H4, equivalent to about 3 days) without exit signal.
2.5 キャプチャ意図に基づく Exit Discipline (拘束)¶
キャプチャ意図: MIDDLE — Middle capture: give up the head and the tail. The EA must not chase the extension; it locks in a measured portion and steps aside.
- TP: ATR(14, bar[1]) × 1.5
- SL: ATR(14, bar[1]) × 1.5
- トレイル: トレイル禁止
- 時間切れ: 15 bars
- 部分決済: +1.0*ATR で 50% 部分決済 + 残りは建値SLへ
EA 実装ガードレール (絶対遵守):
- NEVER add a trailing stop — middle capture forbids tail-chasing.
- TP and SL are equal in ATR multiples (1.5 each); do NOT widen TP > SL.
- Time exit at 15 bars is mandatory; do NOT extend in pursuit of further gains.
- Partial close at +1.0*ATR with BE stop is the only allowed exit refinement.
- After successful partial close, return/continue immediately; move BE stop only after refreshed position state on a later tick/new bar.
参考 MQL5 擬似コード (実装の出発点):
double atrAtEntry = iATR(_Symbol, _Period, 14)[1];
double tp = entryPrice + side * 1.5 * atrAtEntry;
double sl = entryPrice - side * 1.5 * atrAtEntry;
// NO trailing stop — middle capture explicitly refuses to chase the tail.
// Partial close: close 50% of position at +1.0 * atrAtEntry favorable excursion.
if (favorableExcursion >= 1.0 * atrAtEntry && !partialClosed) {
if (ClosePartial(0.5)) {
partialClosed = true;
pendingBreakEven = true;
return; // wait for refreshed position state before stop modification
}
}
if (pendingBreakEven && refreshedPositionState) {
ModifyStop(entryPrice);
}
// Time exit: 15 bars from entry, regardless of P/L.
if (barsHeld >= 15) { ClosePosition("middle_time_exit"); }
上記の Exit Discipline は section 2 (Exit logic) と矛盾する場合、Exit Discipline を優先してください。 メカニズム別の Exit 指示は同方向性の確認、Capture Intent の指示は拘束的な数値規律です。
3. Risk management(資金管理)¶
Fixed fractional risk per trade, no martingale, no grid expansion, max one position per symbol, and hard daily loss guard.
4. Regime filter(レジームフィルター)¶
ranging regime confirmation using SAME timeframe indicators only
5. Invalidation condition(無効化条件)¶
If walk-forward repeatedly shows OOS PF < 1.0 or trades collapse after loosening entry filters, archive the DNA.
5点構造チェック: 上記5セクションがすべて記載されていることを確認してください。
フィルター¶
- Spread and session filter
- Regime-specific confirmation filter from source evidence
- Minimum sample count filter before accepting optimization
ロジック独立性要件¶
必須チェック(実装前に確認すること):
- エントリーシグナル変数とレジームフィルター変数は独立したデータ源または独立した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 に組み込むこと。
Primitive Execution Lane¶
- レーン: VERIFIED
- 検証済みprimitive:
- entry:mean_cross (moving-average cross trigger)
- position:fixed_sl (fixed-risk SL/TP with optional time exit)
- experimental primitive:
- none
- 判定理由:
- All detected strategy and position mechanics map to verified primitives
- 実装方針: 発想はentry/regime/filterに閉じ込め、発注・部分決済・建値移動・日次停止は検証済みprimitiveを使う。experimentalの場合は専用helperに隔離する。
最適化許容範囲¶
- 緩和可能: 確証閾値、ATR活性閾値、セッションウィンドウ、シグナル確証バー数。
- 緩和不可: 損切り規律、最大ポジション数1、過去の固定価格水準の不使用。
- 明示的に正当化される場合のみ特殊アプローチを許可: ブローカー非対称性の活用、出金ありマーチンゲール戦略、逆張りセンチメントフェード、地政学イベント裁定、構造的レイテンシエッジ、量子風最適化、群知能ポジションサイジング、ゲーム理論的マーケットメイキング。
- 特殊アプローチを使用する場合は以下を必須記載: (1) 1トレードおよび1日あたりの厳密なリスク上限(pips/%)、(2) キルスイッチ条件(取引停止条件)、(3) 構造的エッジの存在根拠、(4) エッジ消失時の標準ルールへのフォールバック。
- 多様性指令: レジストリ内の既存EAがほとんどTREND系ならMRかBREAKOUTを生成。ほとんどテクニカル指標ベースなら、異常/季節/レジームベースまたは学際的(物理/生物/心理)アプローチを生成。未探索の角度を追求すること。
- 初期最適化範囲: 3〜5パラメータのみ。
- 取引ゼロの場合: まずエントリー確証を緩和、次にセッション制限、次にATR閾値を緩和。
- 取引過多の場合: レジームフィルターと最小シグナル距離を強化。
バックテスト合格基準¶
- Backtest at least 24 months with the latest 3 months held out.
- Use walk-forward setting 4: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 15 trades per held-out window (minimum 30 total); first loosen entry filters before optimizing profit targets.
- OOS PF is the only success metric. IS PF is parameter sanity, not the headline.
- A profitable strategy must answer 'why does this work?' from a stated hypothesis (microstructure, behavioral bias, seasonal anomaly, regime shift). Chains of indicators with no thesis are presumed curve-fit.
過学習対策¶
- Robust > Profitable. A PF=1.20 strategy that survives every OOS window beats a PF=2.50 one that wins in one window and crashes in another.
- Keep each numeric parameter in a wide theory-backed range; do not tune to a single date range.
- Use canonical defaults (RSI=14, ATR=14, BB=20/2, MA=20/50/200). Magic numbers (RSI=17, ATR=23, BB=18/1.7) are a red flag of curve-fitting unless the spec cites prior research justifying that exact value.
- Limit optimization to 3-5 core parameters in the first pass.
- Forbid AND-chains of more than 4 filters at entry. Each added filter shrinks sample size and looks like edge but is usually fit.
- If a single time-of-day or day-of-week window dominates the trade history, the edge is calendar artifact, not strategy.
- Prefer regime filters with clear market meaning over curve-fitted thresholds.
- Stop improving the candidate after repeated NO_TRADE/LOW_SAMPLE failures.
学習フィードバック¶
- [DIVERSITY-GRADE] variant: too_similar(max_sim=1.00 >= 0.7)
実装ガードレール¶
- [PRIMITIVE-LANE: VERIFIED] Keep creativity in entry/regime/filter logic; use verified execution primitives only.
- [PRIMITIVE-LANE: VERIFIED] Mapped primitives: entry:mean_cross (moving-average cross trigger); position:fixed_sl (fixed-risk SL/TP with optional time exit).
- [PRIMITIVE-LANE: VERIFIED] Do not introduce martingale/grid/latency/arbitrage execution mechanics during MQL5 generation.
- [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] [FILTER] [META] マルチタイムフレームEAでATR等のボラティリティ指標をCopyBufferする際、エントリー判定用の価格・MA(start_pos=1で確定足参照)とATR(start_pos=0で未確定バー参照)でstart_posが混在しやすい。設計方針として「全バッファのstart_posを統一する」か「ATRのみ最新値を使う理由をコメントで明記する」かを決めておくべき。 (.clinerules)
- [META] HistorySelect(0, TimeCurrent()) は全取引履歴を走査対象にするため、長期運用や多数の取引がある口座ではパフォーマンスに影響する。連敗カウント等の直近履歴のみが必要な場合は、開始時刻を限定する(例: TimeCurrent() - 30243600)か、最後のチェック時刻を記録して差分走査にする。 (.clinerules)
- [META] MQL5のOnTradeTransactionではDEAL_ENTRY_INOUTも処理対象に含めないと、ネッティング口座での約定イベントを捕捉できない場合がある (.clinerules)
- [META] OnTradeTransactionでHistoryDealSelectを使用する際、DEAL_ENTRY_OUTとDEAL_ENTRY_INOUTの両方を処理することで、ネッティング口座とヘッジ口座の両方に対応できる。この2値チェックパターンは連敗カウント等の決済イベント処理の標準実装として有効。 (.clinerules)
- [META] OnTradeイベントでHistorySelect(0, TimeCurrent())による全履歴スキャンは、取引履歴が長期化するとパフォーマンス劣化を招く。g_last_processed_dealに対応する時刻を別途保持し、HistorySelectの開始時刻を直近に絞り込むパターンが推奨される。 (.clinerules)
ストーリーパッケージ¶
- フック: AIが研究メモから自律発掘した「Asian Session MA Cross Scalp」をEA化して検証。
- ブログアングル: 研究アイデアは本当にMT5で再現できるのか、OOSで崩れるかまで公開する。
- 失敗アングル: 失敗時は NO_TRADE / LOW_SAMPLE / OVERFIT / HIGH_DD に分類して次の研究候補へ進む。
Spec Validation Warnings (auto-generated)¶
- CONTRADICTION: Entry logicとExit Disciplineで完全に相反するポジショニング戦略が指定されている
- Fix: Entryをtrend-followingからmean-reversion(逆張り)に変更するか、Capture IntentをTREND(トレール許可、TP>SL)に変更するか、どちらか一方の戦略軸に統一すること。両立不可能:トレンドフォローは「伸びに乗る」がMIDDLEは「頭と尻尾を渡す」ため、MAクロスの反転で決済するとトレンドの途中で抜け、固定TP/SLではトレンド継続を取れない
- CONTRADICTION: レジームターゲットが'ranging'だがEntry logicはtrend-followingのMA crossを指定
- Fix: rangingレジームではtrend-followingエントリーは偽シグナルが多く取引ゼロまたは大損。rangingターゲットならmean-reversion(BB逆張り、RSI極値等)に変更するか、レジームターゲットをtrendingに変更すること
- CONTRADICTION: Entry logicのレジーム定義とExit logicのレジーム判定が同一インジケーター・同一計算式で競合
- Fix: Exitで「レジーム反転で早期決済」としているが、Entryのsma50スロープと同一計算式のため、Entry直後にslopeThreshold境界で振動すると即座に決済されてポジション維持不可能。Exitのレジーム判定はEntryより長いlookback(sma50[1]-sma50[20]等)または別指標(ADX低下等)にすること
- CONTRADICTION: セッションフィルターと時間足設定が矛盾
- Fix: GBPJPYは東京時間帯に流動性が極端に低下し、スプレッド拡大でスキャルピングがコスト負け。Source Evidenceにも「東京市場はスプレッド拡大・流動性低下で短期戦略のコスト負けが多い」と記載ありながら、この組み合わせを採用している。EURJPYやUSDJPYに変更するか、ロンドンセッションに変更すること
- CONTRADICTION: Exit logicとExit DisciplineでSL/TP計算式が矛盾
- Fix: Exit logicは「クロス自身が決済を管理」「固定TPなし」としているが、Exit Disciplineは固定TP/SLを強制。両方のセクションを統一すること。Capture Intent優先の場合、Exit logicの「No fixed TP target」「reverse MA cross exit」を破棄し、Exit Disciplineの固定TP/SL+部分決済に統一すること
- CONTRADICTION: ADXフィルターの閾値範囲とレジームターゲットが矛盾
- Fix: rangingレジームではADX<20(弱トレンド)が対象だが、trend-followingエントリーにはADX>25程度が必要。Source Evidenceの「20-30が実用域」はtrend-followingのフィルターとして解釈される。rangingターゲットならADX<20を採用するか、エントリーをtrend-followingから変更すること
- WARNING: 時間足設定とMaxBars/Time exitの単位が矛盾
- Fix: M15で18 barsは4.5時間、15 barsは3.75時間。H4換算の記述はM15運用では無意味。さらにExit logicとExit Disciplineでbars数が異なる(18 vs 15)。統一すること。M15運用なら15 bars(3.75時間)または18 bars(4.5時間)のどちらかに統一し、H4参照を削除すること
- WARNING: Source Evidenceに「東京市場はスプレッド拡大・流動性低下で短期戦略のコスト負けが多い」と記載があるが、Filtersセクションにスプレッド閾値フィルターやセッション除外フィルターの具体的実装がない。Source Evidenceを実装フィルターにマッピングすべき
- WARNING: Source Evidenceに「ブローカー毎のスプレッド・約定遅延でEAの実効利益は20-50%変動する」と記載があるが、スプレッドフィルターやスリッページ制限の具体的実装がない
- WARNING: 「レジーム指紋リーダーは逆張り/リバージョン系」と記載があるが、生成されたEAはtrend-following。多様性指令との整合性が不明
- WARNING: Entry logicに「SAME timeframe rule: NEVER use D1 RSI or higher-timeframe indicators」と記載があるが、上位足フィルターが完全に禁止されているため、M15でのみranging判定が困難な場合がある
- WARNING: Partial closeの実装に「return; // wait for refreshed position state before stop modification」とあるが、次のtickでpendingBreakEvenが処理されない場合、建値SL移動が永遠に行われないリスク
免責事項
本EAは自動生成された検証用コードです。実運用可否はご自身で検証してください。
関連用語¶
- 用語集 - バックテスト
- 用語集 - 勝率
- 用語集 - 逆張り
- 用語集 - スプレッド
- 用語集 - ADX
- 用語集 - SMA
- 用語集 - _Point
- 用語集 - ATR
- 用語集 - RSI
- 用語集 - スリッページ
- 用語集 - マルチタイムフレーム
- 用語集 - ボラティリティ
- 用語集 - CopyBuffer
- 用語集 - TimeCurrent
- 用語集 - スキャルピング