Skip to content

Commit

Permalink
0.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
jailop committed Dec 21, 2024
1 parent dd365b3 commit 84f59cb
Show file tree
Hide file tree
Showing 25 changed files with 510 additions and 5,259 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/build_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Build and Test

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install build dependencies (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Install build dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install cmake
- name: Install build dependencies (Windows)
if: runner.os == 'Windows'
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov
python -m pip install -e .[dev]
- name: Run tests
run: |
pytest tests/ --cov=pybottrader --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true

build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp38-* cp39-* cp310-* cp311-*
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest {project}/tests"

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
name: wheels-${{ matrix.os }}-${{ matrix.python-version }}

publish:
needs: [test, build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'created'

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: dist

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
twine upload dist/*/*.whl
70 changes: 0 additions & 70 deletions .github/workflows/python-publish.yml

This file was deleted.

5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ v0.0.6 2024-12-13
`data`. It is a Python dictionary provided by data streamers.
- `process` method for the `Portfolio` class now receives as the argument a
`StrategySignal` object.

v0.0.7 2024-12-21

- Indicators module implemented in C++
- ATR indicator added
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ decision-making rules to generate trading signals. A basic trader module is
included for testing strategies, making the library a versatile framework for
algorithmic trading experimentation.

## Features

## Example

Using this library looks like:
Expand Down Expand Up @@ -91,3 +89,20 @@ pip install pybottrader
```

Shortly, I'm going to release more documentation and more examples.

## Installation Requirements

### Linux
- GCC/G++ compiler
- CMake 3.15 or higher
- Python development headers (python3-dev)

### Windows
- Visual Studio 2019 or later with C++ build tools
- CMake 3.15 or higher
- Windows SDK

### macOS
- Xcode Command Line Tools
- CMake 3.15 or higher

7 changes: 0 additions & 7 deletions docs/index.html

This file was deleted.

261 changes: 0 additions & 261 deletions docs/pybottrader.html

This file was deleted.

663 changes: 0 additions & 663 deletions docs/pybottrader/datastreamers.html

This file was deleted.

1,768 changes: 0 additions & 1,768 deletions docs/pybottrader/indicators.html

This file was deleted.

805 changes: 0 additions & 805 deletions docs/pybottrader/portfolios.html

This file was deleted.

583 changes: 0 additions & 583 deletions docs/pybottrader/strategies.html

This file was deleted.

746 changes: 0 additions & 746 deletions docs/pybottrader/traders.html

This file was deleted.

46 changes: 0 additions & 46 deletions docs/search.js

This file was deleted.

2 changes: 2 additions & 0 deletions src/pybottrader/__init__.py → pybottrader/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@
pip install pybottrader
```
"""

from .indicators import * # Import the C++ module directly
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions pybottrader/indicators/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
cmake_minimum_required(VERSION 3.15)
project(indicators)

if(NOT TARGET pybind11::module)
find_package(pybind11 REQUIRED)
endif()

# Platform specific flags
if(MSVC)
# Windows-specific flags
add_compile_options(/W4 /EHsc)
else()
# Linux/macOS flags
add_compile_options(-Wall -Wextra)
endif()

# Create module
pybind11_add_module(_indicators
src/bindings.cpp
)

# Include directories
target_include_directories(_indicators
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)

# Platform-specific link options
if(APPLE)
target_link_options(_indicators PRIVATE -undefined dynamic_lookup)
endif()

install(TARGETS _indicators
LIBRARY DESTINATION pybottrader/indicators
)
1 change: 1 addition & 0 deletions pybottrader/indicators/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ._indicators import * # This will import ATR and other symbols directly into indicators namespace
Loading

0 comments on commit 84f59cb

Please sign in to comment.