I would also like to get some more opinions and personal strategies employed by other players. Not that Raging Amish's aren't well conceived, it would just be more beneficial to hear more than one take on the subject. Don't be shy now
Ok heres my take , but im usually alot more theoretical about it.
My intial answer to trade ports is this. I build trade according to three things - The Tempo of my allies , The personality of the enemy and The situation of the enemy.
The theory is simple. You dont build Trade for any other reason then to eventually get out a bigger fleet then your enemy because you have more money.
However , building/researching to get that Trade in the first place , puts you behind on the size of your fleet.
If the enemy can exploit this window of opportunity then you have failed. You will lose too much early on (ships etc) that the trade ports will never make up the loss income. Infact worse case scenario is if the enemy blow up your trade ports.
Now look at the enemies situation. Is he passive or aggressive. Is he lining the edge of his gravwell with ships constantly pouring out. Hes waiting for you to do something else other then build ships at the same rate he is. The moment you decide to make civ labs and res trade instead of building ships ...bam he will exploit the weakness.
Now think about the Window of Opportunity you are offering to your enemy. What happens if he doesnt scout or take advantage of it. Maybe you can get away with having less ships , if he doesnt attack you , and by the time he realises , your trade will have made up enough credits that your fleet size will catch up with him. You have effectively opened a window and closed it. The opening and closing of a window gives you advantages and I call this "baiting". This is one of the main skilled strategies in Starcraft where experts grab "expansions" to force the hand of the opponent.
Now there is also the possibility of Opening a Window but opening it only slightly so that its almost impossible to exploit. Make 3 repair labs , and stay defensive with less ships. Use the rest of your money for trade. The enemy will have more ships , but can he use his greater fleet strength vs your smaller fleet+repair?. Effectively you have opened a window he cant jump through. Keep defensive until this window closes , essentially when you have more econ then him so you can catch up on fleet.
Windows are naturally hard to jump through. Because of the jump distance of the enemy , they may have more ships then you , but because you are far away , you have the advantage of ships to bare. I.e your ships get to the battle faster then his. Thus even with a large army , by the time that army gets to you ..it will be the same size as your army + faster reinforcements.
This natural difficulty can offer you the chance to make trade ports , and the enemy cant exploit it.
.Another thing you must think about is IF YOU should be the one jumping through an enemies window of opportunity. If you see an enemy who just has a cap ship capping planets , and he has trade ports everywhere ...a noob might panic and try to get his own trade up. However assess whether this is suppose to be your opportunity to hit him with a superior fleet.
Sometimes an ally and an enemy are fighting each other. You decide to get up trade. The other enemy attacks the ally to force a 2 vs 1. Now , if the 1 can stay defensive , not lose ships etc , try to make repairs and concentrate purely on ships , he can last out till your window closes. Once your window closes you can use your high income to exploit.
However saying this , some one who opens windows smartly which are difficult to exploit , can be countered by opening your own windows. This is the prefered way of intermediate players to battle. They try to "race" the enemy. Sometimes getting trade is to open your own windows larger and more exploitable ,because you know the enemy is doing the same thing but cant jump through your windows.
Often you get noobs who open windows , notice also that you are opening windows but do not assess your potential to exploit windows of opportunity . Thus he opens small windows and closes them fast with the fear you might attack and exploit just to be on the safe side. You however ,assess that the noob cannot jump through your windows ,so you open them bigger and when you close them , you gain more then the noob.
[I.e You make 10 Trade ports but he only makes 5 trade ports and puts turrets and token defensive ships round them instead of the another 5 trade ports]
This is also a way to exploit non-aggressive enemies. Skilled players can often give the impression with ship positioning and behaviour that they can exploit a window , thus a noob becomes fearful and opens smaller windows and loses out on the race.
Hope this helps
ps - im writing a guide that includes all this stuff. Will be released after 1.1 tho.
Oh and just to rant. Often noobs will call me a brainless rusher when they go for an ice planet and I come steamrolling in with LRMs exactly at the time when their ice has just been colonised and its making -3.0 income. Its a shame they dont realise that by getting the Ice they have opened a window , and that they havent really scouted me to assess my potential to exploit this windows of opportunity.
Colonising a planet is also opening a window!