stock-backtest

Export stock K-line data from PostgreSQL to CSV/JSON and run pattern backtesting.

Updated Apr 27, 2026
One-click install
npx skills add https://github.com/Bearflower/stockfiter --skill stock-backtest-bearflower
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: stock-backtest
Source: https://github.com/Bearflower/stockfiter/tree/main/stockfilter/.trae/skills/stock-backtest
Command: npx skills add https://github.com/Bearflower/stockfiter --skill stock-backtest-bearflower

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill exports stock K-line data from a PostgreSQL server to local CSV/JSON and runs pattern backtesting, helping you validate strategies against real data without manual data gathering.

Core Features & Use Cases

  • SSH-based remote data export from a Dockerized PostgreSQL environment.
  • Base64-encoded command execution to safely transfer code for on-server execution.
  • Local storage of data under data/backtest as CSV/JSON for reproducible backtests.
  • Pattern backtesting with a configurable detection strategy and reporting.
  • Batch-style use across multiple stocks for comparative backtesting results.

Quick Start

Run the export_from_server_base64.py to fetch data, then run the local backtest script and finally generate a Markdown report.

Frequently Asked Questions about stock-backtest

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I backtest stock patterns using historical data from a PostgreSQL server?▼

To backtest stock patterns, you can export K-line data from a PostgreSQL server to local CSV or JSON files. This allows you to run pattern backtesting and validate your trading strategies against real historical data.

Do I need SSH access to export stock data for local backtesting?▼

Yes, you need SSH access to export stock data for local backtesting. The process requires SSH-based remote export from a Dockerized PostgreSQL environment to securely retrieve and store your historical K-line data locally.

What is the best way to run batch backtests across multiple stocks?▼

The best way to run batch backtests across multiple stocks is to export the required data locally and use a configurable detection strategy. This skill supports batch-style processing to generate comparative backtesting reports.

Can I use PostgreSQL K-line data to generate backtest reports locally?▼

Yes, you can use PostgreSQL K-line data to generate backtest reports locally. After exporting the data via base64-encoded commands, the skill performs local backtesting and outputs a Markdown report for your analysis.

How does SSH remote export work for executing PostgreSQL queries in a Docker container?▼

SSH remote export works by securely transferring base64-encoded commands to a Docker container containing PostgreSQL. This mechanism safely executes queries on the server to extract K-line data without manual data gathering.

Are there limitations when storing exported stock data under a local backtest directory?▼

A limitation is that all exported stock data must be stored locally under the data/backtest directory as CSV or JSON. This ensures reproducible backtests but requires adequate local storage capacity for large historical datasets.