Trying out EA customization using Copilot (Copilot), a generative AI provided by Microsoft
I used Copilot, provided by Microsoft, to customize the EA "Moving Average.ex4" that has been in MT4 from the start.
The EA program "Moving Average" built into MT4 is a simple logic EA: when the current price crosses the moving average from below to above, it goes long; when it crosses from above to below, it goes short.
I want to customize the logic of this EA using Microsoft Copilot to create an EA that buys on Golden Cross and sells on Dead Cross.
Will it work well?
First, I sent the prompt: "Please rewrite the following program to buy on a Golden Cross and sell on a Dead Cross."
The result is... it automatically changed to Python, a programming language.
Next, I tried making the instructions more detailed.
Please rewrite the following MQL4 program to use two moving averages and buy on a Golden Cross and sell on a Dead Cross.
void CheckForOpen() is the entry point.
void CheckForClose() is the exit point.
This time it seems to have worked.
However, an error occurs.
To fix the error, you need programming knowledge.
The error asks you to specify the short-term moving average period and the long-term moving average period.
Coincidentally, there was a Gold Cross/Dead Cross EA with good forward results, so I will try using the parameter values as they are.
GoldenCross_USDJPY
MAPeriod1 = 90; // Short-term moving average (roughly 90 on a 5-minute chart, roughly 450 on a 1-minute chart)
MAPeriod2 = 300; // Long-term moving average (roughly 300 on a 5-minute chart, roughly 1500 on a 1-minute chart)
Since this time I’m running on a 5-minute chart, the short-term moving average is set to 90 and the long-term moving average to 300.
When I ran a backtest, it turned positive.
However, there are no bug or error fixes, so a fatal bug can occur.
If you run a buggy EA on a live account, it can enter an infinite loop of entries and exits, causing your account balance to vanish, so please be careful.
By the way, this time I used Copilot, but I also tried Google's Gemini.
Gemini wrote outside of the specified locations as well, causing many errors.
I haven’t tried ChatGPT, but from articles by people who attempted it, it seems errors occur.
I will consider the future of generating AI for EA and indicator creation.
It may take a while for generation AI to fully cover the MQL4 language, which is a minor language.
Soon, GPTs customized for MT4 will emerge, so will EA creators go out of business at that point?
If AGI (general artificial intelligence) analyzes big data, backtests, optimizes and even trades, what remains for us humans to do is which AI to choose.
Currently ⇒ which EA to run?
Future ⇒ which AI to run?
I hope this helps you in your investments.
× ![]()