How do i code this? I want my long positions to close on Friday night 22:00 and no more entry after 22:00 on Friday. IF DAYOFWEEK = 5 AND TIME = 220000 THEN SELL AT MARKET ENDIF I use this but a new position open 22:10 on Friday.