Skip to content

Commit e78ef5d

Browse files
committed
Fix: Export DataProviderConfig and add real MT4 price fetching
- Fixed ModuleNotFoundError for forexsmartbot.adapters.data by exporting DataProviderConfig - Added GetPrice command to MT4 EA for real-time price fetching - Updated MT4Broker to fetch real prices from MT4 instead of fake values - Enhanced enhanced_main_window.py to use real MT4 prices for position entry - All imports now work correctly - Backend and frontend properly connected
0 parents  commit e78ef5d

117 files changed

Lines changed: 28619 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Broker mode: PAPER or MT4
2+
BROKER=PAPER
3+
4+
# Initial paper account balance (for PAPER broker and backtests)
5+
ACCOUNT_BALANCE=10000
6+
7+
# Trade sizing user range
8+
TRADE_AMOUNT_MIN=10
9+
TRADE_AMOUNT_MAX=100
10+
11+
# Risk parameters (defaults used if missing)
12+
RISK_PCT=0.02
13+
MAX_DRAWDOWN_PCT=0.25
14+
15+
# MT4 ZMQ bridge
16+
MT4_ZMQ_HOST=127.0.0.1
17+
MT4_ZMQ_PORT=5555
18+
19+
# Default symbols/pairs (comma separated)
20+
SYMBOLS=EURUSD,USDJPY,GBPUSD
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Environment:**
27+
- OS: [e.g. Windows 10, macOS 12, Ubuntu 20.04]
28+
- Python Version: [e.g. 3.10.0]
29+
- App Version: [e.g. 3.0.0]
30+
- PyQt6 Version: [e.g. 6.7.0]
31+
32+
**Additional context**
33+
Add any other context about the problem here.
34+
35+
**Logs**
36+
If applicable, add relevant log entries or error messages.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Use case**
20+
Describe the use case and how this feature would be beneficial.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.
24+
25+
**Implementation complexity**
26+
- [ ] Low (simple change)
27+
- [ ] Medium (moderate complexity)
28+
- [ ] High (complex implementation)
29+
30+
**Priority**
31+
- [ ] Low
32+
- [ ] Medium
33+
- [ ] High
34+
- [ ] Critical

.github/ISSUE_TEMPLATE/question.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Question
3+
about: Ask a question about the project
4+
title: '[QUESTION] '
5+
labels: question
6+
assignees: ''
7+
8+
---
9+
10+
**What is your question?**
11+
A clear and concise description of what you want to know.
12+
13+
**Context**
14+
Provide any relevant context about your question.
15+
16+
**What have you tried?**
17+
Describe what you've already tried to find the answer.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the question here.
21+
22+
**Category**
23+
- [ ] Installation
24+
- [ ] Configuration
25+
- [ ] Usage
26+
- [ ] Development
27+
- [ ] Documentation
28+
- [ ] Other

.github/pull_request_template.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Pull Request
2+
3+
## Description
4+
Brief description of what this PR does.
5+
6+
## Type of Change
7+
- [ ] Bug fix (non-breaking change which fixes an issue)
8+
- [ ] New feature (non-breaking change which adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Code refactoring
12+
- [ ] Performance improvement
13+
- [ ] Test addition/update
14+
15+
## Related Issues
16+
Closes #(issue number)
17+
18+
## Changes Made
19+
- [ ] List the main changes made
20+
- [ ] Include any new features
21+
- [ ] Mention any bug fixes
22+
- [ ] Note any breaking changes
23+
24+
## Testing
25+
- [ ] Unit tests pass
26+
- [ ] Integration tests pass
27+
- [ ] Manual testing completed
28+
- [ ] Performance testing completed (if applicable)
29+
30+
## Screenshots (if applicable)
31+
Add screenshots to help explain your changes.
32+
33+
## Checklist
34+
- [ ] My code follows the project's style guidelines
35+
- [ ] I have performed a self-review of my own code
36+
- [ ] I have commented my code, particularly in hard-to-understand areas
37+
- [ ] I have made corresponding changes to the documentation
38+
- [ ] My changes generate no new warnings
39+
- [ ] I have added tests that prove my fix is effective or that my feature works
40+
- [ ] New and existing unit tests pass locally with my changes
41+
- [ ] Any dependent changes have been merged and published
42+
43+
## Additional Notes
44+
Add any additional notes about the PR here.
45+
46+
## Breaking Changes
47+
If this PR contains breaking changes, describe them here and provide migration instructions.
48+
49+
## Performance Impact
50+
If this PR affects performance, describe the impact and any optimizations made.
51+
52+
## Security Considerations
53+
If this PR affects security, describe the security implications and any measures taken.

.github/workflows/ci.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest]
15+
python-version: ["3.10", "3.11", "3.12", "3.13"]
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Cache pip dependencies
26+
uses: actions/cache@v3
27+
with:
28+
path: ~/.cache/pip
29+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
30+
restore-keys: |
31+
${{ runner.os }}-pip-
32+
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install -r requirements.txt
37+
pip install pytest pytest-cov black ruff mypy pre-commit
38+
39+
- name: Lint with ruff
40+
run: |
41+
ruff check forexsmartbot/ tests/
42+
43+
- name: Type check with mypy
44+
run: |
45+
mypy forexsmartbot/ --ignore-missing-imports
46+
47+
- name: Format check with black
48+
run: |
49+
black --check forexsmartbot/ tests/
50+
51+
- name: Test with pytest
52+
run: |
53+
pytest tests/ --cov=forexsmartbot --cov-report=xml --cov-report=term-missing
54+
55+
- name: Upload coverage to Codecov
56+
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
57+
uses: codecov/codecov-action@v3
58+
with:
59+
file: ./coverage.xml
60+
flags: unittests
61+
name: codecov-umbrella
62+
fail_ci_if_error: false
63+
64+
build:
65+
runs-on: ubuntu-latest
66+
needs: test
67+
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Set up Python
72+
uses: actions/setup-python@v4
73+
with:
74+
python-version: "3.11"
75+
76+
- name: Install build dependencies
77+
run: |
78+
python -m pip install --upgrade pip
79+
pip install build twine
80+
81+
- name: Build package
82+
run: |
83+
python -m build
84+
85+
- name: Check package
86+
run: |
87+
twine check dist/*

.github/workflows/release.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-windows:
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.11'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -r requirements.txt
24+
pip install pyinstaller
25+
26+
- name: Build Windows executable
27+
run: |
28+
python build_installers.py
29+
30+
- name: Upload Windows release
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: ForexSmartBot-Windows
34+
path: dist/ForexSmartBot.exe
35+
36+
build-linux:
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up Python
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: '3.11'
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install -r requirements.txt
50+
pip install stdeb rpm
51+
52+
- name: Build Linux packages
53+
run: |
54+
python build_installers.py
55+
56+
- name: Upload Linux release
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: ForexSmartBot-Linux
60+
path: dist/
61+
62+
build-macos:
63+
runs-on: macos-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Set up Python
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: '3.11'
71+
72+
- name: Install dependencies
73+
run: |
74+
python -m pip install --upgrade pip
75+
pip install -r requirements.txt
76+
pip install py2app
77+
78+
- name: Build macOS package
79+
run: |
80+
python build_installers.py
81+
82+
- name: Upload macOS release
83+
uses: actions/upload-artifact@v3
84+
with:
85+
name: ForexSmartBot-macOS
86+
path: dist/
87+
88+
create-release:
89+
needs: [build-windows, build-linux, build-macos]
90+
runs-on: ubuntu-latest
91+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
92+
steps:
93+
- uses: actions/checkout@v4
94+
95+
- name: Download all artifacts
96+
uses: actions/download-artifact@v3
97+
98+
- name: Create Release
99+
uses: softprops/action-gh-release@v1
100+
with:
101+
files: |
102+
ForexSmartBot-Windows/ForexSmartBot.exe
103+
ForexSmartBot-Linux/*
104+
ForexSmartBot-macOS/*
105+
generate_release_notes: true
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)