# Alpaca-py examples

**URL:** <https://forum.alpaca.markets/t/alpaca-py-examples/10557>\
**Category:** Alpaca Trading\
**Created:** [September 8, 2022, 10:19pm UTC](https://forum.alpaca.markets/t/alpaca-py-examples/10557 "2022-09-08T22:19:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![phellstrand](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/phellstrand/32/4169_2.png) [@phellstrand](https://forum.alpaca.markets/u/phellstrand)\
**Post date:** [April 11, 2023, 2:00am UTC](https://forum.alpaca.markets/t/alpaca-py-examples/10557/4 "2023-04-11T02:00:32Z")

</div>

I figured it out, and getting more comfortable with the syntax

> [@Bracket Order Code Example with alpaca-py Library](https://forum.alpaca.markets/t/bracket-order-code-example-with-alpaca-py-library/12110):
>
> I struggled to find adequate documentation on bracket orders with the new and updated alpaca-py library, so I figured I’d post the below example for someone struggling to find an example in the future. Imports from alpaca.trading.client import TradingClient from alpaca.trading.requests import MarketOrderRequest, TakeProfitRequest, StopLossRequest from alpaca.trading.enums import OrderSide, TimeInForce, QueryOrderStatus, OrderClass Keys API\_KEY = "\<YOUR KEY\>" SECRET\_KEY = "\<YOUR SECRET\>" Va…

---

_[View the full topic](https://forum.alpaca.markets/t/alpaca-py-examples/10557)._
