How bitcoin exchange wallet system works? I mean if exchange generate new address for each user (getnewaddress)(rpc) ...but trade just goes in database of their not on real blockchain ,so how does exchange deposit address shows 0 balance on block explorer after selling my btc to someone.

If the trade happens in database only then that address should contain balance linked to it
Exchanges will often move funds from the deposit addresses to some other internal storage wallet. This wallet may be a cold storage wallet that is more secure than the wallet that initially holds your deposited coins. This will happen regardless of whether a trade occurred.