The majority of black fish loose their black coloration because of genetics - their gene makeup dictates that that is what they will become. There is little or nothing you can do to prevent it.
You CAN, however, affect the quality, depth and/or bronzing of a
black fish through various mechanical means. Sunlight and algae food, as you have stated is largely touted as being major factors in keeping a deep velvet black.
Still other goldfish people swear by pH variations and water temperature as having equally important affects on the fish's color. A black fish supposedly will remain blacker when kept in pH less than 7.0. This is dancing along the line of danger and catastrophe, though, so it is not reccommended unless you really know what you are doing.
Black is also said to remain blacker at temps under 72F. Higher temps often have been corrolated with bronzing. Since water temperature plays many important parts in the size, health and heartiness of the fish, this, too is better left to someone who has carefully researched it.