How to set a time range in an Alert?

Hi. How can I specify a time range in a metric alert? I want to trigger the alarm only if @timestamp is between an interval.

https://github.com/elastic/examples/tree/master/Alerting/Sample%20Watches has some examples.
But you will want to use a range query - https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-range-query.html