Expand API-derived TP distances
This commit is contained in:
@@ -37,6 +37,9 @@
|
||||
- `m15_imbalance_min_avg_body_points = 1.0`: Minimum M15 average body in points.
|
||||
- `use_m15_imbalance_debug_log = false`: Enables detailed M15 impulse-confirmation logs.
|
||||
- `input_entry_max_candidate_age_minutes = 120`: Maximum age, in minutes, for using an H1 candidate for new execution. This blocks delayed entries when M15 confirmation appears too late.
|
||||
- `input_tp_multiplier = 1.25`: Expands the API TP distance from the entry price. Values below `1.0` are clamped to `1.0`, and values above `100.0` are clamped to `100.0`.
|
||||
- `input_min_tp_points = 0`: Minimum final TP distance in points. `0` disables the floor.
|
||||
- `input_max_tp_points = 0`: Maximum expanded TP distance in points. `0` disables the cap. The EA never makes the final TP closer than the API-provided TP distance.
|
||||
- `input_range_breakout_guard_enabled = true`: Cancels adverse reversal Limit orders during range breakouts and temporarily blocks new ones.
|
||||
- `input_range_breakout_guard_timeframe = PERIOD_M15`: Timeframe used by the range-breakout monitor.
|
||||
- `input_range_breakout_lookback_bars = 20`: Closed-bar count used for range high/low and average range. The range starts from the bar before the latest closed bar.
|
||||
@@ -156,6 +159,8 @@ New entries are allowed only when all conditions below are satisfied:
|
||||
- The H1 candidate set has not exceeded `input_entry_max_candidate_age_minutes`, measured from the closed H1 bar time that produced the candidate.
|
||||
- The selected order type has valid `entry/tp/sl` values greater than `0.0`.
|
||||
- The order type is allowed by the H4 `market_state`.
|
||||
- Before price-consistency and broker-distance checks, TP is recalculated from the distance between entry and the API TP, multiplied by `input_tp_multiplier`. Buy strategies place the final TP above entry, and Sell strategies place it below entry.
|
||||
- When split entries are enabled, the final TP is recalculated separately for each slot from that slot's entry price.
|
||||
- The order-type price relationship and broker minimum distance rules are satisfied.
|
||||
- When `use_m15_entry_filter = true`, T2/T4 satisfy the M15 direction, rejection, and proximity checks. T1/T3 satisfy M15 impulse confirmation when `use_m15_imbalance_confirmation = true`.
|
||||
- When `input_range_breakout_guard_enabled = true`, T4 Sell Limit is blocked during an upward range-breakout cooldown and T2 Buy Limit is blocked during a downward range-breakout cooldown.
|
||||
@@ -218,6 +223,7 @@ After an H4 `market_state` reload, the EA cancels existing pending orders whose
|
||||
- Single and split order comments keep a valid `candidate_id` for candidate-origin expiration handling.
|
||||
- Split-entry order comments also include order type and slot number to prevent duplicate execution of the same strategy slot.
|
||||
- When `cancel_old_split_pending_on_new_zone = true`, a new valid `candidate_id` cancels older split pending orders, and an invalid or stopped `target_zones.txt` cancels all existing split pending orders for this EA/symbol/magic.
|
||||
- If the API TP direction contradicts the Buy/Sell price rules, the EA does not repair it; the existing price-consistency checks skip the order.
|
||||
- After an H4 state update, existing pending orders that contradict the refreshed `market_state` are cancelled.
|
||||
- The range-breakout guard only targets pending orders matching `_Symbol` and `magic_number`; upward breakouts cancel T4 Sell Limit only, and downward breakouts cancel T2 Buy Limit only.
|
||||
- A failed pending-order cancellation is not retried for the same ticket until `input_cancel_retry_cooldown_seconds` has elapsed, preventing excessive per-tick trade-server requests.
|
||||
@@ -241,6 +247,7 @@ After an H4 `market_state` reload, the EA cancels existing pending orders whose
|
||||
|
||||
- Added a range-breakout guard that retreats adverse reversal Limit orders. Upward breakouts cancel existing T4 Sell Limit orders and temporarily block new T4 entries; downward breakouts cancel existing T2 Buy Limit orders and temporarily block new T2 entries.
|
||||
- Added guard inputs for monitor timeframe, lookback bars, range-width multiplier, breakout buffer, proximity band, momentum body multiple, and cooldown bars.
|
||||
- Added `input_tp_multiplier`, `input_min_tp_points`, and `input_max_tp_points` to expand API-derived TP distances for both standard orders and per-slot split entries.
|
||||
|
||||
### 2026-06-06
|
||||
|
||||
|
||||
@@ -29,6 +29,9 @@
|
||||
- `m15_imbalance_min_avg_body_points = 1.0`: M15平均実体の最小値(point)。
|
||||
- `use_m15_imbalance_debug_log = false`: M15初動確認の詳細ログを出すか。
|
||||
- `input_entry_max_candidate_age_minutes = 120`: H1候補価格を新規発注に使用できる最大経過分数。古い候補でM15条件が後から整った場合の遅延エントリーを抑止する。
|
||||
- `input_tp_multiplier = 1.25`: APIから取得したTP距離を、エントリー価格からの距離ベースで拡大する倍率。`1.0` 未満は `1.0`、`100.0` 超は `100.0` に丸める。
|
||||
- `input_min_tp_points = 0`: 拡大後TP距離の最小値(point)。`0` の場合は無効化する。
|
||||
- `input_max_tp_points = 0`: 拡大後TP距離の最大値(point)。`0` の場合は無効化する。API由来TPより近くなる場合は縮小せず、API距離を維持する。
|
||||
- `input_range_breakout_guard_enabled = true`: レンジ上抜け/下抜け時に逆方向の逆張りLimit注文を退避し、新規発注も一時停止するか。
|
||||
- `input_range_breakout_guard_timeframe = PERIOD_M15`: レンジブレイクを監視する時間足。
|
||||
- `input_range_breakout_lookback_bars = 20`: レンジ高値・安値と平均レンジを計算する確定足本数。直近確定足の1本前から参照する。
|
||||
@@ -156,6 +159,8 @@ Pythonは `target_prices.txt` と `target_zones.txt` の両方を書き終えて
|
||||
- H1候補価格が、元になったH1確定足時刻から `input_entry_max_candidate_age_minutes` 分を超えていない。
|
||||
- 対象注文タイプの `entry/tp/sl` がすべて `0.0` より大きい。
|
||||
- H4 `market_state` に対して注文タイプが許可されている。
|
||||
- TPは価格整合条件とブローカー距離制約の判定前に、APIのTP価格そのものではなく「エントリー価格からAPI TPまでの距離」を `input_tp_multiplier` で拡大して最終TPへ変換する。Buy系はエントリーより上、Sell系はエントリーより下へ配置する。
|
||||
- 分割エントリー有効時は、slotごとのエントリー価格を基準に各slotの最終TPを個別に計算する。
|
||||
- 注文タイプごとの価格整合条件とブローカー最小距離制約を満たす。
|
||||
- `use_m15_entry_filter = true` の場合、T2/T4はM15確定足の方向・反発・接近条件を満たす。T1/T3は `use_m15_imbalance_confirmation = true` の場合にM15初動確認を満たす。
|
||||
- `input_range_breakout_guard_enabled = true` の場合、レンジ上抜け後のT4 Sell Limit、レンジ下抜け後のT2 Buy Limitはクールダウン終了まで新規発注しない。
|
||||
@@ -218,6 +223,7 @@ H4 `market_state` の再読込後は、更新後の状態で許可されない
|
||||
- 通常注文と分割注文のコメントには有効な `candidate_id` を入れ、候補時刻起点の期限管理に使用する。
|
||||
- 分割エントリーの注文コメントには注文タイプとslot番号も入れ、同一戦略slotの二重発注を抑止する。
|
||||
- `cancel_old_split_pending_on_new_zone = true` の場合、新しい有効 `candidate_id` を読んだ時は旧candidateの分割pending注文を取消し、`target_zones.txt` が無効または停止値の場合は既存の分割pending注文をすべて取消する。
|
||||
- API由来TPの方向がBuy/Sell条件と逆の場合、EAは方向を補正せず既存の価格整合チェックで発注を見送る。
|
||||
- H4状態更新後は、更新後の `market_state` と矛盾する既存pending注文を取消する。
|
||||
- レンジブレイクガードは `_Symbol` と `magic_number` が一致するpending注文だけを対象にし、上方向ブレイクではT4 Sell Limit、下方向ブレイクではT2 Buy Limitのみを取消する。
|
||||
- pending取消に失敗したticketは `input_cancel_retry_cooldown_seconds` の間再送せず、毎tickの過剰な取引サーバー要求を防止する。
|
||||
@@ -241,6 +247,7 @@ H4 `market_state` の再読込後は、更新後の状態で許可されない
|
||||
|
||||
- レンジ上抜け/下抜け時に逆方向の逆張りLimitを退避するレンジブレイクガードを追加した。上方向ブレイクでは既存T4 Sell Limitを取消してT4新規発注を一時停止し、下方向ブレイクでは既存T2 Buy Limitを取消してT2新規発注を一時停止する。
|
||||
- ガード用inputとして、監視時間足、参照本数、レンジ幅倍率、ブレイクバッファ、接近幅、勢い判定倍率、クールダウン本数を追加した。
|
||||
- API由来TPをエントリー価格からの距離ベースで拡大する `input_tp_multiplier`, `input_min_tp_points`, `input_max_tp_points` を追加し、通常注文と分割slotごとの最終TP計算に反映した。
|
||||
|
||||
### 2026-06-06
|
||||
|
||||
|
||||
@@ -25,10 +25,15 @@ The two EAs coordinate through matching `_Symbol` and `input_entry_magic_number`
|
||||
- `input_cancel_retry_cooldown_seconds = 60`: Ticket-level retry cooldown after pending cancellation failures.
|
||||
- `use_m15_entry_filter = true`: Enables M15 closed-bar confirmation.
|
||||
- `input_entry_max_candidate_age_minutes = 120`: Maximum age for using an H1 candidate for new execution.
|
||||
- `input_tp_multiplier = 1.25`: Expands the API TP distance from the entry price. Values below `1.0` are clamped to `1.0`, and values above `100.0` are clamped to `100.0`.
|
||||
- `input_min_tp_points = 0`: Minimum final TP distance in points. `0` disables the floor.
|
||||
- `input_max_tp_points = 0`: Maximum expanded TP distance in points. `0` disables the cap. The EA never makes the final TP closer than the API-provided TP distance.
|
||||
|
||||
## 4. Entry And Exit Conditions
|
||||
|
||||
- New pending orders are sent only after spread, H4 state, H1 candidate, M15 timing, price consistency, broker distance, volume, and same-symbol/same-magic limit checks pass.
|
||||
- Before order submission, TP is recalculated from the distance between entry and the API TP, multiplied by `input_tp_multiplier`. Buy strategies place the final TP above entry, and Sell strategies place it below entry.
|
||||
- Split entries recalculate the final TP separately for each slot, using that slot's entry price.
|
||||
- Pending orders receive `input_entry_magic_number`.
|
||||
- The entry EA cancels expired pending orders, pending orders that conflict with the refreshed H4 state, and stale split-entry pending orders.
|
||||
- Filled-position SL updates, trailing, and time-based exits are not performed by this EA.
|
||||
@@ -37,6 +42,7 @@ The two EAs coordinate through matching `_Symbol` and `input_entry_magic_number`
|
||||
|
||||
- The order limit counts only pending orders and positions matching `_Symbol` and `input_entry_magic_number`.
|
||||
- Python process markers, process IDs, done files, and timeouts are monitored to prevent duplicate launches and stale-result reuse.
|
||||
- If the API TP direction contradicts the Buy/Sell price rules, the EA does not repair it; the existing price-consistency checks skip the order.
|
||||
- `OrderSend` return values and `MqlTradeResult.retcode` are checked and logged.
|
||||
- Because the design assumes hedging accounts, per-ticket position management is handled by `HITPositionManagerEA.mq5`.
|
||||
|
||||
@@ -48,4 +54,5 @@ The two EAs coordinate through matching `_Symbol` and `input_entry_magic_number`
|
||||
|
||||
## 7. Changelog
|
||||
|
||||
- 2026-06-13: Added `input_tp_multiplier`, `input_min_tp_points`, and `input_max_tp_points` to expand API-derived TP distances for both standard orders and per-slot split entries.
|
||||
- 2026-06-07: Split entry responsibilities from `HIT-EA_refactor_ver6.mq5`; moved SLTP panel and filled-position management responsibilities to `HITPositionManagerEA.mq5`.
|
||||
|
||||
@@ -25,10 +25,15 @@
|
||||
- `input_cancel_retry_cooldown_seconds = 60`: pending取消失敗後のticket単位再試行間隔。
|
||||
- `use_m15_entry_filter = true`: M15確定足確認を使うか。
|
||||
- `input_entry_max_candidate_age_minutes = 120`: H1候補を新規発注に使える最大経過分数。
|
||||
- `input_tp_multiplier = 1.25`: APIから取得したTP距離を、エントリー価格からの距離ベースで拡大する倍率。`1.0` 未満は `1.0`、`100.0` 超は `100.0` に丸めます。
|
||||
- `input_min_tp_points = 0`: 拡大後TP距離の最小値(point)。`0` の場合は無効です。
|
||||
- `input_max_tp_points = 0`: 拡大後TP距離の最大値(point)。`0` の場合は無効です。ただしAPI由来TPより近くなる場合は縮小せず、API距離を維持します。
|
||||
|
||||
## 4. エントリー/エグジット条件
|
||||
|
||||
- 新規注文はスプレッド、H4状態、H1候補、M15確認、価格整合、ブローカー距離、ロット制約、同一symbol/magicの上限を満たす場合のみ送信します。
|
||||
- TPは注文送信前に、APIのTP価格そのものではなく「エントリー価格からAPI TPまでの距離」を `input_tp_multiplier` で拡大して最終TPを計算します。Buy系はエントリーより上、Sell系はエントリーより下へ再配置します。
|
||||
- 分割エントリーではslotごとのエントリー価格を基準に、各slotの最終TPを個別に計算します。
|
||||
- pending注文には `input_entry_magic_number` を付与します。
|
||||
- H4状態と矛盾するpending注文、期限切れpending注文、古い分割pending注文は発注EAが取消します。
|
||||
- 約定後ポジションのSL変更、時間決済、トレーリングは発注EAでは行いません。
|
||||
@@ -37,6 +42,7 @@
|
||||
|
||||
- 発注上限は口座全体ではなく `_Symbol` と `input_entry_magic_number` が一致するpending注文 + ポジションで判定します。
|
||||
- Python連携は起動中/完了ファイルとプロセスIDを監視し、二重起動と古い結果の再利用を抑止します。
|
||||
- API由来TPの方向がBuy/Sell条件と逆の場合、EAは方向を補正せず既存の価格整合チェックで発注を見送ります。
|
||||
- `OrderSend` の戻り値と `MqlTradeResult.retcode` を確認し、失敗時はエラーまたはretcodeをログに出します。
|
||||
- hedging口座前提のため、約定後の複数ticket管理は `HITPositionManagerEA.mq5` が担当します。
|
||||
|
||||
@@ -48,4 +54,5 @@
|
||||
|
||||
## 7. 変更履歴
|
||||
|
||||
- 2026-06-13: API由来TPをエントリー価格からの距離ベースで拡大する `input_tp_multiplier`, `input_min_tp_points`, `input_max_tp_points` を追加し、通常注文と分割slotごとの最終TP計算に反映。
|
||||
- 2026-06-07: `HIT-EA_refactor_ver6.mq5` から発注責務を分離し、SLTPパネルとポジション管理を `HITPositionManagerEA.mq5` へ移管する仕様を追加。
|
||||
|
||||
Reference in New Issue
Block a user