Metadata-Version: 2.4
Name: ghosalquant
Version: 0.1.0
Summary: Event-driven quantitative trading research framework
Author: Ghosal Quants
License-Expression: MIT
Project-URL: Homepage, https://github.com/Ghosal-Quants/GhosalQuant
Project-URL: Documentation, https://github.com/Ghosal-Quants/GhosalQuant/blob/main/design/user_guide.md
Project-URL: Repository, https://github.com/Ghosal-Quants/GhosalQuant
Project-URL: Issues, https://github.com/Ghosal-Quants/GhosalQuant/issues
Keywords: quant,trading,backtesting,algorithmic-trading,finance
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pytz
Requires-Dist: requests
Requires-Dist: yfinance
Requires-Dist: PyYAML
Requires-Dist: python-dotenv
Requires-Dist: pyarrow
Requires-Dist: fastparquet
Requires-Dist: ib_insync
Requires-Dist: websockets
Provides-Extra: alpaca
Requires-Dist: alpaca-py; extra == "alpaca"
Provides-Extra: plotting
Requires-Dist: matplotlib; extra == "plotting"
Requires-Dist: plotly; extra == "plotting"
Provides-Extra: ui
Requires-Dist: customtkinter; extra == "ui"
Requires-Dist: matplotlib; extra == "ui"
Dynamic: license-file

# GhosalQuant
Ghosal Fund | Quantitative Trading Team Repository

A modular Python framework for developing, backtesting, and executing quantitative trading strategies.

## Documentation
- [System Overview](https://github.com/Ghosal-Quants/GhosalQuant/blob/main/design/system-overview.md) - architecture + data flow
- [User Guide](https://github.com/Ghosal-Quants/GhosalQuant/blob/main/design/user_guide.md) - getting started + quick reference

## Installation
```bash
pip install ghosalquant
```
Optional extras: `ghosalquant[alpaca]` (Alpaca market data), `ghosalquant[plotting]` (matplotlib and plotly charts),
`ghosalquant[ui]` (the prototype backtest GUI, launched with `ghosalquant-ui`).

To work on the framework itself, install from source in editable mode:
```bash
git clone https://github.com/Ghosal-Quants/GhosalQuant.git
cd GhosalQuant
pip install -e .
```

## Quick Start
1. **Write a strategy** — subclass `Strategy`, implement `on_market_data(bar) -> Signal | None`
2. **Create a config** — see `examples/config.yaml`
3. **Run a backtest**:
```python
from ghosalquant.backtester.backtester_base import Backtester
from my_strategy import MyStrategy

kpms = Backtester.from_config(strategy=MyStrategy(), config_path="config.yaml").run()
print(kpms)
```

See `examples/` for more examples for: DataFrame backtesting, strategy comparison, IBKR paper trading, and live data.

## Project Structure
```
src/ghosalquant/
  core/           # Bar, Signal, Order, Fill, Trade types
  execution/      # Strategy base, ExecutionSystem, signal sinks, benchmarks
  data_layer/     # DataSource implementations (yfinance, Polygon, DataFrame, list)
  backtester/     # Backtester, DataFrameBacktester
  risk/           # RiskManager, rules (MaxOpenPositions, ConfidenceSizer)
  portfolio/      # Portfolio protocol, BasicPortfolio
  brokerage/      # Broker base, SimBroker, IBKRBroker
  util/           # Config, visualisation, helpers
  backtest_ui/    # Prototype GUI (the [ui] extra)
examples/         # Ready-to-run scripts and sample config
```

## Tom's Notes

### What are we actually trying to do?
- Find ideas for interesting strategies for a given asset class
- Implement the mathematical theory algorithmically
- Provide quantitative evidence that they work, over a period of time
- Execute the orders

### Some existing open source frameworks
- https://amor71.github.io/LiuAlgoTrader/
- https://www.backtrader.com/
- https://github.com/gbeced/basana (crypto orientated)
- https://github.com/panpanpandas/ultrafinance
- https://github.com/ematvey/pybacktest
- https://github.com/mhallsmoore/qstrader
