I could think of a straight forward method:
In onTick method of your strategy you would check for the tick's time (is it past 6am and not past 5pm?) and equity vs equity of yesterday at 5pm (save equity value at 5pm for comparison at the next day) - and, accordingly, trade or not trade.
For handling date/time you could look here:
https://javatechniques.com/blog/dateform ... -examples/Also of course you could implement a separate thread that will monitor date / time / equity and set/clear e.g. trade_permit flag. Then, in your trading code, you only would need to check trade_permit flag.