Mike, the code will be executed from top at each close of a bar. For example, if you receive new bars each one minute (this depends on your Chart setting of the instrument), then each one minute the code executes.
In the example below, this is each 5 minutes.