I don't know if this is the reason, but you're not printing "seconds" correctly. TradeVar is a var, not an int, so you must print it with %f, not %d.