function preMain() { setStudyTitle("TrendIndicator"); setCursorLabelName("Trend", 0); setPriceStudy(false); } function main() { if ( (sma( 5 ) > sma( 20 ) ) ) { setBarBgColor( Color.RGB(31,61,36) ); } else if ( (sma( 5 ) < sma( 20 ) ) ) { setBarBgColor( Color.RGB(79,14,38) ); } return null }