The strategy is relatively simple:
Every day, at 9:30 when the market opens, short the stock (from all the US stock universe) that made the biggest (overnight) bullish GAP (today open - yesterday close) if it gapped by at least X% (we can set it to 15%).
The tricky part is the order management part. The order is composed of 3 legs.
The first leg is always opened when the market opens. Second and third legs are fixed in terms of GAP retracement. For example, Market closed yesterday at $10. It opens today at $15. GAP worth $5 which is equal to 50% of yesterday's closing price. So if we set the first leg to be executed at -100% of the GAP retracement, then the first leg will be fixed to $20. (-100% of the GAP = $5 and $15 + $5 = $20.) Same for the third leg.
We also fix Stop Losses and Take Profits in terms of retracement. Each leg has a different SL and TP. Of course, all orders and positions are closed 1 or 2 minutes before market's close.
It would be great if someone could help me coding this strategy or tell me how to do it.
Regards,
Gabriel