The return value will show correctly in the Data window but seems to be a problem with scaling on the subchart and reset scale doesn't fix the problem. On the normal output (variation 1) the values display two decimal places. If I add to.Fixed(0) it colors the whole bar and loses its y-scale the same as variation 2.
Code:
if (nMFI_Chaikin < 0 ) { setBarBgColor(Color.RGB(255,160,160), 0, nMFI_Chaikin, 0); } else { setBarBgColor(Color.RGB(160,255,160), 0, 0, nMFI_Chaikin ); } // return variation 1 - works properly if toFixed not used //return Math.round(nMFI_Chaikin); // Return variation 2 - colors the whole bar var vMF = (nMFI_Chaikin/1000000).toFixed(1); return(vMF);
Comment