You place a limit order in advance to buy at 5.00 (market orders don't guarantee price) and if you get filled you'll be hoping to short at 5.15 or so later.
Minor nitpick.
Since you've bought the stock first, your second trade will be a sell and not a short, unless you overfill on the second leg, in that case you'll have a partial sell and partial short.
Correct. In this simple algo scenario the position is assumed to be long 1X or short 1X at any given time. After the first trade, all reversals trades are then either buy 2X or sell 2X until the very last trade.
Comments
Minor nitpick.
Since you've bought the stock first, your second trade will be a sell and not a short, unless you overfill on the second leg, in that case you'll have a partial sell and partial short.
Correct. In this simple algo scenario the position is assumed to be long 1X or short 1X at any given time. After the first trade, all reversals trades are then either buy 2X or sell 2X until the very last trade.