Skip to content
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

Update master #282

Merged
merged 253 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 78 commits
Commits
Show all changes
253 commits
Select commit Hold shift + click to select a range
73a8ca9
Revert "Updated .gitignore"
TrainedPro Aug 14, 2023
be57f1f
Revert "Updated alpaca_data.py To Work The Same As Other Brokers"
TrainedPro Aug 14, 2023
465f740
Update Alpaca To Work Like Other Brokers And The .gitignore
TrainedPro Aug 14, 2023
9c7604d
Merge pull request #272 from Infotab-Enterprises/alpaca_patch
grzesir Aug 15, 2023
0509cd0
better docs
grzesir Aug 15, 2023
7c80ada
Merge branch 'dev' of https://github.com/Lumiwealth/lumibot into dev
grzesir Aug 15, 2023
fa3a057
Backtest: Polygion.io “Official” Library | RESTClient Fixes #270
robertmacleod Aug 15, 2023
739bb6e
version bump and alpaca_trade_api bug fix on install
grzesir Aug 15, 2023
6ac545f
forex bug fix
grzesir Aug 16, 2023
2a0e62f
updated setup.py. new alpaca-trade-api 3.0.0+ is causing bugs
grzesir Aug 16, 2023
3e95cbc
Polygon.io backtest integration working with a full backtest run. Sec…
davidlatte Aug 18, 2023
c9ad22d
Merge branch 'dev' into RobertMacLeodLatte/issue270
davidlatte Aug 18, 2023
dce5a3a
cleaned up example strategies
grzesir Aug 18, 2023
0996d13
Polygon.io backtest get_chains() updated to work with BackTest Dates.
davidlatte Aug 18, 2023
fbc654b
Merge branch 'RobertMacLeodLatte/issue270' of https://github.com/Lumi…
davidlatte Aug 18, 2023
24bafcf
Full Polygon backtesting enabled with a more unittest friendly functi…
davidlatte Aug 21, 2023
cabf47d
Disabling failing unit tests to get the suite to a Known Good state.
davidlatte Aug 21, 2023
a2d72c9
Merge pull request #274 from Lumiwealth/RobertMacLeodLatte/issue270
grzesir Aug 22, 2023
f237432
bug fix backtesting stop orders and before market opens
grzesir Aug 22, 2023
9fae922
Merge branch 'dev' of https://github.com/Lumiwealth/lumibot into dev
grzesir Aug 22, 2023
620873f
upgrade quantstats and pandas to latest versions
grzesir Aug 22, 2023
2c5274d
updated requirements
grzesir Aug 22, 2023
d2a33a9
added contributors section to readme
grzesir Aug 22, 2023
0d36f06
format fix
grzesir Aug 22, 2023
66a5b60
added code coverage to readme
grzesir Aug 22, 2023
b794000
better docs
grzesir Aug 22, 2023
4eea9c9
Update README.md
grzesir Aug 22, 2023
aeed57f
moved example strategies + more
grzesir Aug 22, 2023
33b6378
moved example strategies and created a test for example strategies
grzesir Aug 22, 2023
724ddad
updated example strategies and the tests
grzesir Aug 22, 2023
8017846
Enabling PyTest in the GitHub CI/CD Pipeline. Ruff check is turned on…
davidlatte Aug 22, 2023
d201d54
Missed the YAML
davidlatte Aug 22, 2023
e004acc
Something in the setup is missing 'requests' package.
davidlatte Aug 22, 2023
c41b842
Update cicd.yaml
davidlatte Aug 22, 2023
d28de2f
Update cicd.yaml
davidlatte Aug 22, 2023
6bd38c6
Update cicd.yaml
davidlatte Aug 22, 2023
93b9ed3
Update to setup.py for aiohttp to get it to work with Alpaca ...
davidlatte Aug 22, 2023
66b61c3
Merge branch '275-enable-pytest-in-github-cicd-pipeline' of https://g…
davidlatte Aug 22, 2023
c64c8d4
Something weird is happening with setup.py
davidlatte Aug 22, 2023
2f2f64f
IPython setup.
davidlatte Aug 22, 2023
313c88e
added limit and trailing stop example strategy/test
grzesir Aug 22, 2023
9ba4499
added back simple start and momentum examples + yahoo bug fix
grzesir Aug 22, 2023
193bf7d
updated docs with new examples guthub url
grzesir Aug 22, 2023
3c9dcfd
Update cicd.yaml
davidlatte Aug 22, 2023
7ac828a
Update cicd.yaml
davidlatte Aug 22, 2023
f25e5bf
Cleanup now that the Pipeline is passing!
davidlatte Aug 22, 2023
67d72fa
Update setup.py
davidlatte Aug 22, 2023
d50e11b
Restoring requirements.txt
davidlatte Aug 22, 2023
5940443
Merge branch '275-enable-pytest-in-github-cicd-pipeline' of https://g…
davidlatte Aug 22, 2023
47de53e
Update cicd.yaml
davidlatte Aug 22, 2023
f006215
removed cancelled orders from the orders chart
grzesir Aug 22, 2023
6d5c856
Fixing backtesting error where an Order Transaction is using a mix of…
davidlatte Aug 25, 2023
adffbac
Merge branch '275-enable-pytest-in-github-cicd-pipeline' of https://g…
davidlatte Aug 25, 2023
a30c619
Unit test fix for rounding error.
davidlatte Aug 26, 2023
2874b49
Merge branch 'dev' into 275-enable-pytest-in-github-cicd-pipeline
davidlatte Aug 26, 2023
2dcf2e2
Update test_example_strategies.py
davidlatte Aug 26, 2023
71162c8
Eliminating even more rounding error.
davidlatte Aug 26, 2023
bf0629d
cleanup
grzesir Aug 28, 2023
2ffc861
Lumibot was missing code to handle on_new_order() LifeCycle method.
davidlatte Aug 29, 2023
5a24da8
Update test_example_strategies.py
davidlatte Aug 30, 2023
4e5854f
Merge pull request #276 from Lumiwealth/275-enable-pytest-in-github-c…
grzesir Aug 30, 2023
f93f9ce
Merge pull request #277 from Lumiwealth/on_submit_in_backtest
grzesir Aug 30, 2023
d22b49d
Backtesting updated to provide a more accurate fill price for market,…
davidlatte Aug 30, 2023
dbe1d21
Pandas 2.1.0 broke pandas_market_calendars. Waiting for a fix.
davidlatte Aug 30, 2023
2dc1f3d
bug fix for get_option_expiration_after_date method
grzesir Aug 31, 2023
a7f54fb
bug fixes
grzesir Aug 31, 2023
4870b06
fixed polygon data retrieval bug
grzesir Sep 5, 2023
c802fc8
version bump
grzesir Sep 5, 2023
912b72c
Code Review updates.
davidlatte Sep 5, 2023
ed07aa9
Merge pull request #279 from Lumiwealth/278-fill-prices-in-backtest-c…
grzesir Sep 5, 2023
f809ce5
fixed trailing stops and improved tests for limits and trailing stops
grzesir Sep 5, 2023
a9583eb
fixed suggested changes
grzesir Sep 5, 2023
bd39c22
Merge pull request #281 from Lumiwealth/trailing_stops
grzesir Sep 5, 2023
7421b85
version bump
grzesir Sep 5, 2023
d9a72cb
Create CODEOWNERS
grzesir Sep 5, 2023
b0ac924
pandas_market_calendars bug fix
grzesir Sep 6, 2023
5a1819d
Update setup.py
grzesir Sep 6, 2023
f1a51fd
removed increment_version from setup.py
grzesir Sep 6, 2023
7c8477d
added comment
grzesir Sep 6, 2023
4cc3ec5
Switched to the new alpaca-py library
grzesir Sep 6, 2023
d124f6d
cleanup
grzesir Sep 6, 2023
28689cf
version bump
grzesir Sep 6, 2023
8f07642
removed patchwork code for aiohttp
grzesir Sep 6, 2023
304dc2a
removed the logs for the order status lifecycle methods because they …
grzesir Sep 7, 2023
a811b96
version bump apscheduler
grzesir Sep 7, 2023
443cb73
Update requirements.txt
grzesir Sep 7, 2023
d44f5fc
unit test bug fixes
grzesir Sep 7, 2023
e4cecc7
fixes based on github comments
grzesir Sep 7, 2023
4a17620
style change
grzesir Sep 7, 2023
94ad541
bug fix and version bump
grzesir Sep 7, 2023
bc32fe3
Merge pull request #284 from Lumiwealth/alpaca_v3
grzesir Sep 7, 2023
9f1f844
Refactored get_price_from_polygon() completely to be more efficient a…
davidlatte Sep 8, 2023
0ede6c0
Merge branch 'dev' into 285-polygon-issue-with-historical-option-data
davidlatte Sep 8, 2023
bf37a88
Updated docstrings and cleaned up code.
davidlatte Sep 8, 2023
9e97014
Accepting AI code review feedback.
davidlatte Sep 8, 2023
95ff462
Pandas Market Calendars has now been fixed to fully work with Pandas …
davidlatte Sep 8, 2023
95f9696
polygon_helper.py updated to account for trading days missing from da…
davidlatte Sep 9, 2023
9052fae
Typo fix for dependencies
davidlatte Sep 9, 2023
2fa977a
fixed for python 3.8
grzesir Sep 11, 2023
da14eb4
added comment for polygon helper
grzesir Sep 11, 2023
6ebc341
slightly faster free polygon query
grzesir Sep 11, 2023
502fda2
Update setup.py
grzesir Sep 11, 2023
2135182
Merge pull request #286 from Lumiwealth/285-polygon-issue-with-histor…
grzesir Sep 11, 2023
d020af6
Updated caching directory to use system cache areas pointed to with t…
davidlatte Sep 11, 2023
340ad39
Merge pull request #287 from Lumiwealth/appdirs_cache_location_update
grzesir Sep 11, 2023
42a515c
Fixed backtesting options on a recent real date where the options hav…
davidlatte Sep 14, 2023
8896002
Fixing 900 Pandas warnings
davidlatte Sep 14, 2023
c186ab0
Merge pull request #289 from Lumiwealth/288-polygon-option-chains-don…
davidlatte Sep 18, 2023
b0de021
version bump for deploy
grzesir Sep 19, 2023
ac87c39
Improved Live run logging to reduce noise.
davidlatte Sep 20, 2023
cda23cf
bug fix
grzesir Sep 21, 2023
e44e4ad
removed checking for exception in test
grzesir Sep 21, 2023
ad220db
version bump
grzesir Sep 21, 2023
d64b0ea
Updated Backtest to start on the correct timestamp when start time is…
davidlatte Sep 21, 2023
d89b96c
Merge pull request #290 from Lumiwealth/bug_fix_options_data
grzesir Sep 21, 2023
75265e0
Log: Printing additional info to track down over-cancel operations.
davidlatte Sep 22, 2023
6cf572e
bug: Fixing backtest start time when user simply provides a date, but…
davidlatte Sep 24, 2023
667c943
feature: created Abstract Base Classes for DataSource and Broker and …
davidlatte Sep 25, 2023
c495bd6
code review feedback.
davidlatte Sep 26, 2023
271d64c
code review feedback.
davidlatte Sep 26, 2023
69360a6
Merge pull request #291 from Lumiwealth/ib_tweaks_and_cleanup
davidlatte Sep 26, 2023
64f473c
Merge branch 'dev' into 292-break-connection-between-data-source-and-…
davidlatte Sep 26, 2023
4610ba9
Bug: With updated Pandas, IBKR data is being returned with invalid da…
davidlatte Sep 26, 2023
cb29be8
Options data functions correctly placed for underlying Broker and Dat…
davidlatte Sep 26, 2023
2705b1c
Merge pull request #293 from Lumiwealth/ibkr_invalid_data
grzesir Sep 26, 2023
0fa3ab9
Merge branch 'dev' into 292-break-connection-between-data-source-and-…
davidlatte Sep 27, 2023
c98d86d
Base DataSource and Broker classes separated, need backtesting updates.
davidlatte Sep 28, 2023
527b15e
All non-backtest unit tests passing.
davidlatte Sep 28, 2023
cc34522
All backtests passing!
davidlatte Sep 28, 2023
d314c13
Code Review Feedback
davidlatte Sep 29, 2023
e45d273
make it so that the benchmark has a name in the tearsheet (the name o…
grzesir Oct 2, 2023
18305a6
version bump
grzesir Oct 2, 2023
da28fa9
Merge pull request #294 from Lumiwealth/292-break-connection-between-…
davidlatte Oct 2, 2023
d14a309
backtest: split of BackTestBroker and BackTestingDataSources is compl…
davidlatte Oct 2, 2023
7b10459
Docs: Updated Backtest info in the Sphinx docs
davidlatte Oct 2, 2023
2de5b65
Ensuring that polygon_api_key isn't removed yet
davidlatte Oct 3, 2023
a425d9d
Ensuring that polygon_api_key isn't removed yet
davidlatte Oct 3, 2023
6cf1fd9
Merge pull request #298 from Lumiwealth/296-update-backtest-function-…
davidlatte Oct 3, 2023
79a159d
Fixing IBKR Live Trading runs continuously re-canceling Filled and Ca…
davidlatte Oct 3, 2023
f4d9c4d
Merge pull request #299 from Lumiwealth/ibkr_fix_repeated_cancel
grzesir Oct 5, 2023
f737a2b
Merge branch 'dev' into ib_broker_dev
davidlatte Oct 5, 2023
610d8ed
Merge pull request #297 from Lumiwealth/tearsheet_with_benchmark_name
grzesir Oct 9, 2023
bb77ae5
fixed
grzesir Oct 9, 2023
33ff9a6
test fix
grzesir Oct 12, 2023
fd09b78
switch back for test to pass
grzesir Oct 12, 2023
2423b47
Merge pull request #300 from Lumiwealth/bug-fix-on-trading-iteration-…
grzesir Oct 12, 2023
0b04cb4
fixed edge case where we first get day data, then request minute data
grzesir Oct 13, 2023
9f5a759
update alpaca
grzesir Oct 14, 2023
619c10c
additional bug fix with dividing my Decimal
grzesir Oct 14, 2023
e3d2e34
removed abstract methods and added a test
grzesir Oct 16, 2023
60aa9f9
fixed a bunch of pandas 2.1.0 future warnings
grzesir Oct 16, 2023
8d1dd27
update alpaca-py
grzesir Oct 17, 2023
03cf596
Merge pull request #303 from Lumiwealth/pandas-2.1.0-future-warnings
grzesir Oct 18, 2023
2d6a5d3
Merge branch 'dev' into minute_day_timestep_fix
grzesir Oct 18, 2023
8932a27
Merge pull request #301 from Lumiwealth/minute_day_timestep_fix
grzesir Oct 18, 2023
8a5dcd5
downgraded pandas because many libraries are not yet fully compatible…
grzesir Oct 18, 2023
e627377
removed stats from the backtest result because the numbers are differ…
grzesir Oct 18, 2023
2684923
improved print statements to more accurately depict how we load data …
grzesir Oct 18, 2023
cac24fe
Merge remote-tracking branch 'origin/ib_broker_dev' into ib_broker_dev
davidlatte Oct 18, 2023
49d8c79
fixed tearsheet and trades files
grzesir Oct 18, 2023
53fc4e8
tests fix
grzesir Oct 18, 2023
02d147c
Merge branch 'dev' into ib_broker_dev
davidlatte Oct 18, 2023
bcef92f
merge dev and resolve conflicts
davidlatte Oct 18, 2023
69e0632
fixed 24/7 bugs with CCXT (it was broken!)
grzesir Oct 19, 2023
e0733c9
Merge pull request #304 from Lumiwealth/fixing-future-warnings
grzesir Oct 19, 2023
db20a0f
bug fix
grzesir Oct 19, 2023
c0c478e
Merge branch 'dev' into ccxt-bug-fixes
grzesir Oct 19, 2023
33ef87b
Merge pull request #305 from Lumiwealth/ccxt-bug-fixes
grzesir Oct 19, 2023
94059c3
Merge branch 'dev' into ib_broker_live_brokers
davidlatte Oct 19, 2023
89b8dcf
order: remove update_status() and replace it with a @property.
davidlatte Oct 19, 2023
6eca17e
strategy: updating asset_mapping and renaming to better convey its pu…
davidlatte Oct 19, 2023
5fae491
Merge pull request #306 from Lumiwealth/ib_broker_live_brokers
davidlatte Oct 19, 2023
b4a56d8
fixing bugs in the trades chart
grzesir Oct 26, 2023
083777e
version bump
grzesir Oct 26, 2023
a6ec86c
Merge pull request #307 from Lumiwealth/chart-bug-fixes
davidlatte Oct 26, 2023
a41be4e
log: updating the encoding used for logfiles to support utf-8 charact…
davidlatte Oct 27, 2023
87fc0fa
Merge pull request #308 from Lumiwealth/file_encoder_update
grzesir Oct 27, 2023
0321e24
updated alpaca-py
grzesir Oct 27, 2023
64ef560
Merge pull request #309 from Lumiwealth/new-alpaca-py
grzesir Oct 27, 2023
0931291
added cash and portfolio value to progress bar
grzesir Oct 30, 2023
46766d2
using logging instead of print
grzesir Oct 30, 2023
415007b
Merge pull request #310 from Lumiwealth/better-progress-bar
davidlatte Oct 30, 2023
49ae192
Merge branch 'dev' into ib_broker_dev
davidlatte Oct 30, 2023
0c3654d
Alpaca and Interactive Brokers working with instantiating a "live" st…
davidlatte Oct 31, 2023
c4c4236
fixed oco orders and issue with yahoo finance .info
grzesir Nov 2, 2023
5e8c126
update wording
grzesir Nov 2, 2023
71e191a
name change again
grzesir Nov 2, 2023
19e8c15
bug fix
grzesir Nov 2, 2023
0cb59c7
alpaca: updated broker parameter from "paper" to "is_paper" and updat…
davidlatte Nov 2, 2023
418c582
Merge branch 'ib_broker_dev_live_datasource' of https://github.com/Lu…
davidlatte Nov 2, 2023
9e9b188
bug fix when cant get bars from alpaca
grzesir Nov 2, 2023
feed0f9
merge error fix
davidlatte Nov 2, 2023
60e394b
deleting unused tradovate.py from brokers
davidlatte Nov 2, 2023
27bf7bf
interactive broker updates to fully work with a live trading run.
davidlatte Nov 2, 2023
c6eaccd
fixed a bug where strategies with a sleeptime of 1D would never run d…
grzesir Nov 2, 2023
62e0d35
format change
grzesir Nov 2, 2023
8f92d06
removed sharpe from tests because interest rates change from day to day
grzesir Nov 2, 2023
b3bdc27
added back info in case the yfinance library fixes it
grzesir Nov 2, 2023
6d7f741
Merge pull request #312 from Lumiwealth/bug-fixes
grzesir Nov 2, 2023
76aa86a
Merge branch 'dev' into day-strategy-start-bug-fix
grzesir Nov 2, 2023
437e2c3
Merge pull request #313 from Lumiwealth/day-strategy-start-bug-fix
grzesir Nov 2, 2023
f4178f5
added example secrets
grzesir Nov 2, 2023
e362e82
backtest update to test some additional inputs
davidlatte Nov 2, 2023
b51b2d8
Merge branch 'ib_broker_dev_live_datasource' of https://github.com/Lu…
davidlatte Nov 2, 2023
8e58da0
ccxt: unit test passing with mocking web calls to the broker.
davidlatte Nov 2, 2023
f376f49
Merge pull request #311 from Lumiwealth/ib_broker_dev_live_datasource
davidlatte Nov 2, 2023
d001097
Merge branch 'dev' into ib_broker_dev_pull_dev_updates
davidlatte Nov 2, 2023
db7038b
greeks: fixed a bug with getting greeks during backtest.
davidlatte Nov 3, 2023
c43b5f1
pandas: fixed warning in yahoo_helper.py
davidlatte Nov 3, 2023
7fd4193
Merge pull request #314 from Lumiwealth/ib_broker_dev_pull_dev_updates
grzesir Nov 3, 2023
da0c502
Merge pull request #302 from Lumiwealth/ib_broker_dev
davidlatte Nov 3, 2023
ac30a67
changed the wording for polygon rate limit because people are getting…
grzesir Nov 3, 2023
72ae0df
Merge pull request #315 from Lumiwealth/new-wording
grzesir Nov 3, 2023
0dbeb4f
pandas: fixed warning in yahoo_helper.py
davidlatte Nov 4, 2023
fd8835d
fixed bug when getting the fill prices for thinly traded assets (eg. …
grzesir Nov 6, 2023
eb48ffa
alpaca: updated timeframes to account for "10 minutes" values in the …
davidlatte Nov 6, 2023
c301117
docstring: updates for wider candle specification
davidlatte Nov 7, 2023
c07c95d
Merge pull request #316 from Lumiwealth/backtest_multi_min_timestep
grzesir Nov 7, 2023
ec2b35f
test fix
grzesir Nov 8, 2023
c7dba31
Merge pull request #317 from Lumiwealth/bug-fix-with-backtesting-prices
grzesir Nov 8, 2023
10a5e05
version bump
grzesir Nov 8, 2023
7c54d51
Merge pull request #318 from Lumiwealth/version-bump
davidlatte Nov 8, 2023
8605ccc
polygon aggregated bars bug fix
grzesir Nov 9, 2023
ac3a155
fixed regex
grzesir Nov 9, 2023
b8c7552
Merge pull request #319 from Lumiwealth/polygon-bug-fix
davidlatte Nov 9, 2023
414c798
bug fix when mixing minute and day timeframes with polygon
grzesir Nov 9, 2023
c2df3af
version bump
grzesir Nov 9, 2023
f08f7d6
log fix
grzesir Nov 9, 2023
536c4c9
removing commented code
grzesir Nov 9, 2023
d6f7952
Merge pull request #320 from Lumiwealth/polygon-bug-fix
grzesir Nov 9, 2023
15dac06
save
grzesir Nov 16, 2023
fa2b21d
allow fractional shares for stocks
grzesir Nov 16, 2023
ed061db
Merge pull request #321 from Lumiwealth/fractional-shares-for-stocks
grzesir Nov 18, 2023
628e510
bug fixes in yahoo finance when it cant find a symbol
grzesir Nov 19, 2023
58b8962
bug fix for yahoo get last price (it was getting the price from the d…
grzesir Nov 19, 2023
f420d34
formatting
grzesir Nov 19, 2023
1e53517
fixed tests
grzesir Nov 19, 2023
fc0ed9f
Merge pull request #323 from Lumiwealth/yahoo-last-price-fix
davidlatte Nov 20, 2023
4a79e75
removed "currency" from asset - this should be in order instead. also…
grzesir Nov 23, 2023
5fa1389
tradier: new broker and data_source skeleton code added along with in…
davidlatte Nov 28, 2023
e11cbae
Merge pull request #324 from Lumiwealth/remove-asset-and-bug-fixes
davidlatte Nov 28, 2023
1d7d0b1
Merge pull request #325 from Lumiwealth/tradier_initial_creation
grzesir Nov 28, 2023
79b2425
Adde d cash settlement to trades chart
grzesir Dec 1, 2023
c44eaef
Merge branch 'dev' into options-cash-settle
grzesir Dec 1, 2023
1de34ff
fixed test
grzesir Dec 1, 2023
e50c20a
version bump
grzesir Dec 1, 2023
2b67bd4
refactor changes
grzesir Dec 1, 2023
2fe3914
Merge pull request #326 from Lumiwealth/options-cash-settle
grzesir Dec 1, 2023
bc82c0d
bug fix when sleeptime is > 2 anything. it should start right away wh…
grzesir Dec 1, 2023
58d1511
Merge pull request #327 from Lumiwealth/scheduler-bug
davidlatte Dec 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These owners will be the default owners for everything in

# the repo. Unless a later match takes precedence

# @grzesir will be requested for

# review when someone opens a pull request

* @grzesir
33 changes: 33 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: LumiBot CI/CD
on: [push]
jobs:
LintAndTest:
runs-on: ubuntu-latest
environment: unit-tests
env:
AIOHTTP_NO_EXTENSIONS: 1
POLYGON_API_KEY: ${{secrets.POLYGON_API_KEY}} # Required for Polygon API BackTests
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: pip
- name: Install dependencies
run: |
echo "Set AIOHTTP_NO_EXTENSIONS=$AIOHTTP_NO_EXTENSIONS so that aiohttp doesn't try to install C extensions"
python -m pip install --upgrade pip
pip install requests
pip install -r requirements_dev.txt
# Setup.py was not working for some reason, reverted to using requirements.txt again
# python setup.py install
- name: Run Linter
run: |
# Remove -e flag to fail the run if issues are found
ruff check . -e
- name: Run Unit Tests
run: |
coverage run
coverage report
coverage html
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ lumibot/cache

# Development files
venv
.venv
logs
credentials.py
*debug.py
Expand All @@ -20,6 +21,7 @@ todos.txt
test_bot.py
.vscode
.coverage*
*secret*

# Pypi deployment
build
Expand Down
74 changes: 68 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,81 @@
# Lumibot - Algorithmic Trading Library

Backtesting and trading for stocks, options, crypto, futures and more!

# Documentation
## Documentation - 👇 Start Here 👇

To get started with Lumibot, you can check out our documentation below.

**Check out the documentation for the project here: <http://lumibot.lumiwealth.com/>**
**Check out the documentation for the project here: 👉 <http://lumibot.lumiwealth.com/> 👈**

## Contributors

If you want to contribute to Lumibot, you can check how to get started below. We are always looking for contributors to help us out!

**Steps to contribute:**

# Running Tests
1. Clone the repository to your local machine
2. Create a new branch for your feature
3. Run `pip install -r requirements_dev.txt` to install the developer dependencies
4. Install all the requriements from setup.py: `pip install -e .`
5. Make your changes
6. Run `pytest` to make sure all the tests pass
7. Create a pull request to merge your branch into master

## Running Tests

We use pytest for our testing framework. To run the tests, you can run the following command:

```bash
pytest
```

### Showing Code Coverage

To show code coverage, you can run the following command:

```bash
coverage run; coverage report; coverage html
```

#### Adding an Alias on Linux or MacOS

This will show you the code coverage in the terminal and also create a folder called "htmlcov" which will have a file called "index.html". You can open this file in your browser to see the code coverage in a more readable format.

If you don't want to keep typing out the command, you can add it as an alias in bash. To do this, you can run the following command:

```bash
alias cover='coverage run; coverage report; coverage html'
```

This will now allow you to run the command by just typing "cover" in the terminal.

```bash
cover
```

If you want to also add it to your .bashrc file. You can do this by running the following command:

```bash
echo "alias cover='coverage run; coverage report; coverage html'" >> ~/.bashrc
```

#### Adding an Alias on Windows

If you are on Windows, you can add an alias by running the following command:

Add to your PowerShell Profile: (profile.ps1)

```powershell
function cover {
coverage run
coverage report
coverage html
}
```

### Setting Up PyTest in VS Code

To set up in VS Code for debugging, you can add the following to your launch.json file under "configurations". This will allow you to go into "Run and Debug" and run the tests from there, with breakpoints and everything.

NOTE: You may need to change args to the path of your tests folder.
Expand Down Expand Up @@ -51,13 +113,13 @@ Here's an example of an actual launch.json file:
}
```

# Community
## Community

If you want to learn more about Lumibot or Algorithmic Trading then you will love out communities! You can join us on Discord.

**Join us on Discord: <https://discord.gg/TmMsJCKY3T>**

# Courses
## Courses

If you need extra help building your algorithm, we have courses to help you out.

Expand All @@ -67,6 +129,6 @@ If you need extra help building your algorithm, we have courses to help you out.

**For our Options Trading course: <https://www.lumiwealth.com/product-category/options-trading-purchase/>**

# License
## License

This library is covered by the MIT license for open sourced software which can be found here: <https://github.com/Lumiwealth/lumibot/blob/master/LICENSE>
5 changes: 4 additions & 1 deletion docsrc/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Here it is all together:
trader.add_strategy(strategy)
trader.run_all()

Or you can download the file here: https://github.com/Lumiwealth/lumibot/blob/master/example_strategies/simple_start_single_file.py
Or you can download the file here: https://github.com/Lumiwealth/lumibot/blob/dev/lumibot/example_strategies/simple_start_single_file.py


Adding Trading Fees
Expand All @@ -177,6 +177,9 @@ If you want to add trading fees to your backtesting, you can do so by setting up

.. code-block:: python

from lumibot.backtesting import YahooDataBacktesting
from lumibot.entities import TradingFee

# Create two trading fees, one that is a percentage and one that is a flat fee
trading_fee_1 = TradingFee(flat_fee=5) # $5 flat fee
trading_fee_2 = TradingFee(percent_fee=0.01) # 1% trading fee
Expand Down
2 changes: 1 addition & 1 deletion docsrc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ And that's it! Easy-peasy.

If you would like to learn how to modify your strategies we suggest that you first learn about Lifecycle Methods, then Strategy Methods and Strategy Properties. You can find the documentation for these in the menu, with the main pages describing what they are, then the sub-pages describing each method and property individually.

We also have some more sample code that you can check out here: https://github.com/Lumiwealth/lumibot/tree/master/getting_started
We also have some more sample code that you can check out here: https://github.com/Lumiwealth/lumibot/tree/dev/lumibot/example_strategies

We wish you good luck with your trading strategies, don't forget us when you're swimming in cash!

Expand Down
22 changes: 0 additions & 22 deletions example_strategies/credentials.example.py

This file was deleted.

Loading