polars-backtest

Backtest trading strategies with the polars-backtest Python library.

12|3|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/Yvictor/polars_backtest_extension --skill polars-backtest
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: polars-backtest
Source: https://github.com/Yvictor/polars_backtest_extension/tree/main/skills/polars-backtest
Command: npx skills add https://github.com/Yvictor/polars_backtest_extension --skill polars-backtest

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires polars, polars-backtest, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps users efficiently backtest trading strategies using the polars-backtest library, enabling rapid simulation and analysis of financial market performance.

Core Features & Use Cases

  • Fast Backtesting: Leverages Rust and Arrow for high-performance portfolio simulations.
  • Native Polars Integration: Seamlessly works with Polars DataFrames using a familiar API.
  • Comprehensive Analysis: Supports detailed reports including trades, statistics, and risk metrics.
  • Use Case: Analyze the historical performance of a momentum trading strategy by applying it to a large dataset of stock prices and evaluating its profitability and risk metrics.

Quick Start

Use the polars-backtest skill to backtest a trading strategy on the provided DataFrame, using 'close' for trade execution and 'weight' for position sizing.

Frequently Asked Questions about polars-backtest

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

FAQPage Schema
How do I backtest a trading strategy using Polars DataFrames?

To backtest a trading strategy using Polars DataFrames, apply the polars-backtest library with 'close' prices for trade execution and 'weight' for position sizing. It enables rapid portfolio simulation and performance analysis on financial time-series data.

What risk metrics and statistics are available from a portfolio simulation?

A portfolio simulation provides detailed reports including trades, statistics, and risk metrics. It evaluates historical profitability and risk by applying your strategy to financial time-series data for comprehensive performance analysis.

Do I need to install polars and polars-backtest to run portfolio simulations?

Yes, you need both polars and polars-backtest installed to run portfolio simulations. The Skill requires these dependencies for execution to facilitate backtesting and performance analysis on financial time-series data.

How does Polars compare to other tools for fast quantitative trading backtesting?

Polars leverages Rust and Arrow for high-performance portfolio simulations, distinguishing it from other tools. It provides native integration with Polars DataFrames using a familiar API for rapid backtesting of trading strategies.

Can I use this for backtesting a momentum trading strategy on large datasets?

Yes, you can backtest a momentum trading strategy on large datasets of stock prices. It evaluates profitability and risk metrics efficiently by leveraging Rust and Arrow for high-performance portfolio simulations.