[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 94

 

You have exactly all the conditions met when y = 1. They are not mutually exclusive.

Mutually exclusive are for example: y<0, y==0, y>0.

 
Mathemat:

You have exactly all the conditions met when y = 1. They are not mutually exclusive.

Mutually exclusive are for example: y<0, y==0, y>0.

Ok, thanks all for your willingness to help me. Once again I will carefully read about combination if-else, not to litter posts here. About mutually exclusive, I guess it's like this: y<0, y==0, y>1.
 

paladin80:
Да, switch я использую. На счёт взаимоисключаемости условий, я это явление понимаю так:

//--- 1.
int x=1, y=1;
if (x==1)
{  if (y>0)  a=result_1;
   if (y<2)  a=result_2;
   if (y==1) a=result_3;
}
// a=result_3

//--- 2.
int x=1, y=1;
if (x==1)
{  if (y>0)            a=result_1;
   else if (y<2)       a=result_2;
        else if (y==1) a=result_3;
}
// a=result_1


Those highlighted in red will never be executed.

 
paladin80: About mutually exclusive, it's probably like this: y<0, y==0, y>1.
Well, there are such cases too. I gave an example with double.
 

Please help me, I don't understand what's wrong.

RSIi=iRSI(NULL,0,20,PRICE_OPEN,0);

if ( RSIi<52)

I add this condition, it reads in the optimizer, but when I run a test, the trade is not opened.

if ( RSIi>52)

but it works (-)

I want it to open deal if RSI is below 50

 
You need to look at what you have written under this condition next. There is probably an error there.
 
paladin80:
You need to look at what you have written next under this condition. There is probably an error there.

ugh, what a glitch=) I restarted the terminal and it all worked yyyy
 

In MQL5, you can select MA averaging method in external parameters using this: input ENUM_MA_METHOD ma_method=MODE_SMA. In this case, when testing the program, you can initially choose only between the averaging methods and nothing else will be written.

Question, is there such a record for MQL4?

 
Does the condition: if(a <- b) {}? (less_minus).
Found this accidental typo in my code, but the compiler didn't give any errors.
Thank you!
 
chief2000:
Does the condition if(a <- b) {} make sense? (less_minus)

if ((a) < (-b)) so I guess.

There will be no warning, much less an error.