1. Always use the Code Styler - you will immediately see the place where the brace is not superfluous (or vice versa: the place where the brace is missing).
2. Remember: in MQL5 the indicator handle is created ONLY ONCE !!! And this is done in OnInit ().
Correct your mistakes and post the result.
1. Always use the Code Styler - you will immediately see the place where the brace is not superfluous (or vice versa: the place where the brace is missing).
2. Remember: in MQL5 the indicator handle is created ONLY ONCE !!! And this is done in OnInit ().
Correct your mistakes and post the result.
but I am not a developer and I do not understand well.
I am empirical
remove this and I have more errors :(
int OnInit(){ MAHandle = iMA(NULL, 0, MovingPeriod, MovingShift, MODE_SMMA, PRICE_CLOSE, pos); if(MAHandle == INVALID_HANDLE) { Print(“Error creating MA indicator”)
As I understood you, I was already defined here!
int OnInit() { PlotIndexSetInteger(0,PLOT_LINE_STYLE,STYLE_SOLID); PlotIndexSetInteger(0,PLOT_LINE_WIDTH,2); PlotIndexSetInteger(0,PLOT_LINE_COLOR,DeepPink); SetIndexBuffer(0,LineBuffer,INDICATOR_DATA); PlotIndexSetInteger(0,PLOT_LINE_STYLE,STYLE_SOLID); PlotIndexSetInteger(0,PLOT_LINE_WIDTH,2); PlotIndexSetInteger(0,PLOT_LINE_COLOR,DeepPink); SetIndexBuffer(5,ZL1); PlotIndexSetInteger(0,PLOT_LINE_STYLE,STYLE_SOLID); PlotIndexSetInteger(0,PLOT_LINE_WIDTH,2); PlotIndexSetInteger(0,PLOT_LINE_COLOR,DeepPink);
Do this: start building your program right from the beginning.
Open the MQL4 / MQL5 Wizard and create a program template.
Post the result.

- www.metatrader5.com
Do this: start building your program right from the beginning.
Open the MQL4 / MQL5 Wizard and create a program template.
Post the result.
-
Define your variables before you use them.
If you don't learn MQL4/5, 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 your code.
-
Stop using ChatGPT.
Help needed to debug and fix an AI EA - Trading Systems - MQL5 programming forum #2 (2023)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi Guys it is me again
I started reading the documentation and I can't fix these 2 errors
'}' - unexpected end of program
'{' - unbalanced parentheses
Can someone help me
thanks