Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Please always use the CODE button (Alt-S) when inserting code.
Unlike in MQL4, in MQL5 there is no predefined variable called "Bars". There is however a function called "Bars()".
Also, unlike MQL4, in MQL5, the indicator functions like iMA() return handles and not the data directly, and you have to use CopyBuffer() instead to get the data
Is this ChatGPT generated code?
ChatGPT (or other A.I.) generates horrible code, mixing MQL4 and MQL5. So, if it is the case, then please use the Freelance section for such requests — https://www.mql5.com/en/job
- www.mql5.com
This could be simplified more:
int limit = rates_total - prev_calculated;
But that doesn't make sense because what follows is this:
if (limit <= 0) return (0); // The next time OnCalculate is called, prev_calculated will be 0
Actually, nothing good should be expected from the generated code😄
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I need help in this case: ERROR: '-' - open parenthesis expected 73: 43