-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🦙 feat(trade): alpaca 🦙 (#244)
* progress #minor * improve error handling for release * progress * add workflow * fix lint issue and change to day order * add test * add another test * add another test * finish tests, consider BTC if QQQ fails * split string * make notional string * try again * improve sleep_until fx * optimize portfolio once a month * run ohlc on dev env * add timezone for sleep_until
- Loading branch information
1 parent
941d48b
commit 3de4f81
Showing
15 changed files
with
221 additions
and
44 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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,55 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a single version of Python | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | ||
|
||
name: Optimize Portfolio | ||
|
||
on: | ||
schedule: | ||
- cron: "30 15 1-7 * *" | ||
# 11:30am EDT | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
|
||
- name: Cache pip dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest coverage | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Decrypt script | ||
env: | ||
RH_PASSWORD: ${{ secrets.RH_PASSWORD }} | ||
SALT: ${{ secrets.SALT }} | ||
run: | | ||
python util/decrypt.py encrypted/optimize_portfolio.py | ||
- name: Optimize portfolio | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
S3_BUCKET: ${{ secrets.S3_BUCKET }} | ||
ALPACA: ${{ secrets.ALPACA }} | ||
ALPACA_SECRET: ${{ secrets.ALPACA_SECRET }} | ||
run: | | ||
python encrypted/predict_signal.py | ||
This file contains 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
This file contains 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 @@ | ||
gAAAAABnidf7E2zHGfugNoEBHFFZ8L49YLV1d0CGbrYfR0IolJcmouZdaNVpy7_FuXQP1fhe0yTJBjxoB2Rz6YWXguXNIE0x8zPAviu03WV-vEwoS2iRMx6Ey5pex1SZUO_VutH72GEaTNT5NVztLk8dt7z60Zc9is-m1_4KywNmekm1Qqgv0cGSOULgquLYbly0MVSrR2xIoEphohO4jLLj3Uzo7s7qWQ08V2pCqUrxFiNHRzLTDM3Pb-hX6kTtJIDDtjS_CoztTvWbxvuwjMSTqmrEyVt9BoKRfMjA2CERuk8L-kBuyrpekQCs1OdkMKU7ZVCB8NtutElK66W1DcoPhlYIbhN5dNoo2UcKiL73VEuse7XWyZHOM47CaQO3qWJV1o9q2N7AqO9ytOGf8yHWOaw4hwXfsXvjQlUY_9magkPJtHOz_3R67tryE--nv_wHEXXHI7S4A3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E-BPofO-II_VYz-aJJ8j7FPShRuUwgUN0XwEI4cviFtj6HQCTywK5r8izPZoi7cNN2Adl8eEq-HNtKQwhZayYhfs0IMpGXNYs9jipmecu15uCV4p_ocuimtSyn48PzMNGEAWYI3e8Mezlpjz_HA68iIy-N8PHcHCqji09j95imhD7OC0nXfwa3_QlXcVs3RblonZ0PlWyoUNAHZ9hBBzrOkOuNH5H5KECgVUliacmeQ63rvQPrfY_9w2XWy8rQAbrsLM86qfXjY0cyv31aSBEZ1pxsYeF-CRzJeAI6ggWH0cYBeYLJsLZN7sdtKOpHSB5HTGG0EAsqifmie5XTffvRCTc1lNX4XsE_AbLDo6Z63A1HpGhGbwxDL7w-RwPm9t4vuA5ztspow6TnuV6pU7VXDjfQz2Z447bMZaWNzYYumVf_TPzSzpN7oIpVzLToYTOpyIH2a1ZIMD2wrw-QazK4MiMtcR5ag_5KGZF1y5ra20AhgcbPYPSFPwhs= |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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.