The code you are showing has the right approach, but the port names in the Datawatch commands are not quite right. These port names change depending on what "Slope method" has been chosen (e.g. Up, Down, Up / Down, Imm. Up, etc.)
In your example the Slope method is "Up / Down". In this case, the port names are:
If you use a Slope method of "Up", the port names are:
If you use a Slope method of "Down", the port names are:
If you use a Slope method with the "Immediate" prefix, it uses the same ports as the regular method.
The attached file contains some example code for setting these values (also for setting the "Step" value). The code also demonstrates how you can change the Slope method using automation.