Skip to main content

A library for real-time macro grid calculation for stock daily and tick-level data

Project description

macro-gridder

A Python library for real-time macro grid calculation for stock daily and tick-level data.

中文文档 | English Documentation

Overview

macro-gridder is a specialized library designed to transform price data into grid-based representations, supporting both macro grids and micro units. It's particularly useful for technical analysis, algorithmic trading, and visualization of price movements in financial markets.

Features

  • Support for both daily and tick-level data
  • Real-time grid calculation for streaming data
  • Efficient data structures for high-frequency updates
  • Visualization tools for grid-based analysis
  • Compatible with various data sources

Installation

pip install macro-gridder

Quick Start

import pandas as pd
from macro_gridder import MacroGridder

# Load your price data
data = pd.read_csv('stock_data.csv')
prices = data['close']
times = data.index

# Configure the grid
config = {
    'horizontal_step': 10,  # Time dimension grid step
    'vertical_step': 20,    # Price dimension grid step
    'min_price_tick': 0.01  # Minimum price tick
}

# Create a grid
gridder = MacroGridder(config)
grid_df = gridder.create_grid(times, prices)

# Analyze grid data
print(grid_df.head())

Real-time Processing

from macro_gridder import RealtimeMacroGridder

# Initialize with historical data
gridder = RealtimeMacroGridder(config)
gridder.initialize_with_history(history_times, history_prices)

# Process new tick data
for time, price in new_data:
    h_idx, v_idx = gridder.update_with_tick(time, price)
    grid_info = gridder.get_current_macro_grid()
    # Use grid_info for trading decisions

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

macro_gridder-0.1.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

macro_gridder-0.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file macro_gridder-0.1.1.tar.gz.

File metadata

  • Download URL: macro_gridder-0.1.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for macro_gridder-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b93b113bcec6f24aecbfb0a76a6eefa3862f3e1453c1628a77be1b70f4ac110
MD5 94679cd970f1b8091e74d1d075f9194e
BLAKE2b-256 64e047a8da45df358cab52c6dd24d977e5fe0c0f2f1d2db787ffe06ebc6b1789

See more details on using hashes here.

File details

Details for the file macro_gridder-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: macro_gridder-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for macro_gridder-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c9d3093c256c19ca08d5f59c7d319c7e352cc46b9aea3c81ea274fd4eeccee46
MD5 4b1ca9fe949d25a5a2a2c16a94532894
BLAKE2b-256 d982c6e639b7c41e6cae48c5e0855d9d820d6cf37ee75b121ac6bfa8c8810fc2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page