The invention belongs to the technical field of medicine, and specifically relates to compounds represented by formula (I), pharmaceutically acceptable salts, esters or stereoisomers thereof, R 1 , R 2 , R 3 , R 4 , W, A, Z, E, X, Y, n are as defined in the description and claims; the present invention also relates to the preparation methods, pharmaceutical preparations and preparation of these compounds for the treatment and / or prevention of FXR receptor The application of drugs in related diseases such as non-alcoholic fatty liver, primary biliary cirrhosis, lipid metabolism disorders, diabetic complications and malignant tumors.