This tutorial is a step by step demonstration on how to place a Bracket order and is part of the Alpaca 101 Tutorial Series. We will move forward assuming that you’ve registered on the Alpaca website. If you haven’t please visit Alpaca and sign up. Feel free to check out the other tutorials in this series at Alpaca Resources.
The Alpaca API can be used through various languages. This tutorial will be conducted using Visual Studio Code as the IDE and python as the programming language.
Sign into your account at Alpaca and go to your trading account. In order to connect your algorithm to the Alpaca trading account, you will need API keys. Each account is issued its own API keys and these can be viewed in your overview page, as shown in the gif below.
The code below (exclusively for python) can be used to connect your algorithm to your trading account. Remember to input your “API key” and the “secret API key” in the algorithm.
Commission-Free trading means that there are no commission charges for Alpaca self-directed individual cash brokerage accounts that trade U.S. listed securities through an API. Relevant SEC and FINRA fees may apply.
Brokerage services are provided by Alpaca Securities LLC ("Alpaca"), memberFINRA/SIPC, a wholly-owned subsidiary of AlpacaDB, Inc. Technology and services are offered by AlpacaDB, Inc.