Vertical oil piston with stroke position function