The future of MQL5 is MQL5+ or even MQL6 - page 8

 
Karputov Vladimir:

I don't know what simultaneous testing on several TFs is, but the fact that you can't switch to other TFs at least after testing is not good. Well, switching during visual testing would be awesome.
 

The future... well, well. "Thank you, it's funny" (c).



 
When optimizing, I would like to see the result of the run as a percentage, rather than the numbers displayed in the "Result" column. And in the backtest it would be nice if the result "Net profit" had a profit in %.
 
Rinat Tukaev:
When optimizing, I would like to see the result of the run as a percentage, rather than the numbers displayed in the "Result" column. And in the backtest, it would be nice if the result "Net profit" had a profit in %.
Insert your formula into OnTester() event handler and see the result you need.
 
Yury Reshetov:
Insert your formula into the OnTester() event handler and see the result you need.
Thank you! I didn't know)
 
I suggest to make the global variables of the program not to cross the variables and parameters in plugins in MQL4 and MQL5. I declared a variable 'point' in my Expert Advisor and now I'm getting a lot of messages like: "declaration of 'point' hides global declaration in file 'expert.mq4' at line 153 ChartObject.mqh 154 39". It's horrible when you can't declare a variable in a module, program, which is in the parameters of another module. Why does ChartObject.mqh module need to see my Expert Advisor, expert.mq4, if ChartObject.mqh doesn't declare it explicitly?
 
Mihail Matkovskij:
I suggest to make the global variables of the program not to cross the variables and parameters in plugins in MQL4 and MQL5. I declared a variable 'point' in my Expert Advisor and now I'm getting a lot of messages like: "declaration of 'point' hides global declaration in file 'expert.mq4' at line 153 ChartObject.mqh 154 39". It's horrible when you can't declare a variable in a module, program, which is in the parameters of another module. Why does ChartObject.mqh module need to see my Expert Advisor, expert.mq4, if ChartObject.mqh doesn't declare it explicitly?
Obviously it would help you
#property strict
 
Igor Volodin:
Obviously it will help you.
Yes, I have this line in my EA, but it's not in the ChartObject.mqh module. I'm not going to rewrite all the standard modules because of it...
 
Mihail Matkovskij:
Yes, I have this line in my Expert Advisor, but it is not in ChartObject.mqh module. I'm not going to rewrite all standard modules because of it...


Got it. In that case, don't create global variables. You may do without them. Otherwise, with any coincidence, e.g. a very common name:

int i;

globally declared will be overwritten by locally declared. This is what you are warned about.

And plugin does not have its own scope, it's not a module, it's just a piece of code that will be inserted where you write include.

 
Igor Volodin:


Got it. Then don't create global variables. You can do without them.

What do you mean, don't create them? In any programming language global variables are freely used and it's ok, but the compiler swears. The error is not crucial, but still it is inconvenient.

double point = MarketInfo(EA_Symbol(), MODE_POINT);

The variable point reports the price of 1 point and is a substitute for the standard Point. The MarketInfo(EA_Symbol(), MODE_POINT) function gives the price of 1 point for any symbol. Further, the variable point can be used in any function, in the body of the EA, if it is a global variable of course. Agree that such cases cause some inconveniences quite often (if you certainly have experience in MQL programming). And although they can be avoided, but the question is why, if in other modern languages such problems simply do not exist?

Reason: