[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 532

 
Dimka-novitsek:

Here's an interesting one. The code I discussed earlier works if all the conditions are split, like this.

In this form, the line with that complex ife is left just so, the split ifes work. However, logically, I don't see any error in the complex ife!


Dmitry! It was already pointed out to you that the logic of the general if!

You do the following:

Print(5-3);
Print(6-4);
Print(7-5);

You print the result "2" all three times.

And then you combine into a pile:

Print(5-3-6-4-7-5);

And of course you get a different result.

 
Dimka-novitsek:

Here's an interesting one. The code I discussed earlier works if all the conditions are split, like this.

In this form, the line with that complex ife is left just so, the split ifes work. However, logically, I don't see an error in the compound ife!


Have you tried reading the documentation ? They say it helps ;) https://docs.mql4.com/ru/basis/operations/rules.

 
Yes. Thank you. The prints I've put in are kind of confusing. But most importantly, the variable takes the troue. I'm on my way to the documentation.
 
Dimka-novitsek:
Yes. Thank you. The prints I've put in are a little bit haphazard. But most importantly, the variable takes the troue. I'm on my way to the documentation.

Note - in MKL4 the priorities are slightly different from those accepted in C, read common. Therefore it is better to put brackets.
 

I have a dumb question. Can't do any trading in the account. The account is a real cent account.

I open a trade and see this picture:

Tech support says the account is active, everything is fine. I cannot open it because I just did not want to trade.

Can you tell me what may be the problem.

I would like to ask what may be the problem.

 
vaisya:

I have a dumb question. Can't do any trading in the account. It's a real cent account.

I open a trade and see a picture like this:

Tech support says the account is active, everything is fine. What can be in the terminal that when you just stupidly press sell - writes that the trade is not possible.

Please advise what may be the problem.

I would like to ask what may be the problem.

Cannot Login - you are not logged into your account...
 

Hi, help solve a problem!

The essence of the problem is not correctly divide the prices!

Here's an example: 1.2829 + 1.2814 / 2 = 1.9236 and should be 1.2821.

Here's the code SUM = High[i+1] + Low[i+1] / 2;

Can you tell me where the error is?

 
veti-k:

SUM = (High[i+1] + Low[i+1]) / 2;

 
DmitriyN:

SUM = (High[i+1] + Low[i+1]) / 2;


Thank you
 
drknn:

The trend line does not have an alert - it is an object. It has properties. You can make code that when the price touches the line, it will generate an alert, move the line and do all sorts of other things, but there is no line that has an alert in it.
Thanks for the reply, I understand that, but maybe there's a ready implementation somewhere.
Reason: