alpaca-trading-algorithm-0.0.5
توضیحات
A package to trade for you!
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | alpaca-trading-algorithm-0.0.5 |
| نام | alpaca-trading-algorithm |
| نسخه کتابخانه | 0.0.5 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Noah Alex |
| ایمیل نویسنده | noahxl10@gmail.com |
| آدرس صفحه اصلی | https://github.com/noahxl10/trade-algo |
| آدرس اینترنتی | https://pypi.org/project/alpaca-trading-algorithm/ |
| مجوز | - |
# 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 alpaca-trading-algorithm
```
## To pick a stock ticker:
```
from alpaca_trading_algorithm import tickerpicker
ticker = tickerpicker.tickerpicker()
```
## To create a stock class:
```
from alpaca_trading_algorithm import trader
ticker = 'AAPL'
aapl = trader.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)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.1 | Python |
نحوه نصب
نصب پکیج whl alpaca-trading-algorithm-0.0.5:
pip install alpaca-trading-algorithm-0.0.5.whl
نصب پکیج tar.gz alpaca-trading-algorithm-0.0.5:
pip install alpaca-trading-algorithm-0.0.5.tar.gz