How to calculate support and resistance in trade script

Trade script does not seem to provide any native support for calculating support and resistance.

Is there any other way that this can be done? For example, by calculating it myself in the trade script code? Or by utilising the existing primitive functions?

Thanks for any inputs