A fully functioning trading script using Alpaca API with websocket data. I have used my paper trading account to simulate my trading strategy and to back test it before jumping into the live trading.
I have partially hidden my API Key and API Secret ID but you can generate your own Alpaca API keys by making your account into the Alpaca API Trading Website.
Link --->> https://alpaca.markets/
P.S: Please don't try to use the algorithm for live trading, not liable for any loss associated with this algorithm.