Questions from Beginners MQL5 MT5 MetaTrader 5 - page 738

 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 

Hello, such a question:

in the mql5 EA can I get values from the ex4 indicator?

 
Dmitry Melnichenko:

Hello, such a question:

in the mql5 EA can I get values from the ex4 indicator?


no
 
Comments not relevant to this topic have been moved to "FAQ on the Signals service".
 
Comments not related to this topic have been moved to "Questions from MQL4 MT4 MetaTrader 4 beginners".
 
Konstantin:

Hello forum members,

I need to get time series from ZigZag indicator, which will correspond to minima and maxima of this indicator, but as far as I know, I can only get double data from the indicator. Is it possible to do it easily and efficiently?


In MQL5 there is a structure

struct MqlRates 
  { 
   datetime time;         // время начала периода 
   double   open;         // цена открытия 
   double   high;         // наивысшая цена за период 
   double   low;          // наименьшая цена за период 
   double   close;        // цена закрытия 
   long     tick_volume;  // тиковый объем 
   int      spread;       // спред 
   long     real_volume;  // биржевой объем 
  };

We can create an array of structures and write the data of minima and maxima in them. But there will be some gaps in time of course.

 
Hello Mr. Karputov! I was making my EA for MT4. And made sure that it doesn't work as I need it to. I have a question: is there a limit to the number of ifs for an EA ? For example, to open a trade I use nine ifs, to close a trade I use 14 ifs. Also, I think I need to use some ifs to calculate the lot. Are there such limitations in MQL5? If I'm persuaded to switch to MQL5, will it have such limitations? I feel that someone wants me to be unable to earn by autotrading for half a year or longer. What is your answer? That's all for now. 2017.03.22_08:01 GMT+3.
 
Николай Никитюк:
Hello, Mr. Karputov! I was developing my Expert Advisor for MT4. And I saw that it did not work the way I wanted. I have a question: is there a restriction on the number of ifs for an EA? For example, to open a trade I use nine ifs, to close a trade I use 14 ifs. Also, I think I need to use some ifs to calculate the lot. Are there such limitations in MQL5? If I'm persuaded to switch to MQL5, will it have such limitations? I feel that someone wants me to be unable to earn by autotrading for half a year or longer. What is your answer? That's all for now. 2017.03.22_08:01 GMT+3.


As a rule, all ambiguities with the if-else statement occur because

 
Николай Никитюк:
Hello Mr. Karputov! I was making my EA for MT4. And made sure that it doesn't work as I need it to. I have a question: is there a limit to the number of ifs for an EA ? For example, to open a trade I use nine ifs, to close a trade I use 14 ifs. Also, I think I need to use some ifs to calculate the lot. Are there such limitations in MQL5? If I'm persuaded to switch to MQL5, will it have such limitations? I feel that someone wants me to be unable to earn by autotrading for half a year or longer. What is your answer? That's all for now. 2017.03.22_08:01 GMT+3.
Please show me a piece of code with lots of ifs that you are not sure about.
 
Николай Никитюк:
Hello Mr. Karputov! I was making my EA for MT4. And made sure that it doesn't work as I need it to. I have a question: is there a limit to the number of ifs for an EA ? For example, to open a trade I use nine ifs, to close a trade I use 14 ifs. Also, I think I need to use some ifs to calculate the lot. Are there such limitations in MQL5? If I'm persuaded to switch to MQL5, will it have such limitations? I feel that someone wants me to be unable to earn by autotrading for half a year or longer. What is your answer? That's all for now. 2017.03.22_08:01 GMT+3.

There's no limit on the amount of if, you're just probably not doing something right and that's it.