---
title: "AI Assistant - Developing programs - MetaEditor Help"
description: "MetaEditor features AI Assistant — the advanced automatic code completion tool powered by the OpenAI -based models. Write a... - AI Assistant - Developing programs - MetaEditor Help"
image: "https://www.metatrader5.com/i/logo_metatrader5.png"
url: "https://www.metatrader5.com/en/metaeditor/help/development/ai_assistant"
---

[MetaEditor Help](https://www.metatrader5.com/en/metaeditor/help) → [Developing programs](https://www.metatrader5.com/en/metaeditor/help/development) → AI Assistant

# AI coding assistant

MetaEditor features AI Assistant – the advanced automatic code completion tool powered by the [OpenAI](https://openai.com/blog/openai-codex)-based models. Write a trading idea in a natural language, and AI Assistant will offer its MQL5 implementation. This opportunity will be useful to everyone:

- Beginners receive ready-made code snippets to learn and to implement ideas
- Professionals will save time while coding

## Code generation [#](#prompt)

Add a comments with a prompt to the program code or part of the function you need to add. After that select "Prompt to AI Assistant" in the menu or press Ctrl+Alt+\. The neural network will analyze your prompt and will offer you code options to implement your idea.

![AI Assistant coding assistant](https://www.metatrader5.com/i/help/metaeditor/en/ai_assistant.png)

Depending on the file type, the string "MQL5 language", "Python language" or "C++ language" is automatically inserted at each prompt beginning. Thus, the neural network will provide the result in the required language.

## Code explanation [#](#explain)

In addition to writing new code, AI Assistant can explain the existing one. Select the desired code part and click "Explain via AI Assistant". Code explanation generated by the neural network will be added as a comment above the selected part.

![AI Assistant can explain the existing code](https://www.metatrader5.com/i/help/metaeditor/en/ai_assistant_explain.png)

## AI Assistant settings [#](#settings)

AI Assistant is currently free and is already enabled in the editor. There are several options available under Tools \ Options \ AI Assistant:

![AI Assistant settings](https://www.metatrader5.com/i/help/metaeditor/en/ai_assistant_settings.png)

Payment settings:

- Use MQL5 account – this option is currently available for free. Later, you will be able to pay for the subscription directly from your [MQL5 account balance](https://www.metatrader5.com/en/metaeditor/help/beginning/settings#mql5community).
- Use OpenAI API key – you can use it if you have already purchased the [subscription](https://openai.com/api/pricing/) and have the key.

Prompt settings:

- Model – a neural network which will process your requests. GPT-3.5 Turbo, GPT-4 Turbo and GPT-4o are currently available.
- Maximum tokens – the number of text units which the model can return in response to a prompt.
- Variability – affects how strictly the neural network will follow the prompt. The higher the value, the greater the result randomness. This option corresponds to the [temperature](https://platform.openai.com/docs/api-reference/chat#classifications/create-temperature) parameter in OpenAI models.

## In this section

- [Intelligent management](https://www.metatrader5.com/en/metaeditor/help/development/intelligent_management)
- [Find and replace](https://www.metatrader5.com/en/metaeditor/help/development/source_code_find)
- [Styler](https://www.metatrader5.com/en/metaeditor/help/development/styler)
- [Compilation](https://www.metatrader5.com/en/metaeditor/help/development/compile)
- [MQL5 Cloud Protector: Advanced protection for programs](https://www.metatrader5.com/en/metaeditor/help/development/mql5_cloud_protector)
- [Code debugging](https://www.metatrader5.com/en/metaeditor/help/development/debug)
- [Code profiling](https://www.metatrader5.com/en/metaeditor/help/development/profiling)
- AI Assistant
- [Generating included code](https://www.metatrader5.com/en/metaeditor/help/development/generate_mqh)
- [Working with C++ DLL (integration with MS Visual Studio)](https://www.metatrader5.com/en/metaeditor/help/development/c_dll)
- [Working with Python](https://www.metatrader5.com/en/metaeditor/help/development/python)
- [OpenCL support](https://www.metatrader5.com/en/metaeditor/help/development/opencl)

```json
{"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [ {"@type": "ListItem", "position": 1, "item": {"@id": "https://www.metatrader5.com/en/metaeditor/help", "name": "MetaEditor Help"}}, {"@type": "ListItem", "position": 2, "item": {"@id": "https://www.metatrader5.com/en/metaeditor/help/development", "name": "Developing programs"}}, {"@type": "ListItem", "position": 3, "item": {"@id": "https://www.metatrader5.com/en/metaeditor/help/development/ai_assistant", "name": "AI Assistant"}} ]}
{ "@context": "https://schema.org", "@type": "FAQPage", "mainEntity": [{ "@type": "Question", "name": "MetaTrader 5: AI Assistant", "acceptedAnswer": { "@type": "Answer", "text": "MetaEditor features AI Assistant — the advanced automatic code completion tool powered by the OpenAI -based models. Write a trading idea in a..." } }] }
```
