This doesn’t work if you have the ability to let good trades proceed but cancel bad trades after having learned nonpublic info. You’d have to commit to a https://www.investopedia.com/terms/r/rule-10b5-1.asp plan during an open trading window, and I don’t know how complex the price/quantity formula is allowed to be.