Harvest is a Python based framework providing a simple and intuitive framework for algorithmic trading. Visit Harvest's website for details, tutorials, and documentation.
⚠️WARNING⚠️ Harvest is currently at v0.1.1. The program is unstable and cointains many bugs. Use with caution, and contributions are greatly appreciated.
Example
Below is a minimal example of a crossover strategy for TWTR implemented with Harvest, tested on historical stock prices.
from harvest.algo import *
from harvest.trader import *
from harvest.api import *
class Watch(algo.BaseAlgo):
def main(self):
sma_long = self.sma(period=50)
sma_short = self.sma(period=20)
if self.crossover(sma_long, sma_short):
self.buy()
elif self.crossover(sma_short, sma_long):
self.sell()
if __name__ == "__main__":
t = tester.BackTester()
t.set_symbol('TWTR')
t.set_algo(Watch())
t.start()
If you want to see how this algorithm performs in real life, just change one line to enable paper trading:
- t = tester.BackTester()
+ t = trader.Trader()
Confident in your strategy? Deploy it using a broker of your choice (Currently only supports Robinhood). Again, you just need to change one line:
- t = trader.Trader()
+ t = trader.Trader(robinhood.Robinhood())
With Harvest, the process of testing, simulating, and deploying your strategies is a piece of cake 🍰
Installation
There are few prerequisites:
- Python 3.8+
- pip
Once you have them, install via pip:
pip install harvest-algo
Next, install the dependencies necessary for the brokerage of your choice:
pip install harvest-algo[BROKER]
Replace BROKER with a brokerage/data source of your choice:
- Robinhood
- Alpaca (Coming soon)
- Polygon (Coming soon)
Now you're all set!
Contributing
Contributions are greatly appreciated. Check out the CONTRIBUTING document for details.
Disclaimer
- Harvest is not officially associated with Robinhood LLC.
- Robinhood was also not designed to be used for algo-trading. Excessive access to their API can result in your account getting locked.
- Tutorials and documentation solely exist to provide technical references of the code. They are not recommendations of any specific securities or strategies.
- Use Harvest at your own responsibility. Developers of Harvest take no responsibility for any financial losses you incur by using Harvest.
Metadata
Release files for harvest-algo 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| harvest-algo-0.1.3.tar.gz | 34.8 kB | Without provenance | Details for harvest-algo-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| harvest_algo-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for harvest_algo-0.1.3-py3-none-any.whl |
Total release size: 78.0 kB
Release files / harvest-algo-0.1.3.tar.gz
| Download URL | harvest-algo-0.1.3.tar.gz |
|---|---|
| Size | 34.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a36c27869cab37ab5f72b4294b246cc5f196be8417b97fffb0bcf3a9120e64a
|
|
BLAKE2b-256 checksum How to use checksums |
f25b7e2a389926c998b454a0cfeff0c7a565c11dca409b6e935fc17d35815055
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Release files / harvest_algo-0.1.3-py3-none-any.whl
| Download URL | harvest_algo-0.1.3-py3-none-any.whl |
|---|---|
| Size | 43.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
921bd5611060e060123d027542b537ad075025755f9b7c5ecd0d370cdd83e430
|
|
BLAKE2b-256 checksum How to use checksums |
8ac9486ac2a5085d8aec92fe2ce8381b03dc3b7be96c5bb48dc693895b73fccf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|
Security for harvest-algo 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.