Skip to content

A collection of helpful polars plugins and functions for market data processing.

Notifications You must be signed in to change notification settings

ngriffiths13/polars-trading

Repository files navigation

Polars Trading

CodSpeed Badge codecov

Overview

The polars-trading package is meant to provide some nice utilities for working with market data in Polars DataFrames. Much of the original inspiration has come from Marcos Lopez de Prado's book Advances in Financial Machine Learning. It is a work in progress with some basic functionality that will be added to over time.

Installation

uv add polars-trading

Basic Usage

Creating Bars from Ticks

import polars as pl
import polars_trading as plt

plt.Config.set(
    price_column="price",
    size_column="size",
    symbol_column="ticker",
    timestamp_column="ts_event"
)

# 15 minute time bars
plt.bars.time_bars(df, bar_size="15m")

# Bars w/ 100 ticks
plt.bars.tick_bars(df, bar_size=100)

About

A collection of helpful polars plugins and functions for market data processing.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages