The effect of pressure on the crystal structure and the transition temperature of the high temperature superconductor YBa2Cu3O7-x (x = 1, 0.5 and 0 ) was studied. Main force of interaction is the electrical interaction because of the ionic nature of these compounds, model of the crystal structure based on experimental data was established. The pressure effect on the above structure was considered, also considered details of ionic position, inter - ionic distances and forces between them. Madelung method used for calculating the forces between the ions and their binding energy. Because Madelung constant reflects the real crystal structure. The effect of pressure on YBCO structure was found via calculating the bulk modulus. The relative volume of YBCO decreases with increasing pressure and oxygen content in the compound. elongation of the Cu(2)-O(4) bond was detected under pressure along the b direction also a change of Madelung energy was found which gives an indication of the effect of pressure on Tc .