Skip to main content

Modded version of Lumiwealth library

Project description

Lumibot - A Backtesting and Trading Library for Stocks, Options, Crypto, Futures, FOREX and More!

Lumibot is a backtesting and trading library for stocks, options, crypto, futures and more. It is made so that the same code you use for backtesting can be used for live trading, making it easy to transition from backtesting to live trading. Lumibot is a highly flexible library that allows you to create your own strategies and indicators, and backtest them on historical data. It is also highly optimized for speed, so you can backtest your strategies quickly and efficiently.

IMPORTANT: This library requires data for backtesting. The recommended data source is Polygon.io (a free tier is available too). Please click the link to give us credit for the sale, it helps support this project. You can use the coupon code 'LUMI10' for 10% off.

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/ 👈

Blog

Our blog has lots of example strategies and shows you how to run a bot using LumiBot. Check the blog out here:

https://lumiwealth.com/blog/

Run a backtest

To run a backtest, you can use the following code snippet:

python -m lumibot.example_strategies.stock_buy_and_hold

Run an Example Strategy

We made a small example strategy to show you how to use Lumibot in this GitHub repository: Example Algorithm GitHub

To run this example strategy, click on the Deploy to Render button below to deploy the strategy to Render (our recommendation). You can also run the strategy on Repl.it by clicking on the Run on Repl.it button below.

Deploy to Render

Run on Repl.it

For more information on this example strategy, you can check out the README in the example strategy repository here: Example Algorithm

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:

  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 requirements 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. Some tests require API keys to be in a .env file in the root directory. To run the tests, you can run the following command:

pytest

To run an individual test file, you can run the following command:

pytest tests/test_asset.py

Showing Code Coverage

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

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:

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

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

cover

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

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)

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.

{
    "name": "Python: Pytest",
    "type": "python",
    "request": "launch",
    "module": "pytest",
    "args": [
        "lumibot/tests"
    ],
    "console": "integratedTerminal",
}

Here's an example of an actual launch.json file:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Pytest",
            "type": "python",
            "request": "launch",
            "module": "pytest",
            "args": [
                "lumibot/tests"
            ],
            "console": "integratedTerminal",
        }
    ]
}

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

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

For our Algorithmic Trading course: https://lumiwealth.com/algorithmic-trading-landing-page

For our Machine Learning for Trading course: https://www.lumiwealth.com/product-category/machine-learning-purchase/

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lumibot_jpmod-0.0.2.tar.gz (269.0 kB view details)

Uploaded Source

Built Distribution

lumibot_jpmod-0.0.2-py3-none-any.whl (575.0 kB view details)

Uploaded Python 3

File details

Details for the file lumibot_jpmod-0.0.2.tar.gz.

File metadata

  • Download URL: lumibot_jpmod-0.0.2.tar.gz
  • Upload date:
  • Size: 269.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for lumibot_jpmod-0.0.2.tar.gz
Algorithm Hash digest
SHA256 3663cabd3c303b4093fe9a0da411aae44d042a491121ce32da5f2e918d847a1b
MD5 aa14b317b773219aa824034673958409
BLAKE2b-256 a711863407e0c50e4a833a9bdec53ec332a8e0d0d6f9a2d5e6263d252c7c020c

See more details on using hashes here.

File details

Details for the file lumibot_jpmod-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for lumibot_jpmod-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6435a13bdf1d8046304fae7a6371eedfba921b86a81818fdc73b7e4da24f41f2
MD5 e2027f69ac45d7ec0b766b33b6a3545e
BLAKE2b-256 6d5cc0208fa1ac224d9075078219fa232abc0dd8d9455884dc3353f90fe19f48

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page