wahoowah
Project description
uvatradier
uvatradier
is a Python package that serves as a wrapper for the Tradier brokerage API. This package simplifies the process of making API requests, handling responses, and performing various trading and account management operations.
Features
- Account Management: Retrieve profile, balance, gain/loss, orders, and positions related to a trading account.
- Trading: Place, modify, and cancel equity and option orders.
- Market Data: Access real-time and historical market data for equities and options.
- Options Data: Retrieve options chains, strikes, and expiration dates.
Installation
To install uvatradier
, you can use pip
:
pip install uvatradier
Quick Start
To get started, you need to import the necessary classes from uvatradier
and provide your Tradier account number and authorization token.
from uvatradier import Account, Tradier, EquityOrder, OptionsOrder, OptionsData, Quotes
ACCOUNT_NUMBER = 'YOUR_ACCOUNT_NUMBER'
AUTH_TOKEN = 'YOUR_AUTH_TOKEN'
account = Account(ACCOUNT_NUMBER, AUTH_TOKEN)
tradier = Tradier(ACCOUNT_NUMBER, AUTH_TOKEN)
equity_order = EquityOrder(ACCOUNT_NUMBER, AUTH_TOKEN)
options_order = OptionsOrder(ACCOUNT_NUMBER, AUTH_TOKEN)
options_data = OptionsData(ACCOUNT_NUMBER, AUTH_TOKEN)
quotes = Quotes(ACCOUNT_NUMBER, AUTH_TOKEN)
Usage
Account Management
-
Get User Profile:
user_profile = account.get_user_profile()
-
Get Account Balance:
account_balance = account.get_account_balance()
-
Get Gain/Loss:
gain_loss = account.get_gainloss()
-
Get Orders:
orders = account.get_orders()
-
Get Positions:
positions = account.get_positions()
Trading
-
Place Equity Order:
order_response = equity_order.place_order('AAPL', 'buy', 1, 'limit', 150)
-
Place Options Order:
order_response = options_order.place_order('AAPL210917C00125000', 'buy_to_open', 1, 'limit', 3.5)
Market Data
-
Get Quotes:
quotes_data = quotes.get_quote_day('AAPL')
-
Get Historical Quotes:
historical_data = quotes.get_historical_quotes('AAPL')
-
Get Time Sales:
timesales = quotes.get_timesales('AAPL')
Options Data
-
Get Options Chains:
options_chains = options_data.get_options_chain('AAPL')
-
Get Options Strikes:
options_strikes = options_data.get_options_strikes('AAPL')
-
Get Options Expirations:
options_expirations = options_data.get_options_expirations('AAPL')
Development
To contribute or make changes to the uvatradier
package, clone the repository, create a virtual environment, and install the dependencies:
git clone https://github.com/YOUR_USERNAME/uvatradier.git
cd uvatradier
python -m venv venv
source venv/bin/activate # On Windows, use venv\Scripts\activate
pip install -r requirements.txt
License
uvatradier
is licensed under the Apache License 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for uvatradier-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e8208e3237e1fe0e1fedbff775a88e6f155ec3130eaa7eb1ba3136e1fe135fb |
|
MD5 | c2f6471729d7a49841491b6020b16c56 |
|
BLAKE2b-256 | 48504ba093e580afa51ecfc28bd1c28bdddafabbb3cfcff0b50716a303228965 |