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….???