i'm 0n vacation and don't have access to my bookmarks, or i would provide you with the links to help you.
basically, in the free version, you can have 5 macros to see if you like MD.
click the + symbol
Select a trigger:  Screen On/Off  ( for example )  make it Unlocked
Select an Action: Mobile Data On/Off  ( for example ) make it ON
click right arrow
click right arrow
Type a Name:  Data ON (for example meaning screen is unlocked )
now it will go back to the menu, and you can list the macros you have written.
okay, let's make one turn it OFF.
Trigger: Screen OFF
Action: Mobile Data: OFF
-->
-->
name Screen OFF or call it DATA OFF
and that should get you going.
you will want the paid version in a hurry, guarantee you.