what is your temperature? usually when my fish are around the heater it means the water is too cool for them. Some fish need a warmer water than others. Now I only have Bettas and Otos so I am no expert on your fish, but I am betting someone around here knows more about your particulare species. Most fish of the tropical variety which yours are need at the very least 76 degrees and are really happier at or near 78-80. Also do you have a large enough heater? The general rule is 5 watts per gallon and since you have a 20 gallon tank you should have either 1 - 100watt heater or 2- 50 watt heaters (one on each end). Is the pump moving the heated water around or is it all just staying around the area of the heater? If you have a thermometer check the temperature at both ends of the tank and see if there are big differences. If so, you may need to add some airstones to move the water and equalize the temperature a bit. I may be totally off on the wrong track, but like I said that is why my fish do that. Maybe the little guy is just scared. I will see if I can get someone to answer a swordtail specific question, okay?
Welcome, I don't think I have spoken to you before. Sorry I couldn't be more helpful.
Rose
