looking for a line of code

 
I'm trying to write an EA that places an order at Noon everyday and has a specific expiration which is midnight local time everyday. Local time is 6 hours after GMT. Is there a way to have the EA update the expiration automatically?
 

Why not have the EA delete the order

if(TimeHour(TimeLocal())== 0) OrderDelete(...);

Pending order expiration time can be disabled in some trade servers. In this case, when a non-zero value is specified in the expiration parameter, the error 147 (ERR_TRADE_EXPIRATION_DENIED) will be generated.

 
yeah that was the solution i was thinking of myself i saw a post earlier today where someone counted the bars and thats what i was thinking about using. I didn't know if it was possible to even update the expiration daily. Nor did I know that some brokers would disable your expiration. thanks for the advice.
Reason: