I am trying to create an indicator that returns the Std Dev of Range. I amd trying to use Bollinger band logic to achieve this but only able to use close. If I try and replace "Close" with "Range" I get an error, parameter 2 invalid.
Is there a simple fix for this? Below is the code as I am attempting to use it. Thanks in advance!!
Is there a simple fix for this? Below is the code as I am attempting to use it. Thanks in advance!!
Code:
function preMain() { setStudyTitle("BandWidth"); setCursorLabelName("BW", 0); setCursorLabelName("Floor", 1); } var bb = new BollingerStudy(300, "Range", 2.0); function main() { var vUpper = bb.getValue(BollingerStudy.UPPER); var vLower = bb.getValue(BollingerStudy.LOWER); var vMiddle = bb.getValue(BollingerStudy.BASIS); if(vUpper == null || vLower == null || vMiddle == null) return 0.0; return new Array((vUpper -vMiddle), 0.0); }
Comment