-
Notifications
You must be signed in to change notification settings - Fork 5
10 create end to end trade management logic #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
05435e4
Added QuestDB tick streaming
mccaffers 16fb2c3
Refactoring tick flow
mccaffers 3ba4cec
Looping around tick data from multiple symbols
mccaffers 46e720d
Update source/CMakeLists.txt
mccaffers 61309bd
Apply suggestions from code review
mccaffers 48a9a99
Refactoring
mccaffers fab3106
Merge branch '10-create-end-to-end-trade-management-logic' of github.…
mccaffers 85be15b
fix run script, shell scopping behaviour was putting the build script…
mccaffers cbc033d
Update build os to target macos-latest
mccaffers bb24f06
Update build os to target macos-latest
mccaffers 27f82f1
Updating github workflow os
mccaffers e4e8e13
Refactoring build pipeline
mccaffers 0b6d40e
fixing workflow
mccaffers 8a0a710
Updating github workflow os
mccaffers 801c846
Updating github workflow os
mccaffers b57db36
Updating github workflow os
mccaffers 9a60a27
Updating github workflow os
mccaffers edb253f
Updating main flow, extracting the strategy to query questdB
mccaffers 657b5e2
Updating trade management operations
mccaffers 87bc95e
Refactoring operations flow
mccaffers 83d838f
updated workflows and optimised build & test
mccaffers e1ddeaa
updated workflow references
mccaffers 28ce018
updated workflow references
mccaffers cb840fd
updated workflow references
mccaffers 3f52047
updated workflow references
mccaffers File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| name: Build | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build & Test | ||
| runs-on: macos-26 | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Homebrew | ||
| id: set-up-homebrew | ||
| uses: Homebrew/actions/setup-homebrew@main | ||
|
|
||
| - name: Install dependencies | ||
| run: bash ./.github/workflows/scripts/brew.sh | ||
|
|
||
| - name: Build C++ Libraries | ||
| run: bash ./scripts/build_dep.sh | ||
|
|
||
| - name: Select Xcode version | ||
| run: sudo xcode-select -switch /Applications/Xcode.app | ||
|
|
||
| - name: Run tests | ||
| run: > | ||
| OTHER_CFLAGS="-fprofile-instr-generate -fcoverage-mapping" | ||
| OTHER_CPLUSPLUSFLAGS="-fprofile-instr-generate -fcoverage-mapping" | ||
| OTHER_SWIFT_FLAGS="-profile-generate -profile-coverage-mapping" | ||
| LLVM_PROFILE_FILE="/tmp/coverage.profraw" | ||
| CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | ||
| xcodebuild | ||
| -scheme tests | ||
| -destination 'platform=macOS' | ||
| -resultBundlePath TestResult/ | ||
| -enableCodeCoverage YES | ||
| -derivedDataPath "${RUNNER_TEMP}/Build/DerivedData" | ||
| -parallelizeTargets | ||
| -jobs "$(sysctl -n hw.logicalcpu)" | ||
| HEADER_SEARCH_PATHS="./external/libpqxx/include/pqxx/internal ./external/libpqxx/include/ ./external/libpqxx/build/include/ ./external/" | ||
| LIBRARY_SEARCH_PATHS="./external/libpqxx/src/ ./external/libpqxx/build/src/" | ||
| OTHER_LDFLAGS="-L./external/libpqxx/build/src -lpqxx -lpq -L$(brew --prefix pkgconf)/lib -L$(brew --prefix pkgconf)/lib/pkgconfig -L$(brew --prefix postgresql@18)/lib/postgresql -L$(brew --prefix postgresql@18)/lib/postgresql/pgxs -L$(brew --prefix postgresql@18)/lib/postgresql/pkgconfig" | ||
| clean build test | ||
| | xcpretty -r junit && exit ${PIPESTATUS[0]} | ||
|
|
||
| - name: Convert coverage report to sonarqube format | ||
| run: > | ||
| bash ./.github/workflows/scripts/xccov-to-sonarqube-generic.sh *.xcresult/ > sonarqube-generic-coverage.xml | ||
|
|
||
| - name: Upload coverage report | ||
| uses: actions/upload-artifact@v7 | ||
| with: | ||
| name: sonarqube-coverage | ||
| path: sonarqube-generic-coverage.xml | ||
| retention-days: 1 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| on: | ||
| # Triggered on completion of the Build workflow so we can consume its | ||
| # coverage artifact. workflow_run fires regardless of whether the upstream | ||
| # was triggered by push or pull_request. | ||
| workflow_run: | ||
| workflows: ["Build"] | ||
| types: [completed] | ||
|
|
||
| name: SonarCloud Scan | ||
|
|
||
| env: | ||
| BUILD_TYPE: Release | ||
| BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | ||
| # Opt into Node.js 24 for JavaScript actions ahead of the June 2026 default switch. | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
|
|
||
| sonar-scan: | ||
| name: SonarCloud Scan | ||
| runs-on: ubuntu-latest | ||
| # Only run if the upstream Build workflow succeeded. | ||
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
| steps: | ||
| # Check out the same commit the Build workflow ran against. workflow_run | ||
| # otherwise defaults to the default branch. | ||
| - name: Checkout repository on branch | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| ref: ${{ github.event.workflow_run.head_sha }} | ||
| fetch-depth: 0 | ||
| - name: Check compiler version, for debugging | ||
| run: | | ||
| g++ --version | ||
| cmake --version | ||
| - name: Build C++ Libraries | ||
| run: > | ||
| sh ./scripts/build.sh | ||
| - name: Install Python 3.12 for gcovr | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: 3.12 | ||
| # Gcovr provides a utility for managing the use of the GNU gcov utility and generating | ||
| # summarized code coverage results. This command is inspired by the Python coverage.py | ||
| # package, which provides a similar utility for Python. | ||
| # https://pypi.org/project/gcovr/ | ||
| - name: Install gcovr | ||
| run: | | ||
| pip install gcovr==8.3 | ||
| # SonarQube Server and Cloud (formerly SonarQube and SonarCloud) is a widely used static | ||
| # analysis solution for continuous code quality and security inspection. | ||
| # This action now supports and is the official entrypoint for scanning C++ projects via GitHub actions. | ||
| # https://github.com/SonarSource/sonarqube-scan-action | ||
| - name: Install Build Wrapper | ||
| uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v4.2.1 | ||
| # This step installs the SonarQube build wrapper, which is necessary for analyzing C/C++ projects. | ||
|
|
||
| # Cross-workflow artifact download. v4 requires run-id and github-token | ||
| # when fetching from a different workflow run. The artifact lands at | ||
| # ./artifact/sonarqube-generic-coverage.xml so the existing | ||
| # sonar.coverageReportPaths argument keeps working unchanged. | ||
| - name: Download coverage artifact from Build workflow | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: sonarqube-coverage | ||
| path: artifact | ||
| run-id: ${{ github.event.workflow_run.id }} | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| # Configures the CMake build system, specifying the source directory and build directory, and setting the build type | ||
| - name: Configure CMake | ||
| run: cmake -S ${{github.workspace}} -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON | ||
|
|
||
| # Runs the build wrapper to capture build commands and outputs them to the specified directory. Then builds the project using CMake | ||
| - name: Run build-wrapper | ||
| run: | | ||
| build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --clean-first | ||
|
|
||
| # Performs the SonarQube scan using the scan action. Uses captured build commands for analysis and requires GitHub and SonarQube tokens for authentication | ||
| - name: SonarQube Scan | ||
| uses: SonarSource/sonarqube-scan-action@v4.2.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
| with: | ||
| args: > | ||
| --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" | ||
| --define sonar.coverageReportPaths=artifact/sonarqube-generic-coverage.xml |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "configurations": [ | ||
| { | ||
| "name": "Mac", | ||
| "compileCommands": "${workspaceFolder}/build/compile_commands.json", | ||
| "includePath": [ | ||
| "${workspaceFolder}/external/libpqxx/include" | ||
| ] | ||
| } | ||
| ], | ||
| "version": 4 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding
OpenMP_omp_LIBRARYand the include path to/opt/homebrew/...will break on Apple systems that don’t use that prefix (or don’t havelibompinstalled there). Prefer lettingfind_package(OpenMP)locate OpenMP, or derive the path dynamically (e.g., viabrew --prefix libomp) and fail with a clear message if it’s missing.