Backtester

v1.0.0
io.github.morshedgit/backtester Checked 4 days ago Published 27 days ago

Test a plain-words trading rule on historical prices and compare the trades with SPY.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_data List available data

List available price data, fields, dates, limits, and whether reports can be retained for publishing.

get_prices Get historical prices

Read historical prices for a run form. Needs only version and data.

ParameterTypeDescription
run *

build_series Build data series

Build named time series from a run form. Needs version, data, and series.

ParameterTypeDescription
run *

build_signal Build trading signals

Build named trading signals from a run form. Needs version, data, series, and signals.

ParameterTypeDescription
run *

simulate Simulate past trades

Simulate historical fills and account balances. Needs the full run form.

ParameterTypeDescription
run *

report Run a backtest report

Run a backtest and show its results. Supply strategyExplanation in plain terms for the widget. In your reply, explain the rule, always show Return vs. SPY (summary.returnVsSpyPct in percentage points, or Unavailable), and give one takeaway or limit supported by the report. Choose any additional cards using stats. Use scoreSeries for a separate score panel. Use chartSeries to select named report series and set their legend labels, line or bar types, colors, and line patterns. Keep the interpretation about this historical test. To publish this exact result later, pass its reportId to save_strate…

ParameterTypeDescription
run *
chartSeries
scoreSeriesstringNamed report series to draw in the separate score panel.
stats
strategyExplanation

share_report Share a report publicly

PUBLIC: the report is listed in the public strategy library, and anyone can see it. Make a report public so it can be shared, and return its page URL. Needs only the reportId returned by report. The page text comes from the report itself. Sharing the same report again returns the same URL. The report widget calls this when the visitor presses its share icon.

list_strategies List saved strategies

List published website strategies, their URLs, and their current keys. Use a current key as expectedKey only when the user asks to replace that saved strategy.

save_strategy Publish a report to the public website

PUBLIC: anyone can see the saved page. Publish a completed report to the public website after the user asks to save it. Use the reportId returned by report, a public slug, and client-authored page and presentation choices. Never submit or invent result numbers. Adds it to the strategy directory without rerunning the strategy. Existing slugs require expectedKey to replace a different result. setAsHome changes the home page only when explicitly requested.