Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1545

 
maxvoronin74 #:
I apologise for my inattention. Of course, it is not the compiler but the terminal that generates the error.

I could find that IndMax in the code

if(VolatilitiLow1==0&&VolatilitiLow2>0&&VolatilitiLow3==0&&VolatilitiLow4>0&&VolatilitiLow5==0&&VolatilitiLow6>0)
{
   double Array42[]={VolatilitiUp1,VolatilitiLow2,VolatilitiUp3,VolatilitiLow4,VolatilitiUp5,VolatilitiLow6};
   int IndMax=ArrayMaximum(Array42,WHOLE_ARRAY,0);
   Volatiliti=Array42[IndMax];
}
has a value of -1. Which, as I understand, cannot be. The check showed that the array has a positive number of elements with positive values. Hence a clarifying question, how to correctly set the task of determining the index of the largest element of the array?
Files:
 
maxvoronin74 #:

I was able to find that IndMax in the code

has a value of -1. Which, as I understand, cannot be.
I may be wrong, but check the argument order of the ArrayMaximum() function. It seems that 0 must come before WHOLE_ARRAY
 
Yuriy Bykov #:
I may be wrong, but check the argument order of ArrayMaximum() function. It seems that 0 must come before WHOLE_ARRAY
I did. It worked. Thank you. I didn't think to check it at once.
 

The Volatiliti variable takes the price value instead of the value according to the formula. I don't see where the error is.

In the log file, the first 2 lines are components from which this variable is calculated according to the formula. The result is clearly the price from the market, not the result of the calculation.

Thank you for your help.

Files:
 
Hello, please tell me how to fix this warning:
implicit conversion from 'string' to 'string'

It generates this warning here:
double SL = edit7.Text();


 
Igor168 #:
Hello, please tell me how to fix this warning:
implicit conversion from 'string' to 'string'

It generates this warning here:

The cause of this warning is elsewhere.

 
Igor168 #:
double SL = edit7.Text();
double SL = (string)edit7.Text();
 
Igor168 #:
Hello, please tell me how to fix this warning:
implicit conversion from 'string' to 'string'

It generates this warning here:
double SL = (double)edit7.Text();
 

Hello!

Please tell me if there is a limit in MT4-5 on the number of indicators on one chart. I'm doing it in MT5 .Ten indicators work fine, the eleventh and further - it doesn't work.

The buffer does not initialise the eleventh array initially at initialisation, it refuses.

 
Александр #:
Ten indicators work well - the eleventh and further - it does not work.

You are doing something wrong. You need a sample code to reproduce it.

Reason: