Please, Can someone found out the problem in the below formula?
Every time I try to open it the eSignal software crashs!
/************************************************** *******
Alexis C. Montenegro © July 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vDonch = null;
function preMain() {
setPriceStudy(true);
setStudyTitle("Donchian");
setCursorLabelName("DCUpr", 0);
setCursorLabelName("DCMid", 1);
setCursorLabelName("DCLwr", 2);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.blue, 2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(20); //Edit this value to set a new default
var fp2 = new FunctionParameter("Offset", FunctionParameter.NUMBER);
fp2.setDefault(0); //Edit this value to set a new default
}
function main(Length, StdDev, Source) {
// generate Bollinger study if it doesn't already exist
if(vDonch == null) vDonch = new DonchianStudy(Length, Source, StdDev);
// get the current values for upper, basis, and lower bollinger bands
var vUpper = vDonch.getValue(DonchianStudy.UPPER);
var vBasis = vDonch.getValue(DonchianStudy.BASIS);
var vLower = vDonch.getValue(DonchianStudy.LOWER);
// fill in color between the upper and lower bands
setBarBgColor(Color.yellow,1,vLower,vUpper);
// return the values for upper, basis, and lower to be drawn on the chart
return new Array(vUpper, vBasis, vLower);
}
Every time I try to open it the eSignal software crashs!
/************************************************** *******
Alexis C. Montenegro © July 2003
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a
description of any changes you make.
************************************************** ********/
var vDonch = null;
function preMain() {
setPriceStudy(true);
setStudyTitle("Donchian");
setCursorLabelName("DCUpr", 0);
setCursorLabelName("DCMid", 1);
setCursorLabelName("DCLwr", 2);
setDefaultBarFgColor(Color.blue, 0);
setDefaultBarFgColor(Color.red, 1);
setDefaultBarFgColor(Color.blue, 2);
setDefaultBarThickness(1,0);
setDefaultBarThickness(1,1);
setDefaultBarThickness(1,2);
var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
fp1.setLowerLimit(1);
fp1.setDefault(20); //Edit this value to set a new default
var fp2 = new FunctionParameter("Offset", FunctionParameter.NUMBER);
fp2.setDefault(0); //Edit this value to set a new default
}
function main(Length, StdDev, Source) {
// generate Bollinger study if it doesn't already exist
if(vDonch == null) vDonch = new DonchianStudy(Length, Source, StdDev);
// get the current values for upper, basis, and lower bollinger bands
var vUpper = vDonch.getValue(DonchianStudy.UPPER);
var vBasis = vDonch.getValue(DonchianStudy.BASIS);
var vLower = vDonch.getValue(DonchianStudy.LOWER);
// fill in color between the upper and lower bands
setBarBgColor(Color.yellow,1,vLower,vUpper);
// return the values for upper, basis, and lower to be drawn on the chart
return new Array(vUpper, vBasis, vLower);
}
Comment