This simple EA is supposed to take trades the the slow MA crosses the fast MA, with an added confirmation from A/D indicator.
I compiled it, and it works. During the back test the indicators are showing. But its not placing trades. I asked ChatGPT and Claude but their fix also dosent work. Im stuck I dont know what to do.
Traders and coders are working for free:
- if it is interesting for them personally, or
- if it is interesting for many members on this forum.
Freelance section of the forum should be used in most of the cases.

- 2025.05.13
- www.mql5.com
This simple EA is supposed to take trades the the slow MA crosses the fast MA, with an added confirmation from A/D indicator.
I compiled it, and it works. During the back test the indicators are showing. But its not placing trades. I asked ChatGPT and Claude but their fix also dosent work. Im stuck I dont know what to do.
Are there any errors in the strategy tester journal log? Click on the journal tab and check.
This simple EA is supposed to take trades the the slow MA crosses the fast MA, with an added confirmation from A/D indicator.
I compiled it, and it works. During the back test the indicators are showing. But its not placing trades. I asked ChatGPT and Claude but their fix also dosent work. Im stuck I dont know what to do.
search the site for examples for ArraySetAsSeries. not saying it is your problem, however, it could be.
examples are also in your mt5 terminal under folder Examples.Are there any errors in the strategy tester journal log? Click on the journal tab and check.
No, everything seems fine:
2025.05.13 19:50:49.807 Tester "Advisors\WMA+AD_EA_ChatGPT.ex5" 64 bit
2025.05.13 19:50:50.585 Tester GBPUSD: history data begins from 2001.01.01 00:00
2025.05.13 19:50:50.585 Tester GBPUSD: history data begins from 2001.01.01 00:00
2025.05.13 19:50:50.633 Core 1 agent process started on 127.0.0.1:3000
2025.05.13 19:50:50.634 Core 1 connecting to 127.0.0.1:3000
2025.05.13 19:50:52.278 Core 1 connected
2025.05.13 19:50:52.334 Core 1 authorized (agent build 4755)
2025.05.13 19:50:52.342 Tester GBPUSD,M5 (PepperstoneUK-Live): visual testing of Experts\Advisors\WMA+AD_EA_ChatGPT.ex5 from 2025.01.01 00:00 to 2025.05.12 00:00
2025.05.13 19:50:53.402 Core 1 common synchronization completed
2025.05.13 19:50:53.653 Tester quality of analyzed history is 100%
2025.05.13 19:50:58.366 Core 1 connection closed
2025.05.13 19:50:52.342 Tester GBPUSD,M5 (PepperstoneUK-Live): visual testing of Experts\Advisors\WMA+AD_EA_ChatGPT.ex5 from 2025.01.01 00:00 to 2025.05.12 00:00
ChatGPT code is full of bugs and errors, and wrong syntax and coding is crap. Everything is NOT fine. ChatGPT code is not allowed on this forum.
Forum on trading, automated trading systems and testing trading strategies
Can Check The Codes to See Why This EA Doesn't Work?
William Roeder, 2024.06.26 22:00
-
Stop using ChatGPT/Copilot.
Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum #2 (2023)ChatGPT (the worst), “Bots Builder”, “EA builder”, “EA Builder Pro”, EATree, “Etasoft forex generator”, “Forex Strategy Builder”, ForexEAdvisor (aka. ForexEAdvisor STRATEGY BUILDER, and Online Forex Expert Advisor Generator), ForexRobotAcademy.com, forexsb, “FX EA Builder”, fxDreema, Forex Generator, FxPro, “LP-MOBI”, Molanis, “Octa-FX Meta Editor”, Strategy Builder FX, “Strategy Quant”, “Visual Trader Studio”, “MQL5 Wizard”, etc., are all the same. You will get something quick, but then you will spend a much longer time trying to get it right, than if you learned the language up front, and then just wrote it.
Since you haven't learned MQL4/5, therefor there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into yours.
We are willing to HELP you when you post your attempt (using Code button) and state the nature of your problem, but we are not going to debug your hundreds of lines of code. You are essentially going to be on your own.
ChatGPT - Even it says do not use it for coding. *
- Mixing MT4 and MT5 code together.
- Creating multiple OnCalculate/OnTick functions.
- OnCalculate returning a double.
- Filling buffers with zero in OnInit (they have no size yet). Setting buffer elements to zero but not setting Empty Value to correspond.
- Calling undefined functions.
- Calling MT4 functions in MT5 code.
- Sometimes, not using strict (MT4 code).
- Code that will not compile.
- Creating code outside of functions. *
- Creating incomplete code. *
- Initialization of Global variables with non-constants. *
- Assigning a MT5 handle to a double or missing the buffer and bar indexes in a MT4 call. *
- Useing MT4 Trade Functions without first selecting an order. *
- Uses NULL in OrderSend. *
bot builder Creating two OnInit() functions. * EA builder EATree Uses objects on chart to save values — not persistent storage (files or GV+Flush.) No recovery (crash/power failure.) ForexEAdvisor - Non-updateing global variables.
- Compilation errors.
- Not checking return codes.
- Not reporting errors.
FX EA Builder - Not checking return codes.
- Loosing open tickets on terminal restart. No recovery (crash/power failure.)
- Not adjusting stops for the spread. *
- Using OrdersTotal directly.
- Using the old event handlers.
-
double fastEMA = iMA(NULL, 0, 20, 0, MODE_EMA, PRICE_CLOSE, 0); double slowEMA = iMA(NULL, 0, 400, 0, MODE_EMA, PRICE_CLOSE, 0);
Why did you post your MT4 question in the MT5 General section instead of the MQL4 section, (bottom of the Root page)?
General rules and best pratices of the Forum. - General - MQL5 programming forum? (2017)
Next time, post in the correct place. I have moved this thread. -
Check your return codes, and report your errors (including market prices and your variables). Don't look at GLE/LE unless you have an error. Don't just silence the compiler (MT5 / MT4+strict), it is trying to help you.
What are Function return values ? How do I use them ? - MQL4 programming forum (2012)
Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles (2014)
No, everything seems fine:
2025.05.13 19:50:49.807 Tester "Advisors\WMA+AD_EA_ChatGPT.ex5" 64 bit
2025.05.13 19:50:50.585 Tester GBPUSD: history data begins from 2001.01.01 00:00
2025.05.13 19:50:50.585 Tester GBPUSD: history data begins from 2001.01.01 00:00
2025.05.13 19:50:50.633 Core 1 agent process started on 127.0.0.1:3000
2025.05.13 19:50:50.634 Core 1 connecting to 127.0.0.1:3000
2025.05.13 19:50:52.278 Core 1 connected
2025.05.13 19:50:52.334 Core 1 authorized (agent build 4755)
2025.05.13 19:50:52.342 Tester GBPUSD,M5 (PepperstoneUK-Live): visual testing of Experts\Advisors\WMA+AD_EA_ChatGPT.ex5 from 2025.01.01 00:00 to 2025.05.12 00:00
2025.05.13 19:50:53.402 Core 1 common synchronization completed
2025.05.13 19:50:53.653 Tester quality of analyzed history is 100%
2025.05.13 19:50:58.366 Core 1 connection closed
I compiled your EA and ran it (as-is) on a USDJPY and it made many trades (too many!). I wonder about the following line which is in the buy and sell parts of the code.
request.type_filling = ORDER_FILLING_IOC;
There are a number of different filling modes, not all supported by every broker. It is possible that your broker doesn't support ORDER_FILLING_IOC
For more info links and posts google:
site:mql5.com unsupported filling mode

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
This simple EA is supposed to take trades the the slow MA crosses the fast MA, with an added confirmation from A/D indicator.
I compiled it, and it works. During the back test the indicators are showing. But its not placing trades. I asked ChatGPT and Claude but their fix also dosent work. Im stuck I dont know what to do.