Skip to content

amcooper181/OSU-361-Assignment-9

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Alpaca Trading Microservice Communication

The README guidelines below contains instructions for programmatically requesting and receiving data from the microservice.

Requesting Data

To request data from the Alpaca Microservice, you can use the provided Python functions in the alpaca_trading.py file.

from alpaca_trading import place_order

api_key = ""
secret_key = ""
symbol = "AAPL"  # example stock
quantity = 10    # example quantity
side = "buy"     # 'buy' or 'sell' based on your trade type

result = place_order(api_key, secret_key, symbol, quantity, side)
print("Response:")
print(result)

Receiving Data

The Alpaca Microservice provides functions to retrieve open positions, open orders, and more alpaca_trading.py file.

from alpaca_trading import get_account_positions

api_key = ""
secret_key = ""

result = get_account_positions(api_key, secret_key)
print("Account Positions:")
print(result)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%