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.0.tar.gz (13.2 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.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: macro_gridder-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 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.0.tar.gz
Algorithm Hash digest
SHA256 f2ed43b5da601fb20dd183bac0e02616018f9e1d33138ed54b87343f72f1faa1
MD5 8936e53b940a6cbea9d320f83dccf2dc
BLAKE2b-256 9721ae736e37e6ef6311ea7ad57c9581f90a32028b87261f8b525051ac29eb60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: macro_gridder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a239f0ea1ff1881dac44a61644f7772442d2d7c6fbfb8e9544a79a77b7dbeba1
MD5 5c9ada94458c1b0835dff372231ff2f1
BLAKE2b-256 95a20a731c53743dc2fff38692eb783c4277b63bedb845bb03d8f1e756ec3f82

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