Skip to content

Instantly share code, notes, and snippets.

@cameronShadmehry
Created July 21, 2021 22:47
Show Gist options
  • Save cameronShadmehry/65d60e476b2609493027572641414ff0 to your computer and use it in GitHub Desktop.
Save cameronShadmehry/65d60e476b2609493027572641414ff0 to your computer and use it in GitHub Desktop.
Alpaca Code
import alpaca_trade_api as tradeapi
api = tradeapi.REST(
'your_api_key_here',
'https://paper-api.alpaca.markets', api_version='v2'
# Submit a market order to buy 1 share of Apple at market price
api.submit_order(
symbol='AAPL',
qty=1,
side='buy',
type='market',
time_in_force='gtc'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment