Concurrent Scalping Algo Using Async Python

This example only works if you have a funded brokerage account or another means of accessing Polygon data.

This python script is a working example to execute scalping trading algorithm for Alpaca API. This algorithm uses real time order updates as well as minute level bar streaming from Polygon via Websockets (see the document for Polygon data access). One of the contributions of this example is to demonstrate how to handle multiple stocks concurrently as independent routine using Python’s asyncio.

Detailed Explanation on Medium

Code on GitHub