Skip to main content

Hello, welcome to tradingalgorithm, a Python package for easy algorithmic trading on Alpaca

This package allows one to check account status, make long orders, make short orders, run a custom momentum-based algorithm, and automatically calculate the best tickers to trade in the S&P500 based off of probability of returns and betas.

To run this package, you will need an IEX Finance key, as well as an Alpaca API key

To install the algorithm:

$ pip install tradingalgorithm

To pick a stock ticker:

import tradingalgorithm

ticker = tradingalgorithm.tickerpicker()

To create a stock class:

import tradingalgorithm

ticker = 'AAPL'

aapl = tradingalgorithm.stock(alpacaKey, alpacaSecretKey, iexKey, ticker)

Methods in the class:

aapl.position()
# output: Number of shares:  
#         Market Value: 
#         Profit/Loss: 

aapl.checkhours()
# output: The market is (open or close)

Returns maximum amount of shares that you can trade of the ticker based on market value of cash portfolio

aapl.max_shares()

Takes AAPL (or chosen ticker) long at the current market price and specified share amount

aapl.longmarket(shares)

Takes AAPL (or chosen ticker) long at the current close of the stock

aapl.longlimit(shares)

Takes AAPL (or chosen ticker) short at the current market price

aapl.short(shares)

Closes entire short or long position in AAPL (or chosen ticker) based on whether you specify "long" or "short" as the typetoclose

aapl.closeposition(typetoclose)

Runs a momentum algorithm ONE TIME based on volume and time&sales, will take a stock short, long, close position, re-position, and employs a custom stop-loss

aapl.algo()

Runs the same momentum algorithm CONTINUOUSLY for the set amount of minutes

aapl.trade(minutes)

Metadata

Release files for tradingalgorithm 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tradingalgorithm 0.0.2
File Size Uploaded Provenance Actions
TradingAlgorithm-0.0.2.tar.gz 2.2 kB Without provenance Details for TradingAlgorithm-0.0.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tradingalgorithm 0.0.2
File Interpreter ABI Platform Actions
tradingalgorithm-0.0.2-py3-none-any.whl Python 3 none any Details for tradingalgorithm-0.0.2-py3-none-any.whl
TradingAlgorithm-0.0.2-py3-none-any.whl Python 3 none any Details for TradingAlgorithm-0.0.2-py3-none-any.whl

Total release size: 6.3 kB

Release files / TradingAlgorithm-0.0.2.tar.gz

Download URL TradingAlgorithm-0.0.2.tar.gz
Size 2.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5d1f9cd67dc47f014a42f3751ad9901c781bd39e18d809df9a537a3e6f50b2ac
BLAKE2b-256 checksum
How to use checksums
110ec91df8a850031e8818898c0806c62bec3c6a5ac981c4eb1b4c573f72d101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

Release files / tradingalgorithm-0.0.2-py3-none-any.whl

Download URL tradingalgorithm-0.0.2-py3-none-any.whl
Size 2.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8bc7807d0b301f03a04a1e1242fbbfc63f4500c03476504be03f08b652ab5824
BLAKE2b-256 checksum
How to use checksums
966e4678ff46d3da4e494d2939b3a13937734a8374af0c363f7b8e09d65da568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

Release files / TradingAlgorithm-0.0.2-py3-none-any.whl

Download URL TradingAlgorithm-0.0.2-py3-none-any.whl
Size 2.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ebdfe6f9682b60c16c15e6a0cb9817371fe2c766addd06fc1a04bd196095347
BLAKE2b-256 checksum
How to use checksums
d18c10cdac2baaf11e6c6e1625f4320ce9875bb92ddc1c060dd0a6c544be9f4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.7.4

Security for tradingalgorithm 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

3 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page