Colored SMA indicator source code needed for zerodha pi


Can anyone provide colored SMA indicator for a given period. For example if I give 50 as a value then the indicator has to be in green for uptrend and red for downtrend?

The TradeScript language used in Pi can be used for only Generating Signals.

Tradescript does not support Indicator plotting on Charts.