Python bracket order for alpaca order api
- Python 3.6 or higher
- AWS Chalice
- TradingView PRO
app.py Edit the limit_price and stop_price variabes to set a gain/loss limit for orders (ex. below 5% gain, and 2% stop loss)
"take_profit": {
"limit_price": webhook_message['close'] * 1.05
},
"stop_loss": {
"stop_price": webhook_message['close'] * 0.98,
}
TradingView Alert JSON BODY
{
"open": {{open}},
"high": {{high}},
"low": {{low}},
"close": {{close}},
"exchange": "{{exchange}}",
"ticker": "{{ticker}}",
"volume": {{volume}},
"time": "{{time}}",
"timenow": "{{timenow}}"
}
👤 Jason Alloway
- Website: www.linkedin.com/in/jasonalloway
- Github: @jasona7
PLZ give a ⭐️ if this code was helpful!
This README was generated with ❤️ by readme-md-generator