Alım-satım robotlarını ücretsiz olarak nasıl indirebileceğinizi izleyin
Bizi Facebook üzerinde bulun!
Fan sayfamıza katılın
Kodu ilginç mi buldunuz?
Öyleyse bir link gönderin -
başkalarının da faydalanmasını sağlayın
Kodu beğendiniz mi? MetaTrader 5 terminalinde deneyin
Uzmanlar

News Guard — news filter and slippage log for your existing EA - MetaTrader 5 için uzman

Masako Katayama
Masako Katayama
HT Star Trader — AI-partner tools for MetaTrader 5: an execution-only EA that connects your AI to MT5, and a fully customizable indicator set. Tools, not signals. Every trading decision stays yours.
Görüntülemeler:
194
Derecelendirme:
(1)
Yayınlandı:
screenshot.png (159.36 KB)
\MQL5\Experts\
MQL5 Freelance Bu koda dayalı bir robota veya göstergeye mi ihtiyacınız var? Freelance üzerinden sipariş edin Freelance'e git

ほぼすべてのEAがライブトレードで2つの問題に直面します。1つ目は、発表を事前に知らされていないため、ニュースの急騰時にトレードを開始してしまうことです。2つ目は、約定価格と要求価格が記録されていないため、数週間後に実際の約定コストが分からなくなってしまうことです。News Guardは、ストラテジーに手を加えることなく、これらの問題を両方とも解決する小型モジュールです。

1) ニュースフィルター(クラスCNewsGuard)

  • チャートシンボルの2つの通貨(EURUSDはユーロと米ドルの発表を監視します)について、MT5に組み込まれている経済カレンダー(CalendarValueHistory)を読み取ります。金属や指数については通貨の上書きが可能です(金は通常米ドルのみで済みます)。
  • 静止期間を設定します。リリース前後の何分間、新規エントリがブロックされるか、また、中程度の重要度のリリースもカウントするか、それとも重要度の高いリリースのみをカウントするかを設定できます。
  • あなたのコードは IsBlocked() という 1 つの質問をするだけで、ログに記録したり表示したりする準備ができた、平易な言葉で理由が返されます ("2026年1月9日15時30分時点の非農業部門雇用者数 (USD) — 30分前/15分後の期間内")。
  • NextEvent() は、パネルとログの次回のリリース予定日を通知します。
  • 正直な障害モード:カレンダーがデータを返さない場合(オフライン時、またはカレンダーが空になる可能性があるストラテジーテスターの場合)、モジュールはすべてが正常であるかのように装うのではなく、CALENDAR_UNAVAILABLE を報告します。EA は、これが何を意味するかを決定します。この例には、「fail closed」スイッチがあります。

2) スリップログ(クラス CSlippageLog)

  • EAが注文を送信すると、NoteRequest(注文チケット、価格)で要求価格を記録します。
  • 取引が成立すると (OnTradeTransaction)、OnDeal() はスリッページをポイント単位で計算します (買いと売りの両方で、プラスは常に「要求されたよりも悪い」ことを意味します)。そして、次の内容の CSV 行を 1 つ追加します: time、symbol、deal、order、type、volume、request、executed、slippage。
  • 実行中の統計情報はメモリに保持されます。記録された約定件数、平均スリッページ、最悪スリッページ、および要求価格が記録されずに到着した取引数などが含まれます。

それができないこと

このモジュールは注文の送信、変更、決済を一切行わず、エントリーの決定も行いません。質問に答え、記録を保持するだけで、EAが完全な制御権を保持します。サンプルEAのエントリーシグナルは常にfalseを返すプレースホルダーであり、サンプルEA自体がトレードを行うことはありません。パネル、配線、およびコード内にマークされた正確な統合ポイントを示します。

設定

  1. NewsGuard.mqh を EA と同じフォルダ (または MQL5\Include フォルダ) に配置してください。
  2. NewsGuardExampleEAをチャートにアタッチして、パネルとログの動作を確認してください。
  3. 独自のEAで使用するには、#include "NewsGuard.mqh" を追加し、2つのオブジェクトを作成し、エントリーの前にNewEntryAllowed()を要求し(例のOnTickに示されているパターン)、各注文送信後にNoteRequest()を呼び出し、OnTradeTransactionからスリッページログに取引を転送します。

サンプルEAの入力項目(平易な言葉で説明)

  • リリース前後のブロック時間(静止時間) ― 静止時間枠のサイズ。
  • どのリリースがカウントされるのか ― 高リリースのみか、それとも高リリースと中リリースか。
  • 通貨の上書き — シンボル名に、関心のある通貨が含まれていない場合に使用します。
  • カレンダーが利用できない場合にエントリをブロックする ― フェイルクローズスイッチ。
  • 更新間隔、スリップページファイル名、共通ファイルフォルダの切り替え、パネルのオン/オフ。

無料でどなたでもご利用いただけます。これは、測定およびリスク管理ツールの小規模シリーズの一部です。著者はMT5用の表示、測定、リスク管理ユーティリティを開発しており、MQL5フリーランスサービスを通じてカスタム開発も請け負っています。

Tester Memo Helper — Strategy Tester report to verification memo Tester Memo Helper — Strategy Tester report to verification memo

A script that reads an MT5 Strategy Tester report (HTML) — and, if you give it one, the tester log — and writes a short verification memo: the key figures in one place, each compared against pass/check criteria that you set yourself, plus a count of problem-like lines in the log with samples.

Five Point Retest Five Point Retest

Five-point retest structures found on closed bars and turned into plans: a retest band, a target at point 3 and a fail level. Each plan runs until the target is touched or a close goes past the fail level, then fades, and a panel shows how many bullish and bearish structures reached the target on the chart you are looking at.

Trading Conditions Monitor - Gold, Forex and Synthetics Trading Conditions Monitor - Gold, Forex and Synthetics

Is it a good moment to trade? One panel combines spread, session, rollover, volatility, daily range and high-impact news into a clear GOOD / CAUTION / AVOID status. Works on all symbols, tuned for gold (XAUUSD).

Squeeze Duration Statistics: How Long a Low-Volatility Squeeze Lasts and How Far the Range Expands After It Squeeze Duration Statistics: How Long a Low-Volatility Squeeze Lasts and How Far the Range Expands After It

Measures low-volatility squeezes on your own symbol and timeframe. A squeeze is a run of bars in which the range of the last bars is small compared with the ATR. The indicator draws the length of every squeeze, marks the bar that ended it, and a panel shows how long squeezes last, how far the range expanded in the bars after the release, how that compares with any other bar, and which side of the squeeze box the first close went to. It is a statistics tool and gives no trade signals.