Specifying non working days for Ea

 

Hello good day, have been trying to to code my Ea to wok on specific days of the month but i know am not doing some things right, did some research but below is what i arrive to and its not working fine it only works for the first date i specify

here is what i did, i create an extern string so i can input the date i don't want EA to trade this Dates are not fixed I could have use the TImeDate function

Developers please help me look into it to know what I'm doing wrong
Thanks

extern string Dates = "2,4,5"; /// dates i dont want EA to worrk
ushort u_sep;
string results [];


void OnTick()
  {

  


   Comment(val);

   int ks= StringSplit(Dates,u_sep,results);
   for(int i=0; i<ks; i++)
     {
      if(OrdersTotal()==0 && TimeDay(TimeCurrent())== ks)
         return;
     }
}
 
Any help plz
 
u_sep ist undefined.

What is TimeDay doing?

You are comparing {true|false} to an int (ks)
Why?
 
Dominik Egert #:
u_sep ist undefined.

What is TimeDay doing?

You are comparing {true|false} to an int (ks)
Why?
I'm trying to match up the  specified Dates with  TimeDate and if they return True Ea shouldn't  trade For that day
 

Compare the arrays values with the day value of the struct.

Or post all relevant code.
 
Dominik Egert #:

Compare the arrays values with the day value of the struct.

Or post all relevant code.
Okay will try that
I posted all code that's the lead have got so far
I know I'm missing something but i couldn't figure it out 
 
Adebayo Samson Adewuyi:

Hello good day, have been trying to to code my Ea to wok on specific days of the month but i know am not doing some things right, did some research but below is what i arrive to and its not working fine it only works for the first date i specify

here is what i did, i create an extern string so i can input the date i don't want EA to trade this Dates are not fixed I could have use the TImeDate function

Developers please help me look into it to know what I'm doing wrong
Thanks

fixed, I added some extra lines of code and made some corrections 
Working good now

Thanks