I don't know about Alpaca, but Quantopian lets you do the equivalent and then also backtesting on historic data.
Created it after not being able to do livetrading on Quantopian.
Here's the associated python library and documentation: https://docs.kloudtrader.com/ https://github.com/KloudTrader/libkloudtrader