I coded an EA - not trading

 
Hello everyone,

First time posting on here. I created an EA but for some reason I'm not sure of, it's not trading. Can someone help me diagnose the issue?
I can share you the EA file.


Best,
Michael
 
Michael Alek Fridman: First time posting on here. I created an EA but for some reason I'm not sure of, it's not trading. Can someone help me diagnose the issue? I can share you the EA file.

Obviously, NO ONE will be able to help you on such a vague and simple explanation of your issue.

You will need to show your code, your log output and explain in detail what your expectations and results are for your code.

Also, learn to use the built-in debugger and/or print out details to the log file to help you debug your code. Don't rely on others to do it for you.

 
Fernando Carreiro #:
to use the built-in debugger

Now is not the best time for this, better to wait until it is fixed😄

Fernando Carreiro #:
print out details to the log file

This is better than the built-in debugger😄

 
Fernando Carreiro #:

Obviously, NO ONE will be able to help you on such a vague and simple explanation of your issue.

You will need to show your code, your log output and explain in detail what your expectations and results are for your code.

Also, learn to use the built-in debugger and/or print out details to the log file to help you debug your code. Don't rely on others to do it for you.

Absolutely spot on Fernando. Amazing tips.

I guess let me start out by mentioning that I am not a software developer by no means. I used ChatGPT to build out the whole EA for me. I do know what I want, how to ask the right questions, and how to navigate code.

Attached is the code for starters. As for the logs, there really isn't much going on from what I can see, no errors...All I see in the logs is the EA being successfully loaded but not stepping into the actual trading, there is no activity.

Again, I'm not a software developer. I tried to debug and step through the code step by step, but nothing, no activity, no errors. I would be grateful for any help.

Best,
Michael

Files:
 

Your topic has been moved to the section: MQL4 and MetaTrader 4

MQL4 and MQL5 can be very different and require different approaches and solutions, especially regarding trading functionality.


In the future, please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893

Also, please don't request help for ChatGPT (or other A.I.) generated code. It generates horrible code, mixing MQL4 and MQL5. Consider using the Freelance section for such requests — https://www.mql5.com/en/job

It would be better if you studied how to code yourself, by studying the documentation or book and not relying on ChatGPT.

MQL4 is also very old (almost decrepit), so please consider upgrading to MQL5 instead.

 
Michael Alek Fridman #: Again, I'm not a software developer.

If you are just starting out, why does the code have mechanisms for Serial Key verification, as if it were a protected program to be later licensed and activated?

In fact, almost half of your code is dedicated to this alone. This is suspicious—please explain!

Michael Alek Fridman #: I tried to debug and step through the code step by step, but nothing, no activity, no errors.

The whole purpose of "debugging" is not just to react to reported errors, but most importantly for you to study the executed logic and compare it to the logic you expect.

If you know what you want it to do, then debugging allows you to see if it is following your required logic, and if not, what it is not supposed to do.

 
Michael Alek Fridman #: As for the logs, there really isn't much going on from what I can see, no errors...All I see in the logs is the EA being successfully loaded but not stepping into the actual trading, there is no activity.

Then add Print() at various key points, so that it outputs information and data about the progress of the logic so that you can detect if it is doing what you want or not.

It is the equivalent to asking employees or team members to give you progress reports at certain intervals when they are working on something of which you want to keep track.