If you have access to the TS forum click on this link
https://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=24092
scroll down or find the section starting
270. DATA: EXPORT, IMPORT, DOWNLOAD, DOWNLOAD SCHEDULER & ASCII
and you will find several ways of doing this. Another easy way is to incorporate a print statement within your code. This will print out any data you specify such as symbol, time, quantity etc. This can be automatically written away as a file at the end of the session
Charlton