mt5cli 0.8.0__tar.gz → 0.8.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mt5cli-0.8.0 → mt5cli-0.8.2}/PKG-INFO +7 -5
- {mt5cli-0.8.0 → mt5cli-0.8.2}/README.md +6 -4
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/index.md +9 -1
- mt5cli-0.8.2/docs/api/public-contract.md +184 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/sdk.md +22 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/trading.md +59 -12
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mkdocs.yml +1 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/__init__.py +19 -1
- mt5cli-0.8.2/mt5cli/contract.py +101 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/sdk.py +23 -5
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/trading.py +210 -27
- {mt5cli-0.8.0 → mt5cli-0.8.2}/pyproject.toml +1 -1
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_contracts.py +183 -1
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_sdk.py +151 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_trading.py +664 -4
- {mt5cli-0.8.0 → mt5cli-0.8.2}/uv.lock +1 -1
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.agents/skills/local-qa/SKILL.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.agents/skills/local-qa/scripts/qa.sh +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.agents/skills/mt5cli/SKILL.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.agents/skills/pr-feedback-triage/SKILL.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.claude/agents/codex.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.claude/settings.json +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/FUNDING.yml +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/dependabot.yml +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/renovate.json +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/workflows/ci.yml +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/workflows/claude.yml +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.github/workflows/release.yml +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/.gitignore +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/AGENTS.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/CLAUDE.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/LICENSE +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/cli.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/client.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/converters.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/exceptions.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/history.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/schemas.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/storage.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/api/utils.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/docs/index.md +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/__main__.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/cli.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/client.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/converters.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/exceptions.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/history.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/retry.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/schemas.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/storage.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/mt5cli/utils.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/__init__.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/conftest.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_cli.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_history.py +0 -0
- {mt5cli-0.8.0 → mt5cli-0.8.2}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mt5cli
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.2
|
|
4
4
|
Summary: Generic MT5 data and execution infrastructure for Python applications
|
|
5
5
|
Project-URL: Repository, https://github.com/dceoy/mt5cli.git
|
|
6
6
|
Author-email: dceoy <dceoy@users.noreply.github.com>
|
|
@@ -28,6 +28,8 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
|
|
29
29
|
Generic MT5 data and execution infrastructure for Python applications. Export from the CLI or import a small, stable Python API in downstream packages.
|
|
30
30
|
|
|
31
|
+
The [Public API Contract](docs/api/public-contract.md) lists stable SDK exports (`mt5cli.STABLE_SDK_EXPORTS`), CLI commands, internal helpers, and responsibilities that remain out of scope (strategy logic, backtests, optimization).
|
|
32
|
+
|
|
31
33
|
Built on top of [pdmt5](https://github.com/dceoy/pdmt5), a pandas-based data handler for MetaTrader 5.
|
|
32
34
|
|
|
33
35
|
## Architecture
|
|
@@ -251,7 +253,7 @@ update_history_with_config(
|
|
|
251
253
|
- **`collect-history`**: explicit date-range export into SQLite.
|
|
252
254
|
- **`update_history`**: incremental append based on existing SQLite `MAX(time)` per symbol (and timeframe for rates); account-level deals use a separate cursor when `include_account_events=True`.
|
|
253
255
|
- **`rates` table**: normalized storage with `symbol` and `timeframe` columns.
|
|
254
|
-
- **Rate compatibility views**: mt5cli manages all `rate_*` views. Naming is `rate_<symbol>__<timeframe>` when a symbol has one timeframe, otherwise `rate_<symbol>__<granularity>_<timeframe>` (for example `rate_EURUSD__M1_1`). Stale `rate_*` views are dropped and recreated when rates change for offline tools
|
|
256
|
+
- **Rate compatibility views**: mt5cli manages all `rate_*` views. Naming is `rate_<symbol>__<timeframe>` when a symbol has one timeframe, otherwise `rate_<symbol>__<granularity>_<timeframe>` (for example `rate_EURUSD__M1_1`). Stale `rate_*` views are dropped and recreated when rates change for offline downstream tools.
|
|
255
257
|
- **Rate view resolution**: use `resolve_rate_view_name()` / `resolve_rate_view_names()` to map symbols and granularities to existing SQLite compatibility views without creating databases. Both accept `None` (or a missing path) and return deterministic default names unless `require_existing=True`.
|
|
256
258
|
- **Rate view loading**: use `load_rate_data()` / `load_rate_data_from_connection()` to load a SQLite rate table or view into a `DatetimeIndex` DataFrame.
|
|
257
259
|
- **Multi-series rate loading**: use `build_rate_targets()` to build neutral `RateTarget(symbol, timeframe)` pairs, `resolve_rate_tables()` to map them to table/view names (pass `require_existing=True` for strict resolution), and `load_rate_series_from_sqlite()` to load them into a mapping keyed by `(symbol, integer timeframe)`. The loader requires existing managed views unless `explicit_tables` is supplied, and rejects duplicate `(symbol, timeframe)` targets.
|
|
@@ -271,7 +273,7 @@ eurusd_m1 = rates["EURUSD", "M1"] # closed bars only
|
|
|
271
273
|
```
|
|
272
274
|
|
|
273
275
|
- **Credential resolution**: use `resolve_account_spec()` / `resolve_account_specs()` to merge explicit override values over `AccountSpec` fields and expand `${ENV_VAR}` placeholders (via `substitute_env_placeholders()`), raising `ValueError` for missing variables. This keeps secrets out of plan/config files without coupling to any strategy code.
|
|
274
|
-
- **Throttled history updates**: use `ThrottledHistoryUpdater` to wrap `update_history()` with a minimum `interval_seconds` between successful runs (monotonic clock). Call `should_update()` / `update(client, symbols)` from an application loop; errors propagate by default, or pass `suppress_errors=True` to swallow recoverable `Mt5*Error`, `sqlite3.Error`, `ValueError`, `OSError`, and MT5 client capability errors for history API methods without advancing the throttle (other `AttributeError` / `TypeError` values always propagate).
|
|
276
|
+
- **Throttled history updates**: use `ThrottledHistoryUpdater` to wrap `update_history()` with a minimum `interval_seconds` between successful runs (monotonic clock). Call `should_update()` / `update(client, symbols)` from an application loop; errors propagate by default, or pass `suppress_errors=True` to swallow recoverable `Mt5*Error`, `sqlite3.Error`, `ValueError`, `OSError`, and MT5 client capability errors for history API methods without advancing the throttle (other `AttributeError` / `TypeError` values always propagate). Pass `update_backend` to inject a custom history update callable (same keyword arguments as `update_history`) instead of monkey-patching `mt5cli.sdk.update_history`.
|
|
275
277
|
- **Trading session helpers**: use `mt5_trading_session()` for a trading-capable `pdmt5.Mt5TradingClient` that initializes/logs in via `Mt5Config.path` and always shuts down safely. Pair with `detect_position_side()`, `calculate_margin_and_volume()`, and `determine_order_limits()` for generic position and sizing utilities. The read-only `mt5_session()` / `Mt5CliClient` SDK is unchanged.
|
|
276
278
|
- **Granularity-keyed rate loading**: `load_rate_series_by_granularity()` builds targets with `build_rate_targets()`, loads them with `load_rate_series_from_sqlite()`, and returns a mapping keyed by `(symbol | None, granularity_name)` such as `("EURUSD", "M1")` to reduce downstream boilerplate.
|
|
277
279
|
- **MT5 session helper**: use the `mt5_session()` context manager to attach to (or, when `Mt5Config.path` is set, launch) an MT5 terminal, log in, and yield a connected `MT5Client` that shuts down on exit.
|
|
@@ -284,12 +286,12 @@ eurusd_m1 = rates["EURUSD", "M1"] # closed bars only
|
|
|
284
286
|
- Windows OS (MetaTrader 5 requirement)
|
|
285
287
|
- MetaTrader 5 platform installed
|
|
286
288
|
|
|
287
|
-
### Migration note for
|
|
289
|
+
### Migration note for downstream trading apps
|
|
288
290
|
|
|
289
291
|
Replace local MT5 lifecycle and trading helper code with mt5cli imports:
|
|
290
292
|
|
|
291
293
|
```python
|
|
292
|
-
# Before (local
|
|
294
|
+
# Before (local application helpers)
|
|
293
295
|
# with local_mt5_trading_session(config) as client:
|
|
294
296
|
# side = local_detect_position_side(client, symbol)
|
|
295
297
|
# sizing = local_calculate_margin_and_volume(client, symbol, unit_ratio, preserved_ratio)
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
Generic MT5 data and execution infrastructure for Python applications. Export from the CLI or import a small, stable Python API in downstream packages.
|
|
6
6
|
|
|
7
|
+
The [Public API Contract](docs/api/public-contract.md) lists stable SDK exports (`mt5cli.STABLE_SDK_EXPORTS`), CLI commands, internal helpers, and responsibilities that remain out of scope (strategy logic, backtests, optimization).
|
|
8
|
+
|
|
7
9
|
Built on top of [pdmt5](https://github.com/dceoy/pdmt5), a pandas-based data handler for MetaTrader 5.
|
|
8
10
|
|
|
9
11
|
## Architecture
|
|
@@ -227,7 +229,7 @@ update_history_with_config(
|
|
|
227
229
|
- **`collect-history`**: explicit date-range export into SQLite.
|
|
228
230
|
- **`update_history`**: incremental append based on existing SQLite `MAX(time)` per symbol (and timeframe for rates); account-level deals use a separate cursor when `include_account_events=True`.
|
|
229
231
|
- **`rates` table**: normalized storage with `symbol` and `timeframe` columns.
|
|
230
|
-
- **Rate compatibility views**: mt5cli manages all `rate_*` views. Naming is `rate_<symbol>__<timeframe>` when a symbol has one timeframe, otherwise `rate_<symbol>__<granularity>_<timeframe>` (for example `rate_EURUSD__M1_1`). Stale `rate_*` views are dropped and recreated when rates change for offline tools
|
|
232
|
+
- **Rate compatibility views**: mt5cli manages all `rate_*` views. Naming is `rate_<symbol>__<timeframe>` when a symbol has one timeframe, otherwise `rate_<symbol>__<granularity>_<timeframe>` (for example `rate_EURUSD__M1_1`). Stale `rate_*` views are dropped and recreated when rates change for offline downstream tools.
|
|
231
233
|
- **Rate view resolution**: use `resolve_rate_view_name()` / `resolve_rate_view_names()` to map symbols and granularities to existing SQLite compatibility views without creating databases. Both accept `None` (or a missing path) and return deterministic default names unless `require_existing=True`.
|
|
232
234
|
- **Rate view loading**: use `load_rate_data()` / `load_rate_data_from_connection()` to load a SQLite rate table or view into a `DatetimeIndex` DataFrame.
|
|
233
235
|
- **Multi-series rate loading**: use `build_rate_targets()` to build neutral `RateTarget(symbol, timeframe)` pairs, `resolve_rate_tables()` to map them to table/view names (pass `require_existing=True` for strict resolution), and `load_rate_series_from_sqlite()` to load them into a mapping keyed by `(symbol, integer timeframe)`. The loader requires existing managed views unless `explicit_tables` is supplied, and rejects duplicate `(symbol, timeframe)` targets.
|
|
@@ -247,7 +249,7 @@ eurusd_m1 = rates["EURUSD", "M1"] # closed bars only
|
|
|
247
249
|
```
|
|
248
250
|
|
|
249
251
|
- **Credential resolution**: use `resolve_account_spec()` / `resolve_account_specs()` to merge explicit override values over `AccountSpec` fields and expand `${ENV_VAR}` placeholders (via `substitute_env_placeholders()`), raising `ValueError` for missing variables. This keeps secrets out of plan/config files without coupling to any strategy code.
|
|
250
|
-
- **Throttled history updates**: use `ThrottledHistoryUpdater` to wrap `update_history()` with a minimum `interval_seconds` between successful runs (monotonic clock). Call `should_update()` / `update(client, symbols)` from an application loop; errors propagate by default, or pass `suppress_errors=True` to swallow recoverable `Mt5*Error`, `sqlite3.Error`, `ValueError`, `OSError`, and MT5 client capability errors for history API methods without advancing the throttle (other `AttributeError` / `TypeError` values always propagate).
|
|
252
|
+
- **Throttled history updates**: use `ThrottledHistoryUpdater` to wrap `update_history()` with a minimum `interval_seconds` between successful runs (monotonic clock). Call `should_update()` / `update(client, symbols)` from an application loop; errors propagate by default, or pass `suppress_errors=True` to swallow recoverable `Mt5*Error`, `sqlite3.Error`, `ValueError`, `OSError`, and MT5 client capability errors for history API methods without advancing the throttle (other `AttributeError` / `TypeError` values always propagate). Pass `update_backend` to inject a custom history update callable (same keyword arguments as `update_history`) instead of monkey-patching `mt5cli.sdk.update_history`.
|
|
251
253
|
- **Trading session helpers**: use `mt5_trading_session()` for a trading-capable `pdmt5.Mt5TradingClient` that initializes/logs in via `Mt5Config.path` and always shuts down safely. Pair with `detect_position_side()`, `calculate_margin_and_volume()`, and `determine_order_limits()` for generic position and sizing utilities. The read-only `mt5_session()` / `Mt5CliClient` SDK is unchanged.
|
|
252
254
|
- **Granularity-keyed rate loading**: `load_rate_series_by_granularity()` builds targets with `build_rate_targets()`, loads them with `load_rate_series_from_sqlite()`, and returns a mapping keyed by `(symbol | None, granularity_name)` such as `("EURUSD", "M1")` to reduce downstream boilerplate.
|
|
253
255
|
- **MT5 session helper**: use the `mt5_session()` context manager to attach to (or, when `Mt5Config.path` is set, launch) an MT5 terminal, log in, and yield a connected `MT5Client` that shuts down on exit.
|
|
@@ -260,12 +262,12 @@ eurusd_m1 = rates["EURUSD", "M1"] # closed bars only
|
|
|
260
262
|
- Windows OS (MetaTrader 5 requirement)
|
|
261
263
|
- MetaTrader 5 platform installed
|
|
262
264
|
|
|
263
|
-
### Migration note for
|
|
265
|
+
### Migration note for downstream trading apps
|
|
264
266
|
|
|
265
267
|
Replace local MT5 lifecycle and trading helper code with mt5cli imports:
|
|
266
268
|
|
|
267
269
|
```python
|
|
268
|
-
# Before (local
|
|
270
|
+
# Before (local application helpers)
|
|
269
271
|
# with local_mt5_trading_session(config) as client:
|
|
270
272
|
# side = local_detect_position_side(client, symbol)
|
|
271
273
|
# sizing = local_calculate_margin_and_volume(client, symbol, unit_ratio, preserved_ratio)
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This section documents the mt5cli public Python API and CLI modules.
|
|
4
4
|
|
|
5
|
+
Start with the [Public API Contract](public-contract.md) for the stable
|
|
6
|
+
downstream SDK surface, CLI boundary, internal modules, and out-of-scope strategy
|
|
7
|
+
responsibilities.
|
|
8
|
+
|
|
5
9
|
## Public API layers
|
|
6
10
|
|
|
7
11
|
| Module | Purpose |
|
|
8
12
|
| ----------------------------------------- | ------------------------------------------------------------------------- |
|
|
13
|
+
| [Public API Contract](public-contract.md) | Stable downstream SDK exports, CLI boundary, and out-of-scope items |
|
|
9
14
|
| [Client](client.md) | `MT5Client` session abstraction for data access and order primitives |
|
|
10
15
|
| [Schemas](schemas.md) | Canonical DataFrame contracts and normalization helpers |
|
|
11
16
|
| [Storage](storage.md) | CSV/JSON/Parquet/SQLite export and history collection helpers |
|
|
@@ -30,7 +35,10 @@ flowchart TD
|
|
|
30
35
|
SDK --> PDMT5["pdmt5.Mt5DataClient"]
|
|
31
36
|
```
|
|
32
37
|
|
|
33
|
-
Downstream packages should depend on the package root exports
|
|
38
|
+
Downstream packages should depend on the package root exports documented in the
|
|
39
|
+
[Public API Contract](public-contract.md) (`MT5Client`,
|
|
40
|
+
`DataKind`, `normalize_dataframe`, `collect_history`, `load_rate_data`,
|
|
41
|
+
`resolve_rate_view_name`, etc.) rather than private modules.
|
|
34
42
|
|
|
35
43
|
`MT5Client.order_send()` is a live execution primitive that can place real trades. mt5cli exposes minimal execution helpers only; strategy logic, signals, backtests, and optimization remain out of scope and must be implemented downstream with explicit execution gating.
|
|
36
44
|
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Public API Contract
|
|
2
|
+
|
|
3
|
+
mt5cli is the generic MT5 data and execution infrastructure layer for downstream
|
|
4
|
+
Python applications. The intended dependency direction is:
|
|
5
|
+
|
|
6
|
+
```text
|
|
7
|
+
downstream app -> mt5cli -> pdmt5 -> MetaTrader 5
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Downstream packages should import from the package root (`from mt5cli import
|
|
11
|
+
...`) and treat the symbols listed below as the stable SDK contract. CLI
|
|
12
|
+
commands mirror the same behavior but are not importable Python APIs.
|
|
13
|
+
|
|
14
|
+
## Stable downstream SDK API
|
|
15
|
+
|
|
16
|
+
These names are exported from `mt5cli` and covered by the contract in
|
|
17
|
+
`mt5cli.STABLE_SDK_EXPORTS` (defined in `mt5cli.contract`). Prefer `MT5Client` over the legacy `Mt5CliClient`
|
|
18
|
+
alias for new code.
|
|
19
|
+
|
|
20
|
+
### Session lifecycle and configuration
|
|
21
|
+
|
|
22
|
+
| Symbol | Role |
|
|
23
|
+
| ----------------------------------------------- | ---------------------------------------------------------------- |
|
|
24
|
+
| `MT5Client`, `Mt5CliClient` | Read-only data client with optional `order_check` / `order_send` |
|
|
25
|
+
| `build_config` | Build `pdmt5.Mt5Config` from connection fields |
|
|
26
|
+
| `mt5_session` | Context manager: initialize, login, yield client, shutdown |
|
|
27
|
+
| `create_trading_client`, `mt5_trading_session` | Trading-capable `pdmt5.Mt5TradingClient` lifecycle |
|
|
28
|
+
| `AccountSpec` | Generic account group: symbols plus optional credentials |
|
|
29
|
+
| `resolve_account_spec`, `resolve_account_specs` | Merge overrides and expand `${ENV_VAR}` placeholders |
|
|
30
|
+
| `substitute_env_placeholders` | Replace `${NAME}` substrings from the environment |
|
|
31
|
+
|
|
32
|
+
Credential resolution is generic: any environment variable name may appear inside
|
|
33
|
+
`${...}`. mt5cli does not hard-code application-specific keys such as
|
|
34
|
+
`mt5_login` or `mt5_exe`.
|
|
35
|
+
|
|
36
|
+
### Read-only MT5 data access
|
|
37
|
+
|
|
38
|
+
Module-level helpers open a transient connection per call. Prefer `mt5_session`
|
|
39
|
+
or `MT5Client` when making many requests in one process.
|
|
40
|
+
|
|
41
|
+
| Area | Symbols |
|
|
42
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
43
|
+
| Rates | `copy_rates_from`, `copy_rates_from_pos`, `copy_rates_range`, `latest_rates`, `collect_latest_rates` |
|
|
44
|
+
| Ticks | `copy_ticks_from`, `copy_ticks_range`, `recent_ticks` |
|
|
45
|
+
| Account / terminal | `account_info`, `terminal_info`, `mt5_version`, `last_error`, `mt5_summary`, `mt5_summary_as_df` |
|
|
46
|
+
| Symbols / market | `symbols`, `symbol_info`, `symbol_info_tick`, `market_book`, `minimum_margins` |
|
|
47
|
+
| Trading state (read) | `orders`, `positions`, `history_orders`, `history_deals`, `recent_history_deals` |
|
|
48
|
+
|
|
49
|
+
Use `mt5_version` for MetaTrader 5 terminal version data. The name `version` at
|
|
50
|
+
the package root refers to `importlib.metadata.version` (package metadata), not
|
|
51
|
+
the MT5 SDK helper.
|
|
52
|
+
|
|
53
|
+
### Closed-bar rate helpers
|
|
54
|
+
|
|
55
|
+
MetaTrader 5 returns the still-forming bar as the last row when
|
|
56
|
+
`start_pos=0`. Use these helpers instead of reimplementing bar trimming or
|
|
57
|
+
timestamp normalization in downstream apps.
|
|
58
|
+
|
|
59
|
+
| Symbol | Role |
|
|
60
|
+
| ------------------------------------------------ | ------------------------------------------------------------ |
|
|
61
|
+
| `drop_forming_rate_bar` | Remove the last row from chronologically ordered rate data |
|
|
62
|
+
| `fetch_latest_closed_rates` | Single connected client: fetch `count + 1`, drop forming bar |
|
|
63
|
+
| `collect_latest_closed_rates_for_accounts` | Multi-account closed bars with optional retry wrapper |
|
|
64
|
+
| `collect_latest_closed_rates_by_granularity` | Same data keyed by `(symbol, granularity_name)` |
|
|
65
|
+
| `collect_latest_rates_for_accounts` | Latest bars including the forming bar when `start_pos=0` |
|
|
66
|
+
| `collect_latest_rates_for_accounts_with_retries` | Bounded exponential backoff for transient MT5 errors |
|
|
67
|
+
|
|
68
|
+
### SQLite history collection and rate loading
|
|
69
|
+
|
|
70
|
+
| Symbol | Role |
|
|
71
|
+
| ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
72
|
+
| `collect_history` | One-shot date-range export into SQLite |
|
|
73
|
+
| `update_history`, `update_history_with_config` | Incremental append from `MAX(time)` cursors |
|
|
74
|
+
| `ThrottledHistoryUpdater` | Minimum interval between successful incremental updates; optional `update_backend` injection |
|
|
75
|
+
| `resolve_history_datasets`, `resolve_history_timeframes`, `resolve_history_tick_flags` | History pipeline configuration |
|
|
76
|
+
| `build_rate_view_name`, `resolve_rate_table_name`, `resolve_rate_view_name`, `resolve_rate_view_names`, `resolve_rate_tables` | Map symbols/timeframes to mt5cli-managed table or view names |
|
|
77
|
+
| `RateTarget`, `build_rate_targets` | Neutral `(symbol, timeframe)` series descriptors |
|
|
78
|
+
| `load_rate_data`, `load_rate_data_from_connection` | Load one table/view into a time-indexed DataFrame |
|
|
79
|
+
| `load_rate_series_from_sqlite`, `load_rate_series_by_granularity` | Load one or many series; fail clearly when managed views are missing |
|
|
80
|
+
|
|
81
|
+
Pass `require_existing=True` to rate view resolution helpers when downstream
|
|
82
|
+
code must fail instead of receiving a best-guess view name. Multi-series loaders
|
|
83
|
+
require existing managed `rate_*__*` views unless `explicit_tables` is supplied.
|
|
84
|
+
|
|
85
|
+
See [History Collection (SQLite)](history.md) for schema, view naming, and ER
|
|
86
|
+
diagrams.
|
|
87
|
+
|
|
88
|
+
### Trading and sizing primitives (generic)
|
|
89
|
+
|
|
90
|
+
These helpers implement broker-facing calculations only. They do not encode
|
|
91
|
+
strategy entries, exits, Kelly sizing, or signal logic.
|
|
92
|
+
|
|
93
|
+
| Symbol | Role |
|
|
94
|
+
| -------------------------------------------------------------------------------------------------- | --------------------------------------------- |
|
|
95
|
+
| `get_account_snapshot`, `get_symbol_snapshot`, `get_tick_snapshot`, `get_positions_frame` | Normalized account/symbol/tick/position views |
|
|
96
|
+
| `detect_position_side` | Net long / short / flat from open positions |
|
|
97
|
+
| `calculate_spread_ratio` | Relative bid-ask spread |
|
|
98
|
+
| `calculate_margin_and_volume`, `calculate_volume_by_margin`, `calculate_new_position_margin_ratio` | Margin budget and volume sizing |
|
|
99
|
+
| `determine_order_limits` | SL/TP price levels from ratios |
|
|
100
|
+
| `ensure_symbol_selected` | Select/verify Market Watch visibility |
|
|
101
|
+
| `place_market_order`, `close_open_positions`, `update_sltp_for_open_positions` | Order execution helpers (`dry_run` supported) |
|
|
102
|
+
| `MarginVolume`, `OrderLimits`, `OrderExecutionResult` | Typed return contracts for order helpers |
|
|
103
|
+
| `OrderSide`, `OrderFillingMode`, `OrderTimeMode`, `PositionSide`, `ExecutionStatus` | Typed enums for order helpers |
|
|
104
|
+
|
|
105
|
+
`MT5Client.order_send()` and CLI `order-send --yes` are live execution paths.
|
|
106
|
+
|
|
107
|
+
Order helpers validate broker stop-level distance in `determine_order_limits()` and
|
|
108
|
+
raise `Mt5TradingError` when computed SL/TP prices are too close to the entry
|
|
109
|
+
quote. Validation uses `trade_stops_level * point` from the current quote and
|
|
110
|
+
symbol metadata as a pre-check only; it does not guarantee live order acceptance
|
|
111
|
+
after price movement and does not inspect `trade_freeze_level`. Live
|
|
112
|
+
`place_market_order()` and SL/TP updates call
|
|
113
|
+
`ensure_symbol_selected()` so hidden symbols are added to Market Watch before
|
|
114
|
+
sending requests. Failed, malformed, or unknown broker retcodes are fail-closed
|
|
115
|
+
and returned as `status="failed"` with normalized `request` / `response` details;
|
|
116
|
+
`dry_run=True` never calls `ensure_symbol_selected()` or `order_send()`.
|
|
117
|
+
|
|
118
|
+
### Errors and MT5 type re-exports
|
|
119
|
+
|
|
120
|
+
| Symbol | Role |
|
|
121
|
+
| ------------------------------------------------------------------------------------ | ----------------------------------------------- |
|
|
122
|
+
| `Mt5CliError`, `Mt5ConnectionError`, `Mt5OperationError`, `Mt5SchemaError` | Stable mt5cli exception types |
|
|
123
|
+
| `normalize_mt5_exception`, `call_with_normalized_errors`, `is_recoverable_mt5_error` | Error normalization and retry classification |
|
|
124
|
+
| `Mt5Config`, `Mt5RuntimeError`, `Mt5TradingClient`, `Mt5TradingError` | Re-exported pdmt5 types for adapter convenience |
|
|
125
|
+
|
|
126
|
+
### Additional public exports (secondary)
|
|
127
|
+
|
|
128
|
+
The package root also exports schema, storage, and parsing helpers (for example
|
|
129
|
+
`DataKind`, `Dataset`, `normalize_dataframe`, `export_dataframe`,
|
|
130
|
+
`parse_timeframe`, `TIMEFRAME_MAP`). These are public but oriented toward export
|
|
131
|
+
pipelines and advanced integration. Prefer the stable symbols above for core
|
|
132
|
+
infrastructure.
|
|
133
|
+
|
|
134
|
+
## CLI commands
|
|
135
|
+
|
|
136
|
+
The Typer application in `mt5cli.cli` exposes file-export commands documented in
|
|
137
|
+
[CLI Module](cli.md) and the project README. CLI commands:
|
|
138
|
+
|
|
139
|
+
- Require `-o/--output` and write CSV, JSON, Parquet, or SQLite.
|
|
140
|
+
- Accept global MT5 connection options (`--login`, `--password`, `--server`,
|
|
141
|
+
`--path`, `--timeout`).
|
|
142
|
+
- Delegate to the same Python APIs described here; they are not duplicated
|
|
143
|
+
business logic.
|
|
144
|
+
|
|
145
|
+
`order-send` requires `--yes` before placing live trades.
|
|
146
|
+
|
|
147
|
+
## Internal helpers (not stable)
|
|
148
|
+
|
|
149
|
+
Do not import these for downstream contracts; they may change without a semver
|
|
150
|
+
notice:
|
|
151
|
+
|
|
152
|
+
| Module | Examples |
|
|
153
|
+
| ------------------------ | ------------------------------------------------------------------------- |
|
|
154
|
+
| `mt5cli.sdk` | `connected_client`, `_run_with_client`, private coercion helpers |
|
|
155
|
+
| `mt5cli.history` | `write_*_dataset`, `deduplicate_history_tables`, `parse_sqlite_timestamp` |
|
|
156
|
+
| `mt5cli.retry` | `retry_with_backoff` |
|
|
157
|
+
| `mt5cli.cli` | Typer command handlers and Click parameter types |
|
|
158
|
+
| Leading-underscore names | Any `_`-prefixed function or method |
|
|
159
|
+
|
|
160
|
+
Use the package-root stable exports instead of reaching into submodule
|
|
161
|
+
internals.
|
|
162
|
+
|
|
163
|
+
## Explicitly out of scope
|
|
164
|
+
|
|
165
|
+
mt5cli must **not** implement downstream strategy or research responsibilities.
|
|
166
|
+
The following belong in consuming applications, not in mt5cli:
|
|
167
|
+
|
|
168
|
+
- Signal detection (for example AR-GARCH or other model-specific triggers)
|
|
169
|
+
- Backtesting, walk-forward analysis, or parameter optimization
|
|
170
|
+
- Strategy-specific risk policy, position sizing systems, or Kelly fractions
|
|
171
|
+
- Entry/exit decision logic or YAML strategy semantics
|
|
172
|
+
- Application-specific credential schema keys wired into mt5cli internals
|
|
173
|
+
|
|
174
|
+
mt5cli provides connection lifecycle, normalized data access, SQLite history
|
|
175
|
+
machinery, closed-bar helpers, generic margin/volume/spread/SL/TP utilities, and
|
|
176
|
+
optional order primitives so downstream apps can focus on strategy code behind
|
|
177
|
+
their own adapter layer.
|
|
178
|
+
|
|
179
|
+
## Contract verification
|
|
180
|
+
|
|
181
|
+
`tests/test_contracts.py` asserts that every name in `STABLE_SDK_EXPORTS` is
|
|
182
|
+
importable from `mt5cli`, documents key closed-bar, rate-view, SQLite loading,
|
|
183
|
+
account-resolution, and trading-session behaviors, and keeps the contract set
|
|
184
|
+
aligned with `__all__`.
|
|
@@ -113,6 +113,28 @@ finally:
|
|
|
113
113
|
client.shutdown()
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
Pass `update_backend` to substitute the default `update_history` implementation
|
|
117
|
+
without monkey-patching `mt5cli.sdk.update_history`. The callable receives the
|
|
118
|
+
same keyword arguments as `update_history` (`client`, `output`, `symbols`,
|
|
119
|
+
`datasets`, `timeframes`, `flags`, `lookback_hours`, `with_views`,
|
|
120
|
+
`include_account_events`). The resolved backend is stored on
|
|
121
|
+
`updater.update_backend` for inspection or subclassing.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from mt5cli import ThrottledHistoryUpdater, update_history
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def app_update_history(**kwargs) -> None:
|
|
128
|
+
update_history(**kwargs) # or delegate to application-specific logic
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
updater = ThrottledHistoryUpdater(
|
|
132
|
+
output="history.db",
|
|
133
|
+
interval_seconds=60,
|
|
134
|
+
update_backend=app_update_history,
|
|
135
|
+
)
|
|
136
|
+
```
|
|
137
|
+
|
|
116
138
|
By default recoverable errors (`Mt5TradingError`, `Mt5RuntimeError`,
|
|
117
139
|
`sqlite3.Error`, `ValueError`, `OSError`, and MT5 client capability
|
|
118
140
|
`AttributeError` / `TypeError` for history API methods) propagate so the caller
|
|
@@ -90,18 +90,65 @@ sell-only exposure, and `None` for no positions or mixed long/short exposure.
|
|
|
90
90
|
|
|
91
91
|
SL/TP ratios for `determine_order_limits()` must satisfy `0 <= ratio < 1`; `0`
|
|
92
92
|
omits that level. SL/TP prices are rounded with symbol `digits` metadata when
|
|
93
|
-
available. `
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
available. `determine_order_limits()` pre-validates computed SL/TP prices against
|
|
94
|
+
available `trade_stops_level * point` metadata when present; violations raise
|
|
95
|
+
`Mt5TradingError`. This is a planning helper only: it does not guarantee broker
|
|
96
|
+
acceptance because live validation can still depend on price movement, bid/ask
|
|
97
|
+
side, freeze levels, and server-side rules, and it does not validate
|
|
98
|
+
`trade_freeze_level`. When symbol metadata cannot be loaded, protective prices
|
|
99
|
+
still round with `digits=8` and stop-level validation is skipped.
|
|
100
|
+
`unit_margin_ratio` and `preserved_margin_ratio` for `calculate_margin_and_volume()`
|
|
101
|
+
accept `0 <= ratio <= 1`; `unit_margin_ratio=0` requests one minimum valid unit
|
|
102
|
+
when the post-reserve margin can afford it. Negative `margin_free` is clamped to
|
|
103
|
+
`0.0` before sizing. Execution helpers return normalized `OrderExecutionResult`
|
|
104
|
+
dictionaries containing the request, response, status, retcode, and `dry_run`
|
|
105
|
+
flag; `dry_run=True` never sends an order or mutates Market Watch visibility.
|
|
106
|
+
`ensure_symbol_selected()` adds hidden symbols to Market Watch before live order
|
|
107
|
+
placement and SL/TP updates. Failed, malformed, or unknown broker retcodes are
|
|
108
|
+
fail-closed and returned as `status="failed"` while keeping the normalized
|
|
109
|
+
response for inspection.
|
|
110
|
+
|
|
111
|
+
## Order planning return contracts
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from mt5cli import MarginVolume, OrderLimits, OrderExecutionResult
|
|
115
|
+
|
|
116
|
+
sizing: MarginVolume = calculate_margin_and_volume(
|
|
117
|
+
client,
|
|
118
|
+
"EURUSD",
|
|
119
|
+
unit_margin_ratio=0.5,
|
|
120
|
+
preserved_margin_ratio=0.2,
|
|
121
|
+
)
|
|
122
|
+
limits: OrderLimits = determine_order_limits(
|
|
123
|
+
client,
|
|
124
|
+
"EURUSD",
|
|
125
|
+
side="long",
|
|
126
|
+
stop_loss_limit_ratio=0.01,
|
|
127
|
+
take_profit_limit_ratio=0.02,
|
|
128
|
+
)
|
|
129
|
+
preview: OrderExecutionResult = place_market_order(
|
|
130
|
+
client,
|
|
131
|
+
symbol="EURUSD",
|
|
132
|
+
volume=sizing["buy_volume"],
|
|
133
|
+
order_side="BUY",
|
|
134
|
+
sl=limits["stop_loss"],
|
|
135
|
+
tp=limits["take_profit"],
|
|
136
|
+
dry_run=True,
|
|
137
|
+
)
|
|
138
|
+
updates: list[OrderExecutionResult] = update_sltp_for_open_positions(
|
|
139
|
+
client,
|
|
140
|
+
symbol="EURUSD",
|
|
141
|
+
stop_loss=limits["stop_loss"],
|
|
142
|
+
dry_run=True,
|
|
143
|
+
)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Closes issue #33: strategy-neutral order planning and execution helpers exposed
|
|
147
|
+
through the stable package root without embedding entry/exit policy.
|
|
148
|
+
|
|
149
|
+
## Migration from application-local helpers
|
|
150
|
+
|
|
151
|
+
| Application-local concern | mt5cli replacement |
|
|
105
152
|
| -------------------------------------------------------- | ----------------------------------------------- |
|
|
106
153
|
| Manual terminal spawn/kill around trading code | `mt5_trading_session()` |
|
|
107
154
|
| Local position-side detection | `detect_position_side()` |
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
"""mt5cli: Generic MT5 data and execution infrastructure for Python applications.
|
|
1
|
+
"""mt5cli: Generic MT5 data and execution infrastructure for Python applications.
|
|
2
|
+
|
|
3
|
+
Downstream packages should import from this module (``from mt5cli import ...``)
|
|
4
|
+
rather than private submodule helpers. See ``docs/api/public-contract.md`` for
|
|
5
|
+
the stable SDK contract, CLI surface, internal modules, and out-of-scope
|
|
6
|
+
strategy responsibilities.
|
|
7
|
+
"""
|
|
2
8
|
|
|
3
9
|
from importlib.metadata import version
|
|
4
10
|
|
|
5
11
|
from pdmt5 import Mt5Config, Mt5RuntimeError, Mt5TradingClient, Mt5TradingError
|
|
6
12
|
|
|
7
13
|
from .client import MT5Client, build_config, mt5_session
|
|
14
|
+
from .contract import STABLE_SDK_EXPORTS
|
|
8
15
|
from .converters import (
|
|
9
16
|
ensure_utc,
|
|
10
17
|
granularity_name,
|
|
@@ -101,7 +108,11 @@ from .storage import (
|
|
|
101
108
|
)
|
|
102
109
|
from .trading import (
|
|
103
110
|
POSITION_COLUMNS,
|
|
111
|
+
ExecutionStatus,
|
|
112
|
+
MarginVolume,
|
|
113
|
+
OrderExecutionResult,
|
|
104
114
|
OrderFillingMode,
|
|
115
|
+
OrderLimits,
|
|
105
116
|
OrderSide,
|
|
106
117
|
OrderTimeMode,
|
|
107
118
|
PositionSide,
|
|
@@ -113,6 +124,7 @@ from .trading import (
|
|
|
113
124
|
create_trading_client,
|
|
114
125
|
detect_position_side,
|
|
115
126
|
determine_order_limits,
|
|
127
|
+
ensure_symbol_selected,
|
|
116
128
|
get_account_snapshot,
|
|
117
129
|
get_positions_frame,
|
|
118
130
|
get_symbol_snapshot,
|
|
@@ -136,14 +148,17 @@ __all__ = [
|
|
|
136
148
|
"KNOWN_MT5_TIME_COLUMNS",
|
|
137
149
|
"POSITION_COLUMNS",
|
|
138
150
|
"REQUIRED_COLUMNS",
|
|
151
|
+
"STABLE_SDK_EXPORTS",
|
|
139
152
|
"TICK_FLAG_MAP",
|
|
140
153
|
"TIMEFRAME_MAP",
|
|
141
154
|
"TIME_COLUMNS",
|
|
142
155
|
"AccountSpec",
|
|
143
156
|
"DataKind",
|
|
144
157
|
"Dataset",
|
|
158
|
+
"ExecutionStatus",
|
|
145
159
|
"IfExists",
|
|
146
160
|
"MT5Client",
|
|
161
|
+
"MarginVolume",
|
|
147
162
|
"Mt5CliClient",
|
|
148
163
|
"Mt5CliError",
|
|
149
164
|
"Mt5Config",
|
|
@@ -153,7 +168,9 @@ __all__ = [
|
|
|
153
168
|
"Mt5SchemaError",
|
|
154
169
|
"Mt5TradingClient",
|
|
155
170
|
"Mt5TradingError",
|
|
171
|
+
"OrderExecutionResult",
|
|
156
172
|
"OrderFillingMode",
|
|
173
|
+
"OrderLimits",
|
|
157
174
|
"OrderSide",
|
|
158
175
|
"OrderTimeMode",
|
|
159
176
|
"PositionSide",
|
|
@@ -185,6 +202,7 @@ __all__ = [
|
|
|
185
202
|
"detect_position_side",
|
|
186
203
|
"determine_order_limits",
|
|
187
204
|
"drop_forming_rate_bar",
|
|
205
|
+
"ensure_symbol_selected",
|
|
188
206
|
"ensure_utc",
|
|
189
207
|
"export_dataframe",
|
|
190
208
|
"export_dataframe_to_sqlite",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Stable downstream SDK export names for mt5cli."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
STABLE_SDK_EXPORTS: frozenset[str] = frozenset({
|
|
6
|
+
"AccountSpec",
|
|
7
|
+
"MT5Client",
|
|
8
|
+
"Mt5CliClient",
|
|
9
|
+
"Mt5CliError",
|
|
10
|
+
"Mt5Config",
|
|
11
|
+
"Mt5ConnectionError",
|
|
12
|
+
"Mt5OperationError",
|
|
13
|
+
"Mt5RuntimeError",
|
|
14
|
+
"Mt5SchemaError",
|
|
15
|
+
"Mt5TradingClient",
|
|
16
|
+
"Mt5TradingError",
|
|
17
|
+
"OrderFillingMode",
|
|
18
|
+
"OrderSide",
|
|
19
|
+
"OrderTimeMode",
|
|
20
|
+
"PositionSide",
|
|
21
|
+
"ExecutionStatus",
|
|
22
|
+
"MarginVolume",
|
|
23
|
+
"OrderExecutionResult",
|
|
24
|
+
"OrderLimits",
|
|
25
|
+
"RateTarget",
|
|
26
|
+
"ThrottledHistoryUpdater",
|
|
27
|
+
"account_info",
|
|
28
|
+
"build_config",
|
|
29
|
+
"build_rate_targets",
|
|
30
|
+
"build_rate_view_name",
|
|
31
|
+
"calculate_margin_and_volume",
|
|
32
|
+
"calculate_new_position_margin_ratio",
|
|
33
|
+
"calculate_spread_ratio",
|
|
34
|
+
"calculate_volume_by_margin",
|
|
35
|
+
"call_with_normalized_errors",
|
|
36
|
+
"close_open_positions",
|
|
37
|
+
"collect_history",
|
|
38
|
+
"collect_latest_closed_rates_by_granularity",
|
|
39
|
+
"collect_latest_closed_rates_for_accounts",
|
|
40
|
+
"collect_latest_rates",
|
|
41
|
+
"collect_latest_rates_for_accounts",
|
|
42
|
+
"collect_latest_rates_for_accounts_with_retries",
|
|
43
|
+
"copy_rates_from",
|
|
44
|
+
"copy_rates_from_pos",
|
|
45
|
+
"copy_rates_range",
|
|
46
|
+
"copy_ticks_from",
|
|
47
|
+
"copy_ticks_range",
|
|
48
|
+
"create_trading_client",
|
|
49
|
+
"detect_position_side",
|
|
50
|
+
"determine_order_limits",
|
|
51
|
+
"drop_forming_rate_bar",
|
|
52
|
+
"ensure_symbol_selected",
|
|
53
|
+
"export_dataframe",
|
|
54
|
+
"export_dataframe_to_sqlite",
|
|
55
|
+
"fetch_latest_closed_rates",
|
|
56
|
+
"get_account_snapshot",
|
|
57
|
+
"get_positions_frame",
|
|
58
|
+
"get_symbol_snapshot",
|
|
59
|
+
"get_tick_snapshot",
|
|
60
|
+
"history_deals",
|
|
61
|
+
"history_orders",
|
|
62
|
+
"is_recoverable_mt5_error",
|
|
63
|
+
"last_error",
|
|
64
|
+
"latest_rates",
|
|
65
|
+
"load_rate_data",
|
|
66
|
+
"load_rate_data_from_connection",
|
|
67
|
+
"load_rate_series_by_granularity",
|
|
68
|
+
"load_rate_series_from_sqlite",
|
|
69
|
+
"market_book",
|
|
70
|
+
"minimum_margins",
|
|
71
|
+
"mt5_session",
|
|
72
|
+
"mt5_summary",
|
|
73
|
+
"mt5_summary_as_df",
|
|
74
|
+
"mt5_trading_session",
|
|
75
|
+
"mt5_version",
|
|
76
|
+
"normalize_mt5_exception",
|
|
77
|
+
"orders",
|
|
78
|
+
"place_market_order",
|
|
79
|
+
"positions",
|
|
80
|
+
"recent_history_deals",
|
|
81
|
+
"recent_ticks",
|
|
82
|
+
"resolve_account_spec",
|
|
83
|
+
"resolve_account_specs",
|
|
84
|
+
"resolve_history_datasets",
|
|
85
|
+
"resolve_history_tick_flags",
|
|
86
|
+
"resolve_history_timeframes",
|
|
87
|
+
"resolve_rate_table_name",
|
|
88
|
+
"resolve_rate_tables",
|
|
89
|
+
"resolve_rate_view_name",
|
|
90
|
+
"resolve_rate_view_names",
|
|
91
|
+
"substitute_env_placeholders",
|
|
92
|
+
"symbol_info",
|
|
93
|
+
"symbol_info_tick",
|
|
94
|
+
"symbols",
|
|
95
|
+
"terminal_info",
|
|
96
|
+
"update_history",
|
|
97
|
+
"update_history_with_config",
|
|
98
|
+
"update_sltp_for_open_positions",
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
__all__ = ["STABLE_SDK_EXPORTS"]
|