This would be a building that is unlocked at town hall 9 or 10 to prevent people from rising through the ranks too quickly with a hefty price tag, just an example and could be changed or factored in, of 1.500.000 gold 2.500.000 elixer and 25.000 dark elixer to allow the trading of your own resources in exchange for another one. You would only receive a fraction of what you trade to keep from making the game unbalanced. You would need to call the trader somehow, like purchase a cart to haul your resources away and bring the new ones, which should cost 500 dark elixer or something like that. Let's say you have a full gold storage, your completely out of elixer but you want to upgrade your army camps. You buy the trader to come to your village and haul away your gold, for easy math lets say you want to trade 2.000.000 gold for elixer you sell your gold and receive 1.000.000 elixer. This process of trading should take between 45 minutes and two hours so it's not something instant and someone using gems can abuse the system. You should also only be able to call a trader every 12 or 24 hours for the same reason. For trading gold and elixer for dark elixer i suggest a very small ratio like you sell 1.000.000 gold for 15.000 dark elixer or maybe even less. The recourses should also have to be collected from the market not directly put into your storages, like the war loot bonus from the clan castle. You should have to upgrade the market place to do bigger trades to prevent people from trading 10.000.000 resources at a time.
overview:
building cost approx. 1.5000.000 gold 2.500.000 elixer 25.000 dark elixer
cost of calling trader approx. 500 dark elixer
you receive much less from your trade than you put in
there is a duration time for the actual trade time between you sending away your resources and receiving what you traded for
there is a limit of how many times per day you can use the trader, i suggest every 24 hours, but this could be sped up by gems which supercell could probably make quite a bit of profit from high ranking players who purchase gems.
the resources could be raided if the player was not online when the trader comeback with your resources, like your loot bonus from the clan castle.
i saw this idea was "ruled out" but this isn't just trading evenly and the times being able to be sped up by gems can still generate profit for supercell.

