Hi,
I've used formatPriceNumber before to find highs and low over a span of bars, but I guess I really don't understand formatPriceNumber for what I need now. Especially the way it works with a series ... I think.
I'm just trying to get the two digits to the left of the decimal place to print out next to it's horizontal line. In this case for a Bollinger Band.
Thanks For Your Help ... Again !
Heres my snippet of code
// fox 2
setPriceStudy(true);
var bInit = false;
debugClear() ;
function main() {
if ( bInit == false ) {
B60U = upperBB(60,3);
bInit = true;
}
B60Ug = B60U.getValue(0);
drawLineRelative(0, B60Ug, 15, B60Ug, PS_SOLID, 3, Color.RGB(250, 0, 0),5);
B60Uf = formatPriceNumber(B60Ug);
debugPrintln(" B60Uf =: " + B60Uf); // shows equal to null
B60Uz = B60Uf.length; // This line gets the error, has no properties
B60Uw = B60Uf.substring(B60Uz,(B60Uz-2));
drawTextRelative(15, B60Ug, B60Uw, Color.red,null,Text.VCENTER,"Calibri",10,1);
}
I've used formatPriceNumber before to find highs and low over a span of bars, but I guess I really don't understand formatPriceNumber for what I need now. Especially the way it works with a series ... I think.
I'm just trying to get the two digits to the left of the decimal place to print out next to it's horizontal line. In this case for a Bollinger Band.
Thanks For Your Help ... Again !
Heres my snippet of code
// fox 2
setPriceStudy(true);
var bInit = false;
debugClear() ;
function main() {
if ( bInit == false ) {
B60U = upperBB(60,3);
bInit = true;
}
B60Ug = B60U.getValue(0);
drawLineRelative(0, B60Ug, 15, B60Ug, PS_SOLID, 3, Color.RGB(250, 0, 0),5);
B60Uf = formatPriceNumber(B60Ug);
debugPrintln(" B60Uf =: " + B60Uf); // shows equal to null
B60Uz = B60Uf.length; // This line gets the error, has no properties
B60Uw = B60Uf.substring(B60Uz,(B60Uz-2));
drawTextRelative(15, B60Ug, B60Uw, Color.red,null,Text.VCENTER,"Calibri",10,1);
}
Comment