Wash trade rules

I read the answer here: APIError: Potential wash trade detected. use complex orders - #5 by Roi_Bel

“The order is being rejected because it could result in a a ‘wash trade’. A wash trade (not to be confused with a wash sale) is when one trades with oneself. This is when one’s buy order fills against one’s sell order. The SEC looks very unfavorably on that and imposes harsh penalties for repeat offenders.

Because of that, Alpaca puts in place protections which reject any order where there is an existing open order having the opposite side. In general, one’s algo should be either increasing a position or decreasing a position (ie buying or selling) and not be doing those simultaneously.”

I wonder if the SEC really requires you to block any trade that has open opposing orders. For example. Let’s says I bought a share of MSFT 2 weeks ago and the code triggers a sell if it breaks above the 25 SMA. Let’s say I also have code that ALSO buys any stock that breaks above the 25SMA. So you’ll block my sale from making profit even though I bought 2 weeks ago??? Just wondering if this seems right before I have to alter all my strategies to not overlap….???

The specific FINRA rule regarding wash trades or probably better named “self trades” is Rule 5210. It states among other things:

[brokers] must have policies and procedures in place that are reasonably designed to review their trading activity for, and prevent, a pattern or practice of self-trades resulting from orders originating from a single algorithm or trading desk, or related algorithms or trading desks.

Neither the SEC or FINRA specify how to prevent self trades. Each broker is required to develop their own processes. It’s a trade-off to comply with this requirement, while at the same time, not placing too many restrictions on bona fide trading.

One recommended approach is to use either bracket or OTO orders. When opening a position always pair that with a limit close order. The limit can initially be set quite high. When one wants to close the position, simply replace the limit price. This avoids getting orders rejected due to wash trade protections, but is also generally a good practice to simply have a take profit order always active.