EA 自動売買プログラム


このコーナーでは、EA 自動売買プログラム(スクリプト)を紹介しています。
MT4では自動売買システムをExpert Advisor (EA) という形で作成します。

EAファイル(拡張子.mq4(ソースファイル)、.ex4(システムファイル))は、掲示板に添付するか、このページの編集画面から添付できます。
画像は、掲示板に添付した画像へのURIを直接貼ってください。


   

.ex4と.mq4のインストール方法

  • .ex4

C:\Program Files\MetaTrader 4\experts ディレクトリ にコピペでおk

最新のMT4では、
・MT4インストールディレクトリ>MQL4>Indicators
あるいは
・MT4を起動して、メニューバーのFile>Open Data Folder を選択>MQL4>Experts
に変更されています。

  • .mq4

.mq4はソースファイルなので、コンパイルをする必要がある。

(方法1)C:\Program Files\MetaTrader 4\experts に.mq4ファイルをコピー、
 →MetaTrader を起動すると、自動でコンパイルしてくれる。(.ex4ファイルが自動的に作成される)

最新のMT4では、
・MT4インストールディレクトリ>MQL4>Indicators
あるいは
・MT4を起動して、メニューバーのFile>Open Data Folder を選択>MQL4>Experts
に変更されています。
 
(方法2)Tools > MetaQuotes Language Editor を開き、
File > Open でコンパイルしたい.mq4ファイルを開く。
んで、ツールバーのCompileをクリック

  • .ex4と.mq4の違い

.mq4をコンパイルしたものが.ex4ファイル。
.mq4だと、プログラムの中身が分かるので手直しが簡単。この形での配布を推奨。
中身を他人に知られたくない場合は.ex4で配布するといいかも。

カスタムインディケータとEAとの違い

Expert Advisor is a mechanical trading system (MTS) linked up to a certain chart. An Advisor starts to run with every incoming tick for a given symbol. The Advisor will not be launched for a new, tick if it is processing the previous one at this moment (i.e., the Advisor has not completed its operation yet). The Advisor can both inform you about a possibility to trade and trade at an account automatically sending orders directly to the trade server. Like most trading systems, the terminal supports testing strategies on history data with displaying trading in-and-out points in the chart.
Experts are stored in terminal_directory\experts.

エキスパートアドバイザー(EA)は特定のチャートにリンクされた機械的売買システム(MTS)です。EAは記号で指定されたティックごとに実行を開始します。以前のティックを処理中の場合、EAは新しいティックを処理しません(たとえば、まだ処理を終えていない場合)。EAは売買可能かについてあなたに知らせ、自動的にサーバに発注します。ほとんどの売買システムと同じように、過去データで戦略をテストでき、トレードの開始点・終了点をチャート上で示すことができます。
EAはMetaTrader 4ディレクトリ下のexpertsに格納されます。

Custom Indicator is a technical indicator written independently in addition to those already integrated into the client terminal. Like built-in indicators, they cannot trade automatically and are intended for implementing of analytical functions only.
Custom Indicators are stored in terminal_directory\experts\indicators.

カスタムインディケータは、クライアントターミナル(MT4)に統合されているインディケータに加えて、独立して書かれたテクニカルインディケータです。組み込まれているインディケータと同様に自動売買はできません。分析機能を提供することを目的としています。
カスタムインディケータはMetaTrader 4ディレクトリ下のexperts\indicatorsに格納されます。

EA作成で参考になるページ

公式リファレンス MQL4 Reference

MQL4 Reference日本語化プロジェクト

Show Us Your Best EA - Forex Trading
http://www.forex-tsd.com/expert-advisors-metatrader-4/264-show-us-your-best-ea.html

Expert Advisor Builder for MetaTrader 4
http://sufx.core.t3-ism.net/ExpertAdvisorBuilder/

MQL4入門レッスン 文系人間のためのシステムトレーダー養成所
http://fxboyt.blog56.fc2.com/blog-category-4.html

メタバイザーによる、メタトレーダーアカデミア
http://metavicer.blog61.fc2.com/

SKILL UP FX! :: ツール » MQL入門
http://sufx.core.t3-ism.net/catid_8_subcatid_5.html?page=2

システムトレード研究所 〜FXで完全自動売買〜
http://blog.jidoubaibai.com/

FX自動売買研究所
http://www.autofx-lab.com/

投稿

お名前: コメント: