A machine for extracorporeal blood treatment, comprising: a blood treatment device (4) having a blood chamber (5) and a fluid chamber (6), separated from each other by the semipermeable membrane (3), an extracorporeal blood circuit comprising an arterial route (7), to carry blood withdrawn from a patient to an entrance of the blood chamber (5), and a venous route (8), to return treated blood from an outlet of the blood chamber (5) to the patient. a device for ultrafiltration (2) of a liquid through the semipermeable membrane (3) of the blood treatment device (4); a controller (14) programmed to perform the following operations: change an operating situation of said ultrafiltration device (2); detecting a plurality of values of a first quantity indicating an operational situation of said ultrafiltration device (2) when changing said operative situation; evaluating an optimum value of said first quantity from a comparison of said values, the operation of evaluating an optimal value of said first quantity comprises the phases of: determining at least one change in said first quantity caused by said change in said operating situation ; determining at least one change in a second quantity indicating an operating situation of said ultrafiltration device caused by said change in said operating situation; checking whether said change in said first quantity and said change in said second quantity match a predetermined relationship with a reference value; generate a signal consistent with said verification phase; wherein said first quantity comprises an ultrafiltration flow rate through said membrane (3), or an amount on which said ultrafiltration flow rate depends, and wherein said second quantity is a transmembrane pressure of said semipermeable membrane (3).Una máquina para tratamiento sanguíneo extracorpóreo, que comprende: un dispositivo de tratamiento sanguíneo (4) que tiene una cámara sanguínea (5) y una cámara de fluido (6), separadas entre sí por la membrana semiperm