Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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)

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/