Trade has "Open Time" parameter, candles also have Time parameter, which is some rounded number. But if you know the current timeframe and how long is one candle, you can ask for the trade age. If the period is 5 minutes, every trade that is not older than 5 minutes belongs to the current candle.
P