Expression has no effect

 

I am trying to set my bot not to trade on certain days like on weekends and Christmas day, my line not to trade on Christmas  and New Year is raising a warning of expression has no effect, how can I correct it?


bool allowed(){

    MqlDateTime stm;
    datetime tm=TimeCurrent(stm);

    bool open = true;
    if(stm.day_of_week == 6 || stm.day_of_week == 0) open = false;
    if(stm.day_of_week == 5 && stm.hour == 23 && stm.min > 50) open = false;
    if(stm.mon == 1 && stm.day == 1) open == false;
    if(stm.mon == 12 &&  stm.day == 25) open == false;
    
    return open;
}
 
Chrispine Oburu:

I am trying to set my bot not to trade on certain days like on weekends and Christmas day, my line not to trade on Christmas  and New Year is raising a warning of expression has no effect, how can I correct it?


    if(stm.mon == 1 && stm.day == 1) open == false;
    if(stm.mon == 12 &&  stm.day == 25) open == false;
 
Chrispine Oburu:I am trying to set my bot not to trade on certain days like on weekends and Christmas day, my line not to trade on Christmas  and New Year is raising a warning of expression has no effect, how can I correct it?

As I follow-up to Keith's post above, note the differences:

Operation

Desciption

==

!=

Equal

Not equal

=

*=

/=

%=

+=

-=

Assignment

Multiplication with assignment

Division with assignment

Module with assignment

Addition with assignment

Subtraction with assignment