Hi,

this is almost perfect, but it will output the debug info at each AFL execution 
while in the bar at midnight...

To avoid this you have to block subsequent executions.

if (TimeNum() == 000000)  // run while in the midnight bar
{
    MyBlockingVar == LastValue(DateNum));
    if (Nz(StaticVarGet("MyBlockingVar"), 0) != MyBlockingVar)
    {
        // Do your stuff here. It will run once a day at midnight
        StaticVarSet("MyBlockingVar", MyBlockingVar);
    }
}
 
Regards,

DotNetSDKforAB


--- In [email protected], "Neil Wrightson" <ne...@...> wrote:
>
> Hi,
>  
> How about 
> if (TimeNum() == 000000)
> {
>     // output debug
> }
> 
> Regards, 
> 
> Neil Wrightson. 
> 
>  
> 
>   _____  
> 
> From: [email protected] [mailto:[email protected]] On Behalf
> Of Potato Soup
> Sent: Sunday, 3 January 2010 3:20 PM
> To: [email protected]
> Subject: [amibroker] What's the easiest way to check for bar time?
> 
> 
>   
> 
> 
> I would like to output some debug text whenever a bar hits midnight. What's
> the easiest way of doing this? I see so many time functions in the help
> files that it's a bit overwhelming on where to start.
>


Reply via email to