Setting maximum daily loss

Hey Alpaca!
Is it possbile to have a maximum daily loss? This is very important for an algo trading platform. The world is littered with failed hedge funds that had huge drawdowns due to bugs in code or black swan events.

Please can you help?

Interesting. How would a ‘Maximum Daily Loss’ feature work? If that amount is reached should all positions be liquidated? Submitting orders restricted? How would it get reset? Would it look at after hour trading?

There is a ‘positions’ API here which gives the daily P/L. Could that be used?

Related to this idea, a couple months ago I suggested a “maximum number of daily trades” limit that could be set by the user, to guard against a rogue algo that buys and sells repeatedly and pays the bid-ask spread in each transaction. The ability to set such a limit would be a huge relief when I activate my code. Someone (I believe at Alpaca) suggested I post the request on your GitHub, where it died with all the other ideas there.

@Dan_Whitnable_Alpaca I totally understand what you’re saying. A naive way to implement it would be to prevent new opening positions after max daily unrealized loss is hit during regular trading hours.