We have studied the relationship of geomagnetic activity indices (Ap, Dst) on time intervals, equal to solar cycles (∼11 years), with solar activity indicators and heliospheric parameters. It is shown that the plots of the Ap and Dst indices versus solar activity indicators, as well as versus heliospheric parameters, i.e. solar wind and IMF parameters in the ascending and descending phases of solar activity cycles 21–24 do not coincide, which is indicative of the hysteresis phenomenon. The Ap and Dst indices form hysteresis loops with all parameters we analyze during cycles 21–24. The shape and area of the hysteresis loops, as well as the direction of rotation, clockwise or counterclockwise, depend significantly on indicators of solar activity, heliospheric parameters and change from cycle to cycle. We have found a tendency for the extension and area of the hysteresis loops to decrease from cycle 21 to cycle 24. Analysis of the variability in the shape and size of the hysteresis loops formed by the Ap and Dst indices with solar indicators and heliospheric parameters gives reason to believe that the obtained loops reflect the long-term evolution of the solar wind energy flux, which determines global geomagnetic activity and the magnetospheric ring current intensity in the ascending and descending phases of solar activity cycles 21‒24.