Trigger based on increasing OI/Volume over last few days or months?



I have a question on triggers. Is there a way to program this based on
today’s volume, is greater than volumes over last 10 days and OI higher than last 10 days or last month?
Or can it compare over the previous day only?