Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mousazourob/pytrader
Automatic trading bot that uses market data to buy or sell stocks (back-end for Falcon)
https://github.com/mousazourob/pytrader
alpaca-api aws-chalice aws-lambda json python tradingview-webhook-api
Last synced: 3 days ago
JSON representation
Automatic trading bot that uses market data to buy or sell stocks (back-end for Falcon)
- Host: GitHub
- URL: https://github.com/mousazourob/pytrader
- Owner: MousaZourob
- Created: 2020-06-28T23:22:43.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-04T17:37:55.000Z (about 3 years ago)
- Last Synced: 2023-08-15T15:57:20.789Z (about 1 year ago)
- Topics: alpaca-api, aws-chalice, aws-lambda, json, python, tradingview-webhook-api
- Language: Python
- Homepage:
- Size: 34.2 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyTrader
### Overview:
Automatic trading bot that streams market data of specific instruments to buy or sell them by placing bracket orders (back-end for Falcon).### Data Flow:
**1.** **TradingView alert** is set off creating a JSON message containing ticker parameters such as open and closing price
**2.** Using **TradingView webhooks**, a POST request containing the **JSON** message is sent to a REST API (**AWS Lambda** function)
**3.** This executes a **Python** script running through the **AWS Chalice Serverless Framework**
**4.** The **Python** script then executes a bracket order using the **Alpaca API Paper Trading API** (tested requests live and offline using **Insomnia REST API Client**)### Demo:
#### 1. Deploy Chalice REST API using CMD
#### 2. Set up alerts using Trading View and set Webhook URL to Chalice REST API URL
#### 3. Wait till alarm is triggered and orders are placed through Alpaca
### Libraries and Frameworks Used:
* **TradingView webhooks:** https://www.tradingview.com/support/solutions/43000529348-i-want-to-know-more-about-webhooks/
* **AWS Chalice Framework for Serverless Python:** https://github.com/aws/chalice
* **Alpaca API:** https://alpaca.markets/docs/api-documentation/api-v2/