problematic line of MQL4 code

 

can anyone find a problem with the following code?

four = (four*2) + 30;

Is this bad coding? Because it is not doing what i want it to do.

// ------------------------------------------

MORE DETAIL: - See the code below.

// so every time "q" goes up in value by one, then the value of "four" should be changed accordingly. BUT I actually see the value of "four" skyrocketing off to large numbers despite its assignment loop only being called ONCE . So I wonder if its assignment line is perhaps invalid for use in MLQ4.

crin = q - telly;

for (int c=1; c<=crin; c++)
{
four = (four*2) + 30;

}

if (q > telly) {telly = q;}

// ------------------

 

Please use this to post code . . . it makes it easier to read.

 
mikey:

can anyone find a problem with the following code?

What do you want it to do ? you haven't actually told us . . .

If crin = 5 . . . and four starts at 1

c=1 four = (1 * 2) + 30 = 32

c=2 four = (32 * 2) + 30 = 94

c=3 four = (94 * 2) + 30 = 218

c=4 four = (218 * 2) + 30 = 466

c=5 four = (466 * 2) + 30 = 962