Skip to main content

Routine Macro Recorder

Short video on recording commands to create routine

OpenBB script routines can be captured with the macro recorder, controlled with global commands, record to start saving commands and stop to terminate the recording. This shares similarities with that of Excel's VBA methods. This means that any command you run will be automatically recorded for the routine script and once you type stop it automatically saves the file to the ~/OpenBBUserData/routines/ folder.

For example, if you copy and paste the following prompt in the OpenBB Terminal and press enter, you will see an example.

/record/economy/cpi/treasury/index sp500/stop

The following shows the output from this pipeline of commands.

Routines

Because there was a record and stop at the start and end respectively, a routine script was created. This file cane be found inside the routines folder within the OpenBBUserData folder (more on exporting and import data here).

Now, you should be able to access the routine file from the terminal main menu by doing /exe --file and using the auto-completer. Note that the naming of the file will differ for you based on the time you are executing the script.

Routines