Commit Graph

27 Commits

Author SHA1 Message Date
Daichi Narushima c4232bf44d Add incremental SQLite history SDK (#16)
* 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>
v0.4.1
2026-06-09 01:28:22 +09:00
Daichi Narushima 5b44318d55 Add programmatic SDK and refactor mt5cli into cli, sdk, and utils (#15)
* 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>
v0.4.0
2026-06-08 22:54:53 +09:00
dceoy 7f70073301 Update pyproject.toml 2026-06-07 23:47:32 +09:00
Daichi Narushima da74c11087 Add collect-history command for bulk data collection (#14)
* 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>
v0.3.0
2026-05-29 01:22:59 +09:00
Daichi Narushima c45efb953c Update local QA skill workflow (#13) 2026-05-25 02:12:28 +09:00
dceoy c1eea3fa3d Update .github/workflows/ci.yml 2026-05-25 01:48:43 +09:00
github-actions[bot] 62e5f438f0 Merge pull request #12 from dceoy/dependabot/uv/uv-d665ee01e3
Bump idna from 3.13 to 3.15 in the uv group across 1 directory
2026-05-19 21:12:38 +00:00
dependabot[bot] 50f62bca73 Bump idna from 3.13 to 3.15 in the uv group across 1 directory
Bumps the uv group with 1 update in the / directory: [idna](https://github.com/kjd/idna).


Updates `idna` from 3.13 to 3.15
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](https://github.com/kjd/idna/compare/v3.13...v3.15)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.15'
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-19 21:11:32 +00:00
github-actions[bot] 0b7dfdc621 Merge pull request #11 from dceoy/dependabot/uv/uv-ab67d3f053
Bump pymdown-extensions from 10.21.2 to 10.21.3 in the uv group across 1 directory
2026-05-19 20:48:47 +00:00
dependabot[bot] bab776e700 Bump pymdown-extensions in the uv group across 1 directory
Bumps the uv group with 1 update in the / directory: [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions).


Updates `pymdown-extensions` from 10.21.2 to 10.21.3
- [Release notes](https://github.com/facelessuser/pymdown-extensions/releases)
- [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.21.2...10.21.3)

---
updated-dependencies:
- dependency-name: pymdown-extensions
  dependency-version: 10.21.3
  dependency-type: direct:development
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-19 20:47:23 +00:00
github-actions[bot] 9bf9a6a72c Merge pull request #10 from dceoy/dependabot/uv/uv-c30c77f42d
Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory
2026-05-11 18:22:00 +00:00
dependabot[bot] d7594ddc43 Bump urllib3 from 2.6.3 to 2.7.0 in the uv group across 1 directory
Bumps the uv group with 1 update in the / directory: [urllib3](https://github.com/urllib3/urllib3).


Updates `urllib3` from 2.6.3 to 2.7.0
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](https://github.com/urllib3/urllib3/compare/2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-11 18:20:57 +00:00
Daichi Narushima b8ce76c9d6 Add CLI commands for remaining pdmt5.dataframe methods (#9)
* 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>
v0.2.0
2026-04-26 21:50:19 +09:00
dceoy 5750625e14 Remove python-package-release job 2026-04-26 06:21:18 +09:00
Daichi Narushima 2cf4d1cf6b Update GitHub workflows to use new reusable workflow parameters (#8) 2026-04-23 06:01:54 +09:00
Daichi Narushima 42d8a9beb6 Add mt5cli skill documentation for MetaTrader 5 data export (#7)
* 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>
v0.1.0
2026-04-23 03:02:43 +09:00
Daichi Narushima 45ea0b459b Set up documentation with MkDocs and Material theme (#6)
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>
2026-04-23 02:11:04 +09:00
github-actions[bot] b6402168b1 Merge pull request #4 from dceoy/dependabot/uv/uv-590e9db7b9
Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory
2026-04-14 02:41:31 +00:00
dependabot[bot] df81d81cec Bump pytest from 9.0.2 to 9.0.3 in the uv group across 1 directory
Bumps the uv group with 1 update in the / directory: [pytest](https://github.com/pytest-dev/pytest).


Updates `pytest` from 9.0.2 to 9.0.3
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/9.0.2...9.0.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:development
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-14 02:40:13 +00:00
github-actions[bot] c71ba32f5d Merge pull request #3 from dceoy/dependabot/github_actions/pypa/gh-action-pypi-publish-1.14.0
Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0
2026-04-07 22:37:31 +00:00
dependabot[bot] 51065fae3d Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e...cef221092ed1bacb1cc03d23a2d87d1d172e277b)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-version: 1.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-07 22:36:32 +00:00
Daichi Narushima 0d13746918 Separate manual release workflow from CI (#2)
* 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>
2026-04-07 03:22:01 +09:00
Daichi Narushima 1e0e084097 Merge pull request #1 from dceoy/claude/create-pdmt5-cli-package-HUlVp
Add mt5cli package with CLI for MetaTrader 5 data export
2026-03-29 02:01:03 +09:00
Claude 5e2b71977d Fix QA issues: add pyarrow dep, docstring, type stubs, and coverage config
- 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
2026-03-28 14:59:17 +00:00
Claude 0f15b28ea3 Add docs, CI workflows, agent config, and supporting files
- 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
2026-03-28 14:00:48 +00:00
Claude 527f9213da Add mt5cli package with CLI for MetaTrader 5 data export
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
2026-03-28 12:17:16 +00:00
Daichi Narushima b4f2d4ca32 Initial commit 2026-03-28 21:09:14 +09:00