I have noticed what you advised. So i was indeed planning to run an initial scan programatically before market open. However I am not sure if that would help delays like 15 minutes-30 minutes. I have included more logging inside the AFLs now so that I can pin point exactly what is going on. The last time I noticed the issue was on 15/06 when one of the AFL working on XIV/VXX filter gave signals at 16:15.03 CET for a bar that closed 15:45. CET (chart interval was set to 15 minutes and scan done every 15 minutes with a delay of 3 seconds after system time). I have included the below into the AFLs so that I get a log. If you have suggestion to log something more, please advise. I will hopefully come back with more details when problem shows up again. On that day, logs were created, but I deleted them accidentally after analysing them. What I could infer is that GetRTData(“UpdateTime”) ) showed timestamps correctly - not sure if that means data for all symbols also arrived correctly - But timenum() was still showing values from yesterday’s market close time i.e. it looked like new bars were not created for 15:44:59 and for 15:59:59 until sometime after 16:00:03 CET. Signal got generated at 16:15.03 for the bar ending at 15:44:59.
fh = fopen( "C:\\daytradeagressive2.csv", "a");
if( fh )
{
fputs( Name(), fh );
fputs( " currentsystemtime ", fh );
fputs( " lastvaluetimenum ", fh );
fputs( " statuslastbarend ", fh );
fputs( " statuslastbarvalue ", fh );
fputs( " statusprevbarvalue ", fh );
fputs( " statuslastrtupdate ", fh );
fputs( "GetRTDataupdatetime ", fh );
fputs( "GetRTDataupdatevalu \n", fh );
fputs( Now(2), fh );
fputs( " ", fh );
qs = StrFormat(" %.0f",
LastValue(TimeNum()) );
fputs( qs, fh );//timenum
fputs( " ", fh );
qs = StrFormat(" %.0f",
Status("lastbarend") );
fputs( DateTimeToStr(Status("lastbarend")), fh );//statuslastbarend
fputs( " ", fh );
qs = StrFormat(" %.4f",
LastValue(C) );
fputs( qs, fh );//timenum
fputs( " ", fh );
qs = StrFormat(" %.4f",
LastValue(Ref(C,-1)) );
fputs( qs, fh );//timenum
fputs( " ", fh );
qs = StrFormat(" %.0f",
Status("lastrtupdate") );
fputs( DateTimeToStr(Status("lastrtupdate")), fh );//lastrtupdate
fputs( " ", fh );
qs = StrFormat(" %.0f",
GetRTData("UpdateTime") );
fputs( qs, fh ); //GetRTData
fputs( " ", fh );
qs = StrFormat(" %.4f\n",
GetRTData("Last") ); // RT data lastprice
fputs( qs, fh ); //GetRTData
fclose( fh );
}
You did not explicitly answer my question about pre-requisite for scans. But I assume amibroker dont have to do anything like opening charts ( although I do have all the symbols in realtimequote open ) etc before doing a scan, correct?
Moderator comment: when posting code use [code]....[/code]
tags or use three backticks at the beginning of the code and three backticks at the end.