Skip to main content

Routine Macro Recorder

OpenBB script routines can be captured with the macro recorder, controlled with global commands. Enter, record, to start saving commands, and then, stop, terminates the recording. This means that any command you run will be captured in the script; and on stop, it will be saved to the ~/OpenBBUserData/routines/ folder.

For example:

record -n sample

/equity/price/historical --symbol SPY --provider cboe --interval 1m/home/derivatives/options/chains --symbol SPY --provider cboe/home/stop/r

The final command after stop, r, resets the CLI so that the routine is presented as a choice in the exe command.

It can now be played back by entering:

/exe --file sample.openbb
tip

The routine can be edited to replace parameter values with input variables - e.g, $ARGV[0], $ARGV[1], etc.