The Federation of Metal Detecting and Archaeological Club (FMDAC) Code of Ethics can be found here: http://www.fmdac.org/about/codeofethics.htm
But beyond this, I feel there is a Code of Honor. Honor is trustworthiness, one's character, and how one reflects honesty, respect, integrity and fairness. This is more than a Code of Ethics.
I try to be an honorable metal detectorist. I'm not perfect, but this is what honor means to me. I always try to know the law. I do not knowingly trespass or hunt sites without permission. I respect locked gates and fences.
I honor my metal detecting friends by not hunting sites they have discovered or shared with me (public or private) without their knowledge or consent. I try to teach and help others learn the hobby and pass along what I have learned.
I use the best retrieval techniques I can. I try to dig neatly and leave little evidence I have metal detected a place. I take my trash with me and fill my holes, even on the beach. If I can do something simple to make it better than when I arrived, I will.
I am polite and courteous. If I am asked to leave a site, I will do so without quarrel, even if I know I am doing no wrong. If I have inadvertently trespassed, I apologize and do what I can to make things right.
Public perception is powerful. If we are seen as looters, thieves, liars, grave robbers and trespassers we will lose access to the sites we depend on for our hobby. Negative stereotypes, once formed are difficult to overcome.
Honorable detecting and good etiquette is what will make it possible for us to continue to enjoy our hobby. Dishonorable detecting will close sites to all of us. I urge you to do the best you can, be an honorable detectorist and a credit to the hobby.