This very much looks like ChatGPT work.
In your code you have mixed MQL5 syntax with very old MQL4 syntax.
For start, this indicator needs "property strict" directive and it needs OnCalculate and OnInit functions instead of "init" and "start".
Use MetaEditor wizard and add new indicator file. Then try to migrate code from above init and start functions into OnInit and OnCalculate.
Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum (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, 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 |
|
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 |
|
FX EA Builder |
|
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello friends
I want to write a simple indicator as follows
According to the close price of the week and day Or any time the amount of ATR of the same time
Draw a line above and below the chart as follows
high_line= close price+ ATR
low_line = close price - ATR
for mt4