How to clamp touch value for rotation?

I want to rotate camera up and down and clamp between -4 to 4 using touch input. But my code is not working. Plz help me.

void Update()
    {
        if (Input.touchCount > 0)
        {
            Touch touch = Input.GetTouch(0);

            if (touch.phase == TouchPhase.Moved)
            {
                float touchValue = touch.deltaPosition.y;
                touchValue = Mathf.Clamp(touchValue, -4, 4);
                transform.Rotate(touchValue, 0, 0); 
            }
        }
    }

Here’s how I would do it with Mouse input. You can adapt this pretty easily to your touch world. The secret is keeping track of the current rotation and clamping the current rotation plus proposed rotation.

using UnityEngine;

public class LookUpDown : MonoBehaviour
{
    float oldRot = 0;
    float newRot;

    void Update()
    {
        float rotAmount = Input.GetAxis("Mouse Y");
        newRot = oldRot + rotAmount;
        newRot = Mathf.Clamp(newRot, -4, 4);
        transform.Rotate(newRot-oldRot, 0, 0);
        oldRot = newRot;
    }
}

Your code worked perfectly but I don’t understand this code. Why I have to take old rotation, then subtract from new rotation and then put new rotation value in old rotation. But thank you very much for your help.