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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file macro_gridder-0.1.3.tar.gz.
File metadata
- Download URL: macro_gridder-0.1.3.tar.gz
- Upload date:
- Size: 13.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
82c70d8cdee75fa3a10c0d01c229c1656237484dd6816875712ad1dbd73fa505
|
|
| MD5 |
4be7cfe8f99563c344599208778e1a69
|
|
| BLAKE2b-256 |
9f6cd7396dab4e63063806bb0ebfc2a881775ec2613e7abb745e51c3068ce525
|
File details
Details for the file macro_gridder-0.1.3-py3-none-any.whl.
File metadata
- Download URL: macro_gridder-0.1.3-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77ec2c883613b9e13ec096934ffaf892389a2dfcd4094946b931825fd133b556
|
|
| MD5 |
120cbd38fd8c46206df34da77d95a330
|
|
| BLAKE2b-256 |
ef222289434ac65af0c20a8dc139f3a8d4e26e6349d63e58c3843b82f7057507
|