I'm new to trading and especially automated/algorithmic trading. However, I have some programming skills and have been thinking about experimenting with some strategies. A couple of questions regarding rules/law: First, can one place a limit order to buy a stock, cancel the order quickly if it does not get filled, and then immediately place a new limit buy order at a slightly different price? Are there any rules to how often this repeated cancelling and placing can be done? The purpose of this procedure would be to get a liquidity adding limit order to be executed as quickly as possible (i.e. at a better price than current ask). Extrapolating the above, is it legal for a retail trader to program a system that automatically places limit orders, cancels them shortly and/or adjusts them as needed?