The basis behind Tradefire is very simple although to completely understand it you need to also understand unit range and unit speed.
To achieve tradefire to need to either one shot or three shot the opposing enemy cavalry. The reason this needs to happen is because defending archers in a city have a range of 2400 because of the wall bonus, while attacking archers only have a range of 1800 meaning the defending archers can get fire onto your marching troops before they have a chance to fire back. Keeping even a small number of cavalry in your city can ruin the attacking enemies chances of getting tradefire on your archers. If however you are attacking its much better to try to spam out all the cavalry with pikemen/warriors before trying to attain tradefire.
Archers speed is 500 with full tech meaning if both the defending and opposing archers move then a gap of 1000 has been closed on the battlefield. However if only one set of archers move then the defending archers will get free rounds of firing on your troops, while you archers will keep firing on the opposing swordsmen. This means if the enemy has a large amount of swordsmen in their city, you will not get any fire on the opposing archers.
Achieveing Tradefire Without Layers
To achieve tradefire when all the defending layers are gone before the archers (e.g. pikemen, swordsmen etc), you can send 500 cavalry and the rest archers (99,500 or more), however you must send enough cavalry so they done get killed straight away by the remaining abatis in the city. So if there is a large number of abatis left in the city you can increase the number of cavalry in the wave to 50% of the number of abatis remaining. Correct layering of your waves can be the main factor when trying to achieve tradefire in player versus player, against NPC's and historic cities however it is much easier.