Principle is the same "if this = this do this", but if different timeframes mean different settings. You have the flags to allow/stop trades, now new trees that will set these, condition PSAR is < or > candle ID4, this means that as soon as the dot is on 4 (so when 3 closes) you can set the flag false.
F