If the color is green, trend is up, basically it means that the current value of the indicator is higher than the previous period one. So for a simple moving average, it would mean:
1
2
3
4
5
//define your indicator
indi=average[20]
//trend is bullish? (green) result = 1 if true
result=indi>indi[1]
and opposite rule for a bearish trend. Hope it helps, sorry for delay answering your question.