Please explain in detail your issue. We can't read your mind.
And please use the MetaEditor Styler to "style" your code, so that it becomes more readable.
Also, is this ChatGPT generated code? If so, please stop using it.
If your code doesn't do what it should use the debugger to find out where, why and when it happens and what variable causing this:
https://www.metatrader5.com/en/metaeditor/help/development/debug
https://www.mql5.com/en/articles/654
https://www.mql5.com/en/articles/35
https://www.mql5.com/en/articles/2041
https://www.mql5.com/en/articles/272
https://www.mql5.com/en/articles/150
- www.metatrader5.com
-
currentSpread = NormalizeDouble(_Ask - _Bid, _Digits);
Do not post code that will not even compile. No such variables.
- Don't try to use any price (or indicator) or server related functions in OnInit (or on load or in OnTimer before you've received a tick), as there may be no connection/chart yet:
- Terminal starts.
- Indicators/EAs are loaded. Static and globally declared variables are initialized. (Do not depend on a specific order.)
- OnInit is called.
- For indicators OnCalculate is called with any existing history.
- Human may have to enter password, connection to server begins.
- New history is received, OnCalculate called again.
- A new tick is received, OnCalculate/OnTick is called. Now TickValue, TimeCurrent, account information and prices are valid.
-
Stop using ChatGPT.
Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum #2 (2023)int bkrH = TimeHour(TimeCurrent());
no such function in MQL5switch ( OrderType() ) { case OP_BUYSTOP:
MQL4 code
Let me scratch it.
Yeah, up to Half of it is gotten based on instructions from ChatGPT, I was using it to learn mql5, I think that is where the problem is from.
Let me scratch it.
Searching is the better AI - the code is working!
Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5!
Searching is the better AI - the code is working!
Bear in mind there's virtually nothing that hasn't already been programmed for MT4/MT5!
Thank you.
I am trying to learn mql4/mql5. I have this idea in my mind but it is really complicated and I do not know if it is possible to be implemented so I want to learn the language and see
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use