Need help with a custom argument for loop

I need help with making a loop which runs between a specific period of time( e.g: between 10:00 am to 16:00 pm ) .
2nd problem...
In c++ there is sleep ,pause to delay the loop for a specified period, what are the alternative in afl to sleep the loop for 30 seconds, since it will smother my cpu resource if i run this loop for 6 hours nonstop

Sleep is good solution for short periods (like milliseconds).

Since you are after 30 seconds, instead of "sleep" consider periodic execution. You can have your chart automatically executed in specified intervals using RequestTimedRefresh()

If you need to keep variable values between executions use StaticVarSet/StaticVarGet

1 Like