The trimtodays function is not avialable in the xpath queries. The available functions are described here: https://docs.mendix.com/refguide/xpath-constraint-functions
Your query needs to be a bit more complex as you’ll need to take the time portion into account.
So create 2 variables marking the start and end of the day from the tradeleg attribute and compare by greater than and smaller than for the start and end respectively.