Can we code user defined functions in tradescript? For instance we have PARAM in AFL. Similar to it

Can we code user defined functions in tradescript? For instance we have PARAM in AFL. Similar to it.

I think you can’t code user defined functions in Tradescript and use them later.

You have to write the logic each time in your code to use them.