The study of the probability of the occurrence of the extreme events (the events which occur with low probability of occurrence) is an important issue in the risk management. Extreme value theory calculates risk measures using extreme events for a financial basket, regardless of the distribution function of the return of the financial assets. In this theory, the method of peaks over threshold is practically the most appropriate and applied method by the use of which separate modeling of the tail part of the dataset is possible by using the generalized Pareto distribution and the start of the appropriate threshold. For this reason, in this paper, the methods of maximum likelihood estimator, likelihood moment estimator, Zhang and the weighted nonlinear least squares under the POT framework have studied and compared to estimate the parameters of the generalized Pareto distribution in order to estimate the value at risk and the expected shortfall of indices of food other than sugar, banks, car, chemicals, pharmaceuticals, cement, agriculture, petroleum products, textiles, coal, financial, industrial, the price of 50 companies, free float and the second market of Tehran stock exchange from March 25, 2013 to May 18, 2016. The overall results show that the expected shortfall is a more coherent measure for risk calculation, and the nonlinear weighted least squares estimator under the POT framework provides better estimation for generalized Pareto distribution.