EA - Start and finish time

 

Hello, I'm trying to write an Expert Advisor that start at 9:00 am and close all order at 10:00 pm 

this is my text :

input int start_hour=9;
      datetime data = TimeCurrent();
      int h = TimeHour(TimeCurrent());

void OnTick()
{
bool EA_start = false;
   if (start_hour>=h && conta==0)EA_start = true;
   
   if (EA_start == true)
    { ........ }
..
..
}

It works ? 

Sorry for my english :)