I run same afl on 4 different systems, and I use trace function to display in log window whenever a signal is generated. There are two trace functions that get triggered on every signal, on 3 of my systems both the trace functions execute in same second but on one system there is a delay of more than 1 second for the second trace function. Is there some system setting or amibroker setting that might be causing the delay?
You can refer to the below code
SetChartOptions(0,chartShowArrows | chartShowDates);
_N( Title = (Name()+" - " +Interval(2)+" "+Date()+" Open " + open + ", High " + high + ",\n Low " + low + ", Close " + close ));
_N( Title = (Title + " {{VALUES}}"));
Plot( C, "Close", IIf( C < Ref( C, -1 ), colortan, colorseaGreen ), styleCandle | styleNoTitle );
Short = Cover = 0;
sflag = 0;
time = TimeNum()/100>=0918 AND TimeNum()/100<0919;
time1 = TimeNum()/100>=1529;
se = sx = 0;
stk = 0;
_N(optname1 = "");
_N(optname2 = "");
for(i=1;i<BarCount;i++)
{
if(time[i] AND !sflag)
{
stk = (floor(o[i]/100)*100);
optname1 = Name()+NumToStr(stk[i],0.0,False)+"C1";
optname2 = Name()+NumToStr(stk[i],0.0,False)+"P1";
se[i] = 1;
Short[i] = 1;
sflag = 1;
}
if(sflag AND time1[i])
{
Cover[i] = 1;
sx[i] = 1;
sflag = 0;
}
}
_N(csym = optname1);
_N(psym = optname2);
Checkdt11 = Nz( StaticVarGet( "lastdt11" ) );
dt11 = LastValue( DateTime() );
Checkdt12 = Nz( StaticVarGet( "lastdt12" ) );
dt12 = LastValue( DateTime() );
RTe = LastValue( se ) AND Checkdt11 != dt11;
if( RTe )
{
StaticVarSet( "lastdt11", dt11 );
//CE
StaticVarSet( "counter", Nz( StaticVarGet( "counter" ) ) + 1 );
_TRACE( "#" + Nz( StaticVarGet( "counter" ) ) + ",SE," + csym + "," + Date() );
//PE
StaticVarSet( "counter", Nz( StaticVarGet( "counter" ) ) + 1 );
_TRACE( "#" + Nz( StaticVarGet( "counter" ) ) + ",SE," + psym + "," + Date() );
}
RTex = LastValue( sx ) AND Checkdt12 != dt12;
if( RTex )
{
StaticVarSet( "lastdt12", dt12 );
//CE
StaticVarSet( "counter", Nz( StaticVarGet( "counter" ) ) + 1 );
_TRACE( "#" + Nz( StaticVarGet( "counter" ) ) + ",SX," + csym + "," + Date() );
//PE
StaticVarSet( "counter", Nz( StaticVarGet( "counter" ) ) + 1 );
_TRACE( "#" + Nz( StaticVarGet( "counter" ) ) + ",SX," + psym + "," + Date() );
}
Trace for put option gets delayed by 1-2 seconds on one system.
Thanks in advance.