---
title: "他のIDEとの統合 - アルゴリズムトレードの世界へようこそ - MetaEditorのヘルプ"
description: "MetaEditorでは、MQL4や MQL5以外のコードを記述することができます。C++およびPythonのソースコードを編集およびコンパイルすることもできます。 さらに、MetaEditorを 他の開発環境の外部コンパイラ... - 他のIDEとの統合 - MetaEditorのヘルプ"
image: "https://www.metatrader5.com/i/logo_metatrader5.png"
url: "https://www.metatrader5.com/ja/metaeditor/help/beginning/integration_ide"
---

[MetaEditorのヘルプ](https://www.metatrader5.com/ja/metaeditor/help) → 他のIDEとの統合

# 他のIDEとの統合

MetaEditorでは、MQL4や MQL5以外のコードを記述することができます。C++およびPythonのソースコードを編集およびコンパイルすることもできます。 さらに、MetaEditorを[他の開発環境の外部コンパイラ](https://www.metatrader5.com/ja/metaeditor/help/beginning/integration_ide#compiler)として使用することもできます。

## С++コードの編集およびDLLコンパイル

MQL4/MQL5でトレーディングプログラムを開発する場合、サードパーティの C++ dll を使用できます。 C++ソースコードファイル (CPP および H) は、MQ4、MQ5、MQH と同様に編集することができます。 DLL 内のファイルは、エディタから直接コンパイルすることもできます。 ユーザーの PC にインストールされている Microsoft Visual Studio も使用することができます。 コンパイルするには、C++ ファイルを開き、F7 キー (コンパイルコマンド) を押します。

![C++ での DLL の操作](https://www.metatrader5.com/i/help/metaeditor/en/compile_dll.png)

> ユーザーの PC にインストールされている MS Visual Studio コンパイラは、C++ ソースコードのコンパイルに使用されます。 MS Visual Studio 2008 以降 (Express およびコミュニティバージョンを含む) がサポートされています。MS Visual Studio バージョン (32 または64ビット) は、MetaEditorバージョンと一致する必要があります。

MetaEditorは、エクスポートされた DLL 関数を MQL4/MQL5ファイルに追加する関数も提供します。 [[ナビゲータ](https://www.metatrader5.com/ja/metaeditor/help/workspace/navigator)] ウィンドウから、開いている MQ4、MQ5、または MQH ファイルにDLL ファイルをドラッグするだけです。

![DLL から関数をインポートする](https://www.metatrader5.com/i/help/metaeditor/en/dll_import.png)

## Pythonスクリプトの使用

Python言語には機械学習、プロセスの自動化、およびデータ分析と視覚化のための多数のライブラリがあります。高度な言語の可能性は、[Python統合モジュール](https://www.mql5.com/ja/docs/python_metatrader5)を介してプラットフォームに適用できるようになりました。

- 取引所データは、取引プラットフォームから簡単かつ迅速に取得し、Pythonツールを使用して分析できます。1つのコマンドで数十万の金融銘柄ティックをリクエストできます。
- アカウントの取引状態と取引履歴を取得して統計を計算します
- 独自のアルゴリズムに従って取引操作を実行します

Pythonスクリプトは、通常のMQL5プログラムと同様に[プラットフォームチャート上で直接実行されます](https://www.metatrader5.com/ja/terminal/help/algotrading/trade_robots_indicators#python)。

MetaEditorは、[Python](https://www.metatrader5.com/ja/metaeditor/help/development/python)開発用の特別な統合関数を備えています。空のスクリプトを作成するためのウィザード、エディターから直接実行する機能、メッセージとエラーの共通ログへの出力などです。

![エディターでのスクリプトの実行](https://www.metatrader5.com/i/help/metaeditor/en/python_compile.png)

## 他の開発環境で MQL プログラムをコンパイルする [#](#compiler)

MetaEditor実行可能ファイルは、外部エディタでソースコードを操作するときにコンパイラとして使用できます。 コンパイラは、コンパイルするファイルのパスと名前を指定して、コマンドラインから起動します。

- metaeditor.exe /compile:"<full path to the source file>"
- metaeditor64.exe /compile:"<ソースファイルへのフルパス>"

| サンプル |
| --- |
| ```<br>"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5"<br>``` |

### ディレクトリ内のファイルの大量コンパイル

大量にコンパイルする場合は、ファイルではなくフォルダへのパスを設定します。 指定されたフォルダ内のすべてのソースコードファイルがコンパイルされます。 サブフォルダは含まれません。

> ソースファイルに適切なコンパイル済みのバージョンがある場合、再コンパイルは実行されません。

次の例では、\MQL5\Scripts フォルダの一括コンパイルを表示します。

| サンプル |
| --- |
| ```<br>"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts"<br>``` |

### インクルードファイルを含むカスタム MQL5/MQL4フォルダ

プログラムには、インクルードファイル (* mqh) とリソースファイル (* .bmp, * .wav, *. ex4, * ex5) があり、現在のプラットフォームのタスクディレクトリの外にあります (たとえば、同じコンピュータ上の別のプラットフォームコピーの MQL5フォルダにあります)。 コンパイルには "/include" キーを使用して、このフォルダへのパスを指定します。 コンパイル時に、ファイルは次のように検索されます。

- Include files: [specified directory]\include\[path from #include<...>]
- Resource files: [specified directory]\[path from #resource "..."]

| サンプル |
| --- |
| ```<br>"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts" /include:"C:\Program Files\TradingPlatform 2\MQL5"<br>``` |

### コンパイルログ

コンパイルプロセスの詳細については、追加の/log キーを指定します。 この場合、 <source file name>.log コンパイルログファイルは、ソースファイルを含むフォルダに作成されます。

| サンプル |
| --- |
| ```<br>"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /log<br>Log file: C:\Program Files\TradingPlatform\MQL5\Script\myscript.log<br>``` |

### 構文チェック

コンパイルせずにプログラムの構文を確認するには、コマンドラインから/s および/log キーを使用してMetaEditorを起動します (チェックの結果がログファイルに表示されるようにします)。

| サンプル |
| --- |
| ```<br>"C:\Program Files\TradingPlatform\metaeditor64.exe" /compile:"C:\Program Files\TradingPlatform\MQL5\Scripts\myscript.mq5" /s /log<br>確認結果のファイル: C:\Program Files\TradingPlatform\MQL5\Script\myscript.log<br>``` |

## In this section

- [起動](https://www.metatrader5.com/ja/metaeditor/help/beginning/open)
- [設定](https://www.metatrader5.com/ja/metaeditor/help/beginning/settings)
- 他のIDEとの統合
- [メインメニュー](https://www.metatrader5.com/ja/metaeditor/help/main_menu)
- [ツールバー](https://www.metatrader5.com/ja/metaeditor/help/toolbar)
- [ワークスペース](https://www.metatrader5.com/ja/metaeditor/help/workspace)
- [プロジェクトおよびMQL5ストレージ](https://www.metatrader5.com/ja/metaeditor/help/mql5storage)
- [MQL4/MQL5ウィザード](https://www.metatrader5.com/ja/metaeditor/help/mql5_wizard)
- [プログラムの開発](https://www.metatrader5.com/ja/metaeditor/help/development)
- [SQLデータベースの操作](https://www.metatrader5.com/ja/metaeditor/help/database)
- [機械学習モデルの操作](https://www.metatrader5.com/ja/metaeditor/help/machine_learning)
- [プログラムの開発例](https://www.metatrader5.com/ja/metaeditor/help/project_example)
- [MetaEditor環境フォルダ](https://www.metatrader5.com/ja/metaeditor/help/structure)
- [MQL5コミュニティ: トレーダーのコミュニティ](https://www.metatrader5.com/ja/metaeditor/help/mql5community)
- [のヘルプ](https://www.metatrader5.com/ja/metaeditor/help/mql5_help)
- [トレーディングアプリケーションの開発に関する記事](https://www.metatrader5.com/ja/metaeditor/help/articles)
- [トレーディングプラットフォームのビデオガイド](https://www.metatrader5.com/ja/metaeditor/help/video_guides)

```json
{"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ {"@type": "ListItem", "position": 1, "item": {"@id": "https://www.metatrader5.com/ja/metaeditor/help", "name": "MetaEditorのヘルプ"}}, {"@type": "ListItem", "position": 2, "item": {"@id": "https://www.metatrader5.com/ja/metaeditor/help/beginning/integration_ide", "name": "他のIDEとの統合"}} ]}
{ "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{ "@type": "Question", "name": "MetaTrader 5: 他のIDEとの統合", "acceptedAnswer": { "@type": "Answer", "text": "MetaEditorでは、MQL4や MQL5以外のコードを記述することができます。C++およびPythonのソースコードを編集およびコンパイルすることもできます。 さらに、MetaEditorを 他の開発環境の外部コンパイラ として使用することもできます..." } }] }
```
