Created
July 21, 2021 22:47
-
-
Save cameronShadmehry/65d60e476b2609493027572641414ff0 to your computer and use it in GitHub Desktop.
Alpaca Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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