There are innumerable ways to define/specify the so-called "pattern" of "a cup."
To execute it on your own screen, you'll have to specify what the cup is -- is it the bottom of a parabola? Or is it broader like a soup bowl? Maybe as shallow as a saucer?
Then, you have to specify *what* is executing that pattern: is it the daily close? The daily MID or VWAP? Perhaps a Moving Average? An SMA or an EMA? How far back does this MA look?
Once you have those two things, you can decide how you want to screen:
are you going to backtest daily? Weekly? Back 180 days?
Back 3 years ago or so, the market was handing out sweet buy/writes and covered calls like they were Easter candy -- the only thing I did was screen on three criteria:
Recent drop (3-6 months out)
Recent bottom (2wks-4wks out)
Recent highs (w/in last two weeks)
and I caught a bunch of stuff that had had some sort of issue,
got pasted (re market price), and
hit an obvious rebound.
All that on three screening criteria.
(But the patterns would've looked like "a cup" if anyone had cared.)