HAVING PROBLEM WITH GLOBAL VARIABLE TIMING

 

I WROTE A CODE LIKE THIS

deltime=time[0]+2*period()*60;

if(TimeCurrent()>=deltime)
{Experts=0;
GlobalVariableSet(Quantity3,Experts);}

in this code, if deltime is assigned thus nothing will happen if timecurrent

 
1981:

I WROTE A CODE LIKE THIS

deltime=time[0]+2*period()*60;

if(TimeCurrent()>=deltime)
{Experts=0;
GlobalVariableSet(Quantity3,Experts);}

in this code, if deltime is assigned thus nothing will happen if timecurrent

deltime will be ALWAYS bigger than current time.

deltime=time[0]+2*period()*60;

 
and Time[0] - is correct, not time[0].
 
ggekko wrote >>

deltime will be ALWAYS bigger than current time.

deltime=time[0]+2*period()*60;

So i should i re-code this code such that when the server time reaches my "deltime=Time[0]+2*period()*60;" a particular interation should be performed .Please help me out with this.

 
1981:

So i should i re-code this code such that when the server time reaches my "deltime=Time[0]+2*period()*60;" a particular interation should be performed .Please help me out with this.

I don't know what your goal is.

Maybe this:

// originally is_deltime is false

if(is_deltime!=true)
{
deltime=Time[0]+2*period()*60;
is_deltime=true;
}

if(TimeCurrent()>=deltime)
{
Experts=0;
GlobalVariableSet(Quantity3,Experts);
is_deltime=false;
}
 
ggekko wrote >>

I don't know what your goal is.

Maybe this:

thanks greatly,i works perfectly well.I appreciate your concern.