As intelligent ship technology advances, the importance of intelligent anchor position detection, as one of the key technologies, can ensure the safe anchoring of ships and enhance the efficiency of port operation. At present, most of the anchor position selection and detection algorithms are mainly based on two-dimensional planes, and there is a lack of research on the intelligent detection of safe water depth for ship anchoring in three-dimensional space. It not only restricts the full utilization of anchorage resources but also affects the safety and environmental adaptability of anchoring operations. To address these issues, this study proposes a three-dimension anchor position detection method. Firstly, based on the establishment of a three-dimensional ocean model, the possible anchor positions selected by the ship are simulated using the Monte Carlo algorithm. Secondly, the simulated anchor positions are optimized using a Traversal algorithm to filter out the optimal anchoring position that meets the requirements, the safety distance between each point and the existing ship is calculated, and the anchor position is determined according to the corresponding required safety spacing. Finally, to verify the applicability and effectiveness of the method under different sea conditions and different ship types, this study conducts a series of simulation experiments with 5000 random samples. These experiments compare the demand of anchor position selection for anchoring ships with changing water depths in the case of empty and full load drafts, and visualize the impact of varying water depth parameters on the selection of anchor positions for anchoring ships in various ship types. The outcomes of the experiment indicate that the algorithm’s detection area encompasses the whole anchorage area, ensuring both the anchorage area’s usage rate and the accuracy of anchor position detection. This study demonstrates that the Traversal and Monte Carlo Algorithms effectively improve the accuracy of the selection of anchoring position of the ship, makes full use of the resources of anchorage, and further improves the safety and efficiency of the anchoring operation.