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.
$ pip install alpaca-trading-algorithm
from alpaca_trading_algorithm import tickerpicker
ticker = tickerpicker.tickerpicker()
from alpaca_trading_algorithm import trader
ticker = 'AAPL'
aapl = trader.stock(alpacaKey, alpacaSecretKey, iexKey, ticker)
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()
aapl.longmarket(shares)
aapl.longlimit(shares)
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()
aapl.trade(minutes)