mt5-connector 0.1.0__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.
Files changed (46) hide show
  1. mt5_connector-0.1.0/.github/workflows/publish.yml +48 -0
  2. mt5_connector-0.1.0/.github/workflows/test.yml +39 -0
  3. mt5_connector-0.1.0/.gitignore +47 -0
  4. mt5_connector-0.1.0/LICENSE +21 -0
  5. mt5_connector-0.1.0/PKG-INFO +708 -0
  6. mt5_connector-0.1.0/README.md +654 -0
  7. mt5_connector-0.1.0/check_connectivity.py +665 -0
  8. mt5_connector-0.1.0/conftest.py +0 -0
  9. mt5_connector-0.1.0/data/XAUUSD_15min.csv +8001 -0
  10. mt5_connector-0.1.0/data/XAUUSD_1hour.csv +3001 -0
  11. mt5_connector-0.1.0/data/XAUUSD_30min.csv +5001 -0
  12. mt5_connector-0.1.0/data/XAUUSD_4hour.csv +1001 -0
  13. mt5_connector-0.1.0/data/XAUUSD_5min.csv +10001 -0
  14. mt5_connector-0.1.0/data/XAUUSD_daily.csv +501 -0
  15. mt5_connector-0.1.0/download_csvs.py +122 -0
  16. mt5_connector-0.1.0/env.example +17 -0
  17. mt5_connector-0.1.0/examples/__init__.py +0 -0
  18. mt5_connector-0.1.0/examples/backtest_eurusd.py +323 -0
  19. mt5_connector-0.1.0/examples/backtest_xauusd_fvg.py +293 -0
  20. mt5_connector-0.1.0/examples/download_historical_data.py +70 -0
  21. mt5_connector-0.1.0/examples/download_xauusd.py +154 -0
  22. mt5_connector-0.1.0/examples/fvg_strategy.py +408 -0
  23. mt5_connector-0.1.0/examples/live.py +374 -0
  24. mt5_connector-0.1.0/examples/test_place_order.py +205 -0
  25. mt5_connector-0.1.0/mt5connect/__init__.py +0 -0
  26. mt5_connector-0.1.0/mt5connect/config.py +138 -0
  27. mt5_connector-0.1.0/mt5connect/connection.py +368 -0
  28. mt5_connector-0.1.0/mt5connect/constants.py +205 -0
  29. mt5_connector-0.1.0/mt5connect/data.py +500 -0
  30. mt5_connector-0.1.0/mt5connect/downloader.py +447 -0
  31. mt5_connector-0.1.0/mt5connect/errors.py +77 -0
  32. mt5_connector-0.1.0/mt5connect/execution.py +1371 -0
  33. mt5_connector-0.1.0/mt5connect/factories.py +353 -0
  34. mt5_connector-0.1.0/mt5connect/parsing.py +535 -0
  35. mt5_connector-0.1.0/mt5connect/providers.py +297 -0
  36. mt5_connector-0.1.0/pyproject.toml +67 -0
  37. mt5_connector-0.1.0/pytest.ini +3 -0
  38. mt5_connector-0.1.0/test_mt5_connection.py +102 -0
  39. mt5_connector-0.1.0/tests/conftest.py +157 -0
  40. mt5_connector-0.1.0/tests/test_connection.py +690 -0
  41. mt5_connector-0.1.0/tests/test_data.py +820 -0
  42. mt5_connector-0.1.0/tests/test_downloader.py +892 -0
  43. mt5_connector-0.1.0/tests/test_execution.py +1451 -0
  44. mt5_connector-0.1.0/tests/test_factories.py +379 -0
  45. mt5_connector-0.1.0/tests/test_parsing.py +1095 -0
  46. mt5_connector-0.1.0/tests/test_providers.py +959 -0
@@ -0,0 +1,48 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*" # triggers on v0.1.0, v0.2.0, etc.
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: windows-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Set up Python
15
+ uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.11"
18
+ cache: pip
19
+
20
+ - name: Install and test
21
+ run: |
22
+ pip install -e ".[dev]"
23
+ pytest tests/ -v --tb=short
24
+
25
+ publish:
26
+ needs: test
27
+ runs-on: windows-latest
28
+ environment: pypi
29
+ permissions:
30
+ id-token: write # required for trusted publishing
31
+
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: Set up Python
36
+ uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.11"
39
+
40
+ - name: Build package
41
+ run: |
42
+ pip install build
43
+ python -m build
44
+
45
+ - name: Publish to PyPI
46
+ uses: pypa/gh-action-pypi-publish@release/v1
47
+ # Uses PyPI trusted publishing — no API token needed.
48
+ # Set up at: https://pypi.org/manage/account/publishing/
@@ -0,0 +1,39 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main, develop]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: windows-latest # MetaTrader5 library is Windows-only
12
+
13
+ strategy:
14
+ matrix:
15
+ python-version: ["3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python ${{ matrix.python-version }}
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: ${{ matrix.python-version }}
24
+ cache: pip
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install -e ".[dev]"
30
+
31
+ - name: Run tests
32
+ run: pytest tests/ -v --tb=short
33
+
34
+ - name: Upload test results
35
+ if: always()
36
+ uses: actions/upload-artifact@v4
37
+ with:
38
+ name: test-results-py${{ matrix.python-version }}
39
+ path: .pytest_cache/
@@ -0,0 +1,47 @@
1
+ # ── Credentials — NEVER commit ────────────────────────────────────────────────
2
+ .env
3
+
4
+ # ── Python ────────────────────────────────────────────────────────────────────
5
+ __pycache__/
6
+ *.py[cod]
7
+ *.pyo
8
+ *.pyd
9
+ .Python
10
+ *.egg-info/
11
+ dist/
12
+ build/
13
+ *.egg
14
+ .eggs/
15
+ MANIFEST
16
+
17
+ # ── Virtual environments ───────────────────────────────────────────────────────
18
+ venv/
19
+ .venv/
20
+ env/
21
+ ENV/
22
+
23
+ # ── Testing ───────────────────────────────────────────────────────────────────
24
+ .pytest_cache/
25
+ .coverage
26
+ .coverage.*
27
+ htmlcov/
28
+ .tox/
29
+
30
+ # ── NautilusTrader data catalog (can be large) ────────────────────────────────
31
+ catalog/
32
+
33
+ # ── IDE ───────────────────────────────────────────────────────────────────────
34
+ .vscode/
35
+ .idea/
36
+ *.swp
37
+ *.swo
38
+ *~
39
+
40
+ # ── OS ────────────────────────────────────────────────────────────────────────
41
+ .DS_Store
42
+ Thumbs.db
43
+ desktop.ini
44
+
45
+ # ── Logs ──────────────────────────────────────────────────────────────────────
46
+ *.log
47
+ logs/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 nautilus-mt5 contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.