Skip to main content

A package to trade for you!

Project description

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)

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

TradingAlgorithm-0.0.2.tar.gz (2.2 kB view details)

Uploaded Source

Built Distributions

tradingalgorithm-0.0.2-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

TradingAlgorithm-0.0.2-py3-none-any.whl (2.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TradingAlgorithm-0.0.2.tar.gz
  • Upload date:
  • Size: 2.2 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for TradingAlgorithm-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5d1f9cd67dc47f014a42f3751ad9901c781bd39e18d809df9a537a3e6f50b2ac
MD5 789fef4eb9149d439c0d634f7400d452
BLAKE2b-256 110ec91df8a850031e8818898c0806c62bec3c6a5ac981c4eb1b4c573f72d101

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tradingalgorithm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for tradingalgorithm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8bc7807d0b301f03a04a1e1242fbbfc63f4500c03476504be03f08b652ab5824
MD5 4971a2d091f0c94881562596782ba6de
BLAKE2b-256 966e4678ff46d3da4e494d2939b3a13937734a8374af0c363f7b8e09d65da568

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TradingAlgorithm-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.1 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for TradingAlgorithm-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ebdfe6f9682b60c16c15e6a0cb9817371fe2c766addd06fc1a04bd196095347
MD5 871efd101d4cdd7843ee853b932e1e01
BLAKE2b-256 d18c10cdac2baaf11e6c6e1625f4320ce9875bb92ddc1c060dd0a6c544be9f4c

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