You can see the definitions in variables.h - TradeTime is not a real variable, but a macro. The trade duration for closed trades would be (TradeBarClose-TradeBarOpen).