The invention discloses an electromagnetic valve for controlling the traveling direction. The electromagnetic valve for controlling the traveling direction comprises an electromagnetic valve body, an electromagnetic valve element, an electromagnetic reset spring, an electromagnetic valve control part, an electromagnetic cavity inlet, an electromagnetic valve outlet and an electromagnetic valve oil return cavity. When the electromagnetic valve control part controls the electromagnetic valve element to reciprocate between a working position and a restoration position, a combined valve oil outlet cavity A or a combined valve oil outlet cavity B is opened or closed accordingly, and the combined valve oil outlet cavity A or the combined valve oil outlet cavity B correspondingly drives an associated traveling mechanism to advance or retreat. According to the electromagnetic valve for controlling the traveling direction, in traveling acceleration and deceleration states and in other states, an operator just needs to tread on a combined valve control part to increase the opening degree of an accelerator, more oil is supplied by a hydraulic traveling system, the vehicle speed is higher, and a vehicle can advance or retreat or be in a neutral-gear state by powering on or powering off the electromagnetic valve for controlling the traveling direction at the same time; the control mode which is more user-friendly can adapt to driving habits of a driver and the operator, and great convenience is brought; and the electromagnetic valve is particularly suitable for operation under complex road conditions and severe working environments, and the comfort and safety in traveling and working states and in other states can be further improved.