Here is the example, the BarPeriod is set to 5 mins to test the workshop5 script and StartDate set to 20201101, EndDate commented out.

As you can see after starting the script in Trade mode at 2020-11-17 at 17:48 (not shown on the screenshot), the last run() at bar 747 (which ends at 2020-11-17 17:50) was also run on the incomplete last bar.

At 17:50, the run() function was run again and it printed the same bar which is now complete.

So is there a way to avoid running the run() function on incomplete bars?

Thanks!
I hope I am not missing something here, but it is strange that when the script is started in Trade mode, the run() functions runs twice on the last bar, when it's incomplete and when it's complete.

Attached Files Screenshot 2020-11-17 at 17.50.37.png