🙆‍♀️

MetaTrader プラットフォームの MQL5 ウィザードでトレーディング ロボット(EA)を作成する方法

2024/02/18に公開

元ネタ

https://www.youtube.com/watch?v=XVW_6X_uf8Q&list=PLltlMLQ7OLeKwyQwC8FhiKwjl9syKhOCK&index=3
本投稿は上記動画の解説記事です。
当方、あまり英語が得意ではないので動画の文字起こし&翻訳を行います。
説明画像には動画の画像は使わず、私の方で実際に操作した際の画像を使います。
よってMetaEditorのバージョンやローカライズによっては動画のものと異なることがありますのでよろしくお願いします。
動画のなかで「トレーディング・ロボット」と呼んでいるのでそのまま使用しますが、EA(Expert Adviser)のことです。

スタート

取引プラットフォームにはMetaEditorと呼ばれる取引戦略のエディターが含まれており、プログラミングなしで取引ロボットを作成することができます。
内蔵のMQL5ウィザードを使用すると、コンポーネントを選択するだけで、新しいExpert Advisorを組み立てることができます。
50以上のExpert AdvisorがMQL5ウィザードで作成されており、その詳細な説明とスクリーンショットはすべてコードベース(図書館?)でご覧いただけます。

これらの取引ロボットはすべて、売買シグナルの生成、オープンポジションのトレール、資金管理の3つの主要ユニットで構成されています。
デフォルトのMQL5 Wizard標準モジュールパッケージには、20ユニットの売買シグナル、3つのポジショントレーリングモジュール、5つのロット管理モジュールが含まれています。
これらのユニットを組み合わせるだけで300のExpert Advisorを生成することができます。
しかし、実際に可能な組み合わせの数はほぼ無制限です。
それでは、どうしてそんなことができるのかを解説します。

Step1

MQL5ウィザードを起動し、「新規作成」を選択し、オプションを選択します。

Step2

ここで入力が必要な必須項目はExpert Advisorの名前だけで、他の項目は任意です。

Step3

最初のユニットは売買シグナルの生成を担当しますので、例えば「stchastic」インジケーターに基づくなど、必要なシグナルを選択します。


シグナルの詳細を見るみはクエスチョンマークをクリックするか、F1キーを押して説明をお読みください。

Step4

MQL5ウィザードでは複雑な取引戦略を作成できるので、「Envelopes」インジケーターに基づいたシグナルを追加してみましょう。


(選択リストから選択し、OKをクリックして追加)

さらに、最適化中に有利な取引時間帯と不利な取引時間帯を見つけるのに役立つ日中フィルターをオンにします。

さらに、シグナルの種類ごとに重みを設定し、売買シグナルへの寄与度を定義することができます。
モジュールの重みがゼロに近ければ近いほど、エキスパート・アドバイザーが下す最終的な取引決定への影響力は弱くなります。


ご覧のように、私たちは1台のロボットに3つのモジュールの売買シグナルを使用しています。
つまり、取引シグナル生成のための標準20モジュールを使用して、任意の数の組み合わせを作成することができます。

Step5

2つ目のユニットは、オープンポジションの保護ですが、トレーリングのタイプは、このステップで選択する必要があります。

例えば、パラボリック・インディケータに基づく一般的なトレーリング方法を例に取ります。

Step5

次に、ロットサイズ計算のモジュールの1つを、資金管理の3番目のユニットで選択する必要があります。

例えば、このExpert Advisorは保証金の3%のリスクレベルで取引します。

以上で、トレーディング・ロボットが作成され、コンパイルの準備が出来ました。


コンパイルが成功するとMetatradeの方にトレーディング・ロボットが追加されます。

Step6

次に、出来上がったExpert Advisorの入力パラメータをテストして最適化し、オンラインテスト用のデモ口座で実行することができます。

さまざまな複合体からなる複雑な取引システムが、プログラミングなしで作成されました。
それだけではありません
MQL5ウィザードではカスタムモジュールを使用することができます。
そのようなモジュールを開発したり、専門家に注文することもできます。
これにより、Expert Advisorを作成する機会がさらに増えるでしょう。
コードを一行も書かずに取引ロボットを作成する方法はお分かりいただけたと思います。
次のビデオでは、Freelanceのプロの開発者に必要なアプリケーションを注文する方法を検討します。

以下、元ネタ動画の文字起こし

The trading platform contains an editor of trading strategies called MetaEditor, which allows creating trading robots without programming.
With the built-in MQL5 Wizard, you simply select the components and assemble a new Expert Advisor.
Over 50 Expert Advisors have been created in the MQL5 Wizard and their detailed descriptions and screenshots are all available in the Code Base.
All these trading robots are composed of three main units, which include the generation of buy and sell signals, trailing of open positions, and money management.
The default MQL5 Wizard standard package of modules contains 20 units of trading signals, 3 position trailing modules and 5 lot management modules.
By simply combining these units you can generate 300 Expert Advisors.
However, the actual number of possible combinations is almost unlimited.
Here is why.
Start the MQL5 Wizard and select the option "generate Expert Advisor".
The only required field needed to be completed here is the name of the Expert Advisor, the other fields are optional.
The first unit is responsible for the generation of trading signals, so choose the required signals, for example based on the "Stochastic" indicator.
Click on the question mark or press F1 to read its description.
The MQL5 Wizard allows creating complex trading strategies, so let's add signals based on the "Envelopes" indicator.
Additionally we turn on the intraday filter, which will help find favorable and unfavorable trading hours during optimization.
Furthermore, individual weights can be set for each type of signal to define their contribution to the resulting trading signal.
The closer the weight of a module to zero, the weaker its influence on the final trade decision made by the Expert Advisor.
As you can see, we have used a unit with three modules of trading signals in one robot.
It means, any number of combinations can be created using the standard 20 modules for the generation of trading signals.
The second unit is the protection of open positions.
Type of trailing should be chosen in this step.
For example, take a popular trailing method based on the Parabolic indicator.
Next one of the modules for lot size calculation should be selected for the third unit of money management.
For example, this Expert Advisor will trade with the risk level of 3% of the deposit.
That's all, we have developed a trading robot, which is ready for compilation now.
We can then test and optimize the input parameters of the resulting Expert Advisor and run it on a demo account for online testing.
A complex trading system consisting of various complexes has been created without programming.
But that's not all
the MQL5 Wizard allows using custom modules.
You can develop such modules or order them from professionals.
This will provide even more opportunities for creating Expert Advisors.
Now you know how to create a trading robot without writing a single line of code.
In the next video we shall examine how to order a required application from a professional developer in the Freelance.

Discussion