Saving Live data to a file

Please guide on how to save the live ticker date to a file so that it can be used to create entry and exit conditions