Many thanks guys for all your advice. In the end I decide to split my script into 2: one filter out EST 17:00 hour completely and another I use BarPeriod=30 to trade only at EST 16:30 hour. I have tried using TimeFrame to put both feature into one script but the results are not as good. My experience is that there are many surprises in TimeFrame feature and can produce unexpected results, difficult to debug. So two scripts solved my issue.