The levitation properties of MgB prepared by hot press at 200 C and then pellet/closed tube method has been investigated. The vertical and lateral levitation forces ( and on a cylindrical NdFeB permanent magnet (PM) below a disk-shaped bulk MgB were measured during the vertical and lateral traverses of the PM in different cooling heights (CHs) and measurement heights (MHs) at temperatures of 20, 25 and 30 K to investigate the effect of the initial CH and MH on the levitation performance of MgB. For temperatures below 30 K, it was observed that increases with increasing CH. However, a minute variation in and a big hysteresis loop are observed at 30 K. From the lateral traverses, it was obtained that the with attractive character increases with decreasing MH and the hysteresis effect increases for small MHs due to the increment of the magnetic field intensity which the sample feels with decreasing MH. In addition, it was seen that the character of varies depending on both MH and measurement temperature. The higher hysteresis obtained in than in during lateral traverses implies that the motion of the flux lines in MgB is especially in lateral rather than vertical direction. Finally in this study, it was shown that the levitation performance of MgB depends not only on the measurement temperature but also on the CH and MH conditions. These results can be useful for optimizing the levitation performance of MgB superconductors for potential applications.