cli

package
v0.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

Package cli provides the command-line interface for pvbt strategies.

Run is the main entry point for strategy binaries. It builds a Cobra command tree with backtest, live, snapshot, and describe subcommands, registers CLI flags from the strategy's exported struct fields, and handles execution:

func main() {
    cli.Run(&MyStrategy{})
}

Strategy parameters declared with pvbt, desc, and default struct tags are automatically registered as CLI flags. Universe fields accept comma-separated ticker lists. The --preset flag applies named parameter presets from the strategy's suggest tags.

Subcommands

The following subcommands are generated for every strategy:

  • backtest: run the strategy over a historical date range and write results to a SQLite database.
  • live: run the strategy in real time on its declared schedule.
  • snapshot: run a backtest and capture all data accesses into a SQLite file for deterministic offline testing.
  • describe: print strategy metadata, parameters, and presets in human-readable or JSON format.

RunPVBT is the entry point for the standalone pvbt tool, which adds commands for discovering, installing, and managing community strategies from GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(strategy engine.Strategy)

Run is the single entry point for strategy authors. It builds the cobra command tree, parses flags, and executes the appropriate subcommand.

func RunPVBT

func RunPVBT()

RunPVBT is the entry point for the standalone pvbt tool.

Types

This section is empty.

Directories

Path Synopsis
Package summary builds and renders backtest summary reports to a terminal.
Package summary builds and renders backtest summary reports to a terminal.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL