Variable assume a value through a period of time

 

Hello guys;

I have a variable equal a 0. However, through a period of time it will assume another values. When this period of time fisnish, I'd like the variable return a 0 value. 

The Opa2 variable will receive parametres from Opa variable. Soon, Opa2 will not worth value 0. I wanna that this variable Opa2 assume a 0 value when the day is done.

if(UseLimit==true)
     {
Opa2 = 0;
if ((Opa > 0 || Opa < 0)&& WorkingHour())
{
Opa2 += Opa;
if (Opa2 >= MaximumProfit || Opa2 <=MaximumLoss)
{
TradeNow = 0;
Print("Profit limit was reached");
Comment("Profit limit was reached");
if(OpenOrders(_Symbol) > 0)
{
CLOSEALL(0);CLOSEALL(1);

}
}
}
Print("Opa2 : ", DoubleToString(Opa2));
Reason: