How to schedule external data update using Windows Task Scheduler

Overview

If you use Portfolio Slicer regularly, Windows Task Scheduler can automate your external data update workflow.

This is most useful when you want your quote and currency files to stay reasonably current without running the scripts manually every time.

Please note that if you use Portfolio Slicer on a computer that is not always on, for example a laptop, you can still consider setting up automated external data updates. In that case, instead of selecting a specific time when the task should start, you could choose the Begin the task: option as At log on, At startup, or At unlock.

On a Windows 10 PC, follow these steps to schedule external data refresh.

Step-by-Step Setup

1. Open Task Scheduler

Click the Windows button and enter scheduler. This will show you all applications with scheduler in the name. Click Task Scheduler.

Open Task Scheduler

This will start the Task Scheduler application.

2. Create a Portfolio Slicer folder

In the Task Scheduler application, select the Task Scheduler Library folder. Then right-click it, choose New Folder, and enter the name PortfolioSlicer.

This will add the PortfolioSlicer folder to the scheduler library.

Create PortfolioSlicer folder

3. Create the main update task

Select the PortfolioSlicer folder, right-click it, and choose the menu item Create Task....

Create task

4. Configure the General tab

In the General tab, enter the name PS Daily Update. Choose Run whether user is logged on or not and check Run with highest privileges.

General tab settings

5. Configure the trigger

In the Triggers tab, choose New and select the Begin the task: option as On a schedule. Then choose a Weekly run, for example Tue-Sat in the early morning, such as 6:12 AM.

Click OK to close the New Trigger window.

Trigger settings

6. Configure the action

In the Actions tab, choose New and choose the action Start a program. Then select Browse and go to the folder where your UpdatePSData.bat file is located. Select that file.

For the field Start in (optional):, you must specify the location of this .bat file. This is important because it ensures that the .bat file is executed in the context of the selected folder.

Click OK to close the New Action window.

Action settings

7. Finish creating the task

Click OK to finish creating this task.

8. Optionally create an intraday task

Now repeat the same steps to create a new task called PS Intraday Update, but this time choose the trigger Weekly (Mon-Fri), starting at 9:55 AM, and repeat the task every 1 hour for a duration of 7 hours. This will cover stock market hours.

For the action this time, select the file UpdatePSDataIntraday.bat and do not forget to specify the Start in parameter value.

Intraday trigger settings

9. You are done

Your external data files will now be updated on your selected schedule.

Practical Advice

  • test the batch files manually first
  • make sure Start in points to the correct script folder
  • choose a schedule that matches when your computer is actually available
  • review task output and results after the first automated runs