my tank with 0 ammonia, 0 nitrites, 40ppm nitrates
Is that a planted tank? I've never had nitrates that high in a planted tank.
Puppylove - An established tank should have 0 ammonia, 0 nitrites, nitrates 40ppm or below. Nitrates are often much lower in planted tanks but as long as it's bellow 40ppm (some say bellow 30ppm) it should be safe enough for fish. Nitrates are what is left over when bacteria have consumed ammonia and nitrates and are lowered by water changes or consumed by plants.
A tank usually takes about 4-6 weeks to cycle. This is the time that it takes for the good bacteria that consume ammonia and nitrites to build up. During this time ammonia and nitrite spikes are expected. If you still see ammonia or nitrite readings after the tank is cycled it is usually a sign of under filteration, overstocking or overfeeding.
Your tank had plenty of time to cycle with the goldfish
in it, if you still had ammonia issues then it's because the bioload of the goldfish
was too much for the tank/filter.
The ammonia issues you have had since then are probably for one of two reasons:
1)If you put the new fish in straight after the goldfish the tank did not need to cycle so the ammonia is just left over from the goldfish.
2) If the tank was left without fish for a while, and especially if you turned off the filter during that time the bacteria will have died off and needs time to build up (or cycle) again.
Either way, with fish in the tank it is best to keep ammonia and nitrites bellow 1ppm with water changes. Now that your ammonia is 0.25 I wouldn't worry too much for now. That level should be tolerated well by fish for a short time period. If the ammonia levels persist for much longer though it is caused by other issues like a poor filter or overfeeding. Any amount of ammonia over a long time is very harmful to fish.