* Add incremental SQLite history SDK for automated pipelines.
Extract sqlite history helpers into a dedicated module and expose update_history APIs that resume from existing MAX(time) values instead of re-fetching fixed date ranges.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix incremental history deals and stale rate view cleanup.
Fetch account events once during incremental updates, drop stale rate_* views when timeframes change, and avoid SQLite variable limits on wide frames.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix incremental deal filtering edge cases
Co-authored-by: Cursor <cursoragent@cursor.com>
* Address PR review feedback for incremental SQLite history.
Make rate views collision-free, batch incremental resume queries, scope deduplication to appended boundaries, validate before opening MT5, use atomic SQLite transactions, and expand docs/tests for the new helpers.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Document collect-history SQLite schema with ER diagram.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix account-event filtering and drop legacy rates resume.
Account events must follow only account_event_start, not per-symbol trade
cursors. Require normalized rates schema and fail fast when timeframe is missing.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Validate normalized rates schema before incremental resume.
Require symbol, timeframe, and time on existing rates tables with clear
ValueError messages, and add regression tests for malformed schemas.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
* Refactor cli.py into cli and utils modules
Extract constants, enums, Click parameter types, and parse/export utility
functions into a new mt5cli/utils.py module, keeping the typer app, commands,
and collect-history SQLite helpers in cli.py.
https://claude.ai/code/session_016JwSEhPyq6phXySktQ1FGU
* Address review comments
* Add programmatic SDK layer for read-only MT5 data collection.
Expose Mt5CliClient and collect_history through the package API while keeping CLI commands as thin adapters over the SDK.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden SDK connection lifecycle and scope internal helpers as private.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Export build_config in the public API and bump version to 0.4.0.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Remove duplicate scripts/ in favor of local-qa skill script.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* Add collect-history command for bulk SQLite export
Bundles rates, ticks, history-orders, and history-deals for one or more
symbols into a single SQLite database. Tick collection uses
copy_ticks_range_as_df with a --flags option defaulting to ALL. With
--with-views, optional cash_events and positions_reconstructed views are
derived from history_deals when the required columns are present.
* Extend collect-history with datasets, if-exists, timeframe, view fixes
- Fetch history-orders and history-deals per symbol so --symbol applies
consistently across all four datasets.
- Add repeatable --dataset (rates, ticks, history-orders, history-deals)
so ticks are no longer required and any subset can be collected.
- Add --if-exists append|replace|fail to control SQLite table conflict
behavior instead of hard-coding replace.
- Record the requested timeframe in a timeframe column on the rates
table so appended runs at different timeframes stay distinguishable.
- Fix positions_reconstructed to exclude positions with no closing
deals, use volume-weighted open/close prices, and report reversal
deals (DEAL_ENTRY_INOUT) via volume_reversal / reversal_count without
contributing to weighted prices.
- Update tests, README, docs, and skill to match.
* Address collect-history review feedback
* Stream collect-history writes per symbol
* Address PR cleanup for collect-history
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Add CLI commands for remaining pdmt5.dataframe methods
Add the following subcommands so the CLI fully covers pdmt5.dataframe's
public *_as_df methods:
- version
- last-error
- symbol-info-tick
- market-book
- order-check (request via inline JSON or @path/to/file.json)
- order-send (request via inline JSON or @path/to/file.json)
Also export a new parse_request helper for parsing JSON order requests,
add tests for every new command, and update the README and docs command
tables.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Bump version to 0.2.0
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* Address PR review feedback
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Harden CLI error assertions
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
* Add mt5cli agent skill
Document mt5cli CLI usage (global options, subcommands, parameter formats,
and examples) so agents can invoke the exporter without re-reading the CLI
source.
* Move mt5cli skill to top-level skills/ with symlink
Mirror the conventional layout: keep the canonical SKILL.md under
skills/mt5cli/ and expose it through a .agents/skills/mt5cli symlink.
* Harden mt5cli skill against leaking --password
Add a guideline warning against passing --password on the command line
(visible in ps/history/logs), and drop the credential-inline example that
modeled the bad pattern.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Add MkDocs and related dependencies (mkdocs-material, mkdocstrings,
pymdown-extensions) to dev dependencies. Update CI workflow to use
Material theme for documentation deployment.
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
* Separate manual release workflow from CI
* Refactor release workflow with granular job separation
Split release process into distinct jobs (build, github-release, publish-to-pypi)
for better separation of concerns and permission management. Remove workflow_dispatch
inputs from release workflow and update CI workflow to use read-only permissions for
calling the release workflow.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
* Use OIDC instead of the API token for PyPI
* Update .github/workflows/release.yml
* Rename .github/workflows/claude-code.yml to .github/workflows/claude.yml
* Fix permissions
* Refactor .github/workflows/claude.yml
---------
Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
- Add pyarrow dependency for parquet export support
- Add docstring to tests/__init__.py (ruff D104)
- Disable reportMissingTypeStubs for pdmt5 in pyright config
- Exclude __main__.py from coverage measurement
- Format markdown tables with prettier
- Add uv.lock
https://claude.ai/code/session_01YW3YHru8wRH9dvHnBX7xf1
- Add MkDocs documentation with API reference for the CLI module
- Add CI/CD and Claude Code review GitHub Actions workflows
- Add Dependabot and Renovate configuration for dependency updates
- Add .claude settings, agents, and local-qa skill with QA script
- Add AGENTS.md with repository guidelines and CLAUDE.md symlink
- Update README.md with installation, usage examples, and commands
https://claude.ai/code/session_01YW3YHru8wRH9dvHnBX7xf1
Create a standalone CLI package that uses pdmt5 as a dependency to export
MetaTrader 5 data to CSV, JSON, Parquet, and SQLite3 formats. Includes
12 subcommands for rates, ticks, account/terminal info, symbols, orders,
positions, and trading history, along with comprehensive test coverage.
https://claude.ai/code/session_01YW3YHru8wRH9dvHnBX7xf1