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-noahxl10-0.0.2.tar.gz (2.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: TradingAlgorithm-noahxl10-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-noahxl10-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8d079b161817b10a747686c7b63b063057d76153be3578c99d38879a4e9ef143
MD5 d0bd887449705a71f4387ab0f9717f8c
BLAKE2b-256 d05745a43faf6126edc94a8a1cfd5e74f7e5dbd1f3d9ad0e2bf263d546ba183f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: TradingAlgorithm_noahxl10-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.2 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_noahxl10-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 08bf92afff2c5a73cf03be6400069561c6d22387b2ca6dc899811eb61964cdce
MD5 bd01ddd03e8076b678d0668886e94570
BLAKE2b-256 11dda7f984c14b2d6de62d3f990f889884e25cec7833a4eebf711d48202763cd

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