One more question has come up. Problem with sum of values. type sum+=a[i] (read in tutorial)
Incorrectly returns sum of values, please point out the error.
for (i=4; i<19; i++){
sum+=GetPrcH12(symb[i]);//сумма значений по номеру i пары
}
//+------------------------------------------------------------------+double GetPrcH12(string symb){
int i=iBarShift(NULL, 0, StrToTime(TimeToStr(Time[0], TIME_DATE)+" 12:00"));//ищем бар по времени на сегодня
double pc=iClose(symb,PERIOD_M30,i);//цена закрытия на начало времени
double a=0;
if (pc!=0)
a=(iClose(symb,PERIOD_M30,0)*100)/pc-100;//расчет процента изменения от начала времени
return (a);
}
AndEv: Can I use MathPow() to increment an integer number ? How correct it will be ?
The easiest way is to run a check, and theory says: int is converted to double, which takes precedence. MathPow (double base, double exponent) passes variables of type double. Use "without loss of health" variables of int type instead of double type.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Something like that. Didn't check.
Thank you! It's working! Why am I so stupid? I think I did well in school(!)
One more question has come up. Problem with sum of values. type sum+=a[i] (read in tutorial)
Incorrectly returns sum of values, please point out the error.
I suspect that the problem is the lack of initialization of the variable sum with zero, and probably in a correct loop, like this, it should work:
After the loop, the variable sum will contain the sum of values of the function.
I suspect that the problem is the lack of initialization of the variable sum with zero, and probably in a proper loop, like this, it should work:
After the loop, the sum of the function's values will be in the sum variable.
Thanks, tried it, sum=0, no change.
The error is in the summing mechanism itself... I'll have to think about it.
Again a question about optimization and layout, how to pack such a miracle? I've used sum+=a[i], it's a mess.
Guys, can anyone know why my mother ASUS P5B under the Seven out of 4 gig RAM (2 on 2GB DDR3) sees only three?
It says 4 installed, 2.94 available...
Guys, can anyone know why my mother ASUS P5B under the Seven out of 4 gig RAM (2 on 2GB DDR3) sees only three?
It says 4 installed, 2.94 available...