I have a freshly written study that seems to either crash or loop esignal. I tried to go through support but they said I need to get help here.
except for the premain and global variables, this is the code
basically, if in the OneSetup function, if I move the return right at the start, I get an error (correctly because things aren't initiallized). If I move it further, I either get loops (esignal goes away) or crash dump.
I think esignal has a problem because an efs shouldn't be able to crash esigna.
Bernie
//---------------------------------------------------------------------------------------------------
// main is called once per tic
function main(SessionStart, SessionEnd, CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize ) {
debugPrintln("Entry sw="+OneSwitch);
if (OneSwitch == 0) { // one time only
OneSetup(CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize);
OneSwitch = 1;
debugPrintln("exit sw="+OneSwitch);
}
if (getBarState() == BARSTATE_NEWBAR) { // only once per bar
}
var time = getHour()*100+getMinute()*1;
var CCI = CCI14.getValue(CCIStudy.CCI);
var Turbo = CCITurbo.getValue(CCIStudy.CCI);
debugPrintln(time+" "+CCI+" "+Turbo);
return new Array(CCI, CCI, Turbo, 0, +100, -100, +200, -200);
}
//--------------------------------------------------------------------------------------------
// OneTimeSetup -- Called once by main to initialize things that can't be done in preMain
function OneSetup(CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize)
{
//return;
//debugPrintln("OneTimeSetup");
// setup interval info
/*i = getInterval(); // get raw interval value
len = i.length();
return;
IntervalType = i.charAt(len-1);
IntervalSize = parseInt(i)*1;
return; */
// setup CCI
CCIStudy = new CCIStudy(CCILookback, "HLC/3");
return;
// setup chart properties
setDefaultBarFgColor(CCIColor, 1); // set color of CCI Line
setDefaultBarThickness(CCISize, 1); // set size of CCI Line
setDefaultBarThickness(CCIHSize, 0); // set size of CCI Histogram bars
setDefaultBarFgColor(TurboColor, 2); // set color of CCI Line
setDefaultBarThickness(TurboSize, 2); // set size of CCI Line
if (TurboDisplay == "Yes") {
TurboDisp = true;
} else {
TurboDisp = false;
}
return;
}
except for the premain and global variables, this is the code
basically, if in the OneSetup function, if I move the return right at the start, I get an error (correctly because things aren't initiallized). If I move it further, I either get loops (esignal goes away) or crash dump.
I think esignal has a problem because an efs shouldn't be able to crash esigna.
Bernie
//---------------------------------------------------------------------------------------------------
// main is called once per tic
function main(SessionStart, SessionEnd, CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize ) {
debugPrintln("Entry sw="+OneSwitch);
if (OneSwitch == 0) { // one time only
OneSetup(CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize);
OneSwitch = 1;
debugPrintln("exit sw="+OneSwitch);
}
if (getBarState() == BARSTATE_NEWBAR) { // only once per bar
}
var time = getHour()*100+getMinute()*1;
var CCI = CCI14.getValue(CCIStudy.CCI);
var Turbo = CCITurbo.getValue(CCIStudy.CCI);
debugPrintln(time+" "+CCI+" "+Turbo);
return new Array(CCI, CCI, Turbo, 0, +100, -100, +200, -200);
}
//--------------------------------------------------------------------------------------------
// OneTimeSetup -- Called once by main to initialize things that can't be done in preMain
function OneSetup(CCILookback, CCIColor, CCISize, CCIHSize, TurboDisplay, TurboColor, TurboSize)
{
//return;
//debugPrintln("OneTimeSetup");
// setup interval info
/*i = getInterval(); // get raw interval value
len = i.length();
return;
IntervalType = i.charAt(len-1);
IntervalSize = parseInt(i)*1;
return; */
// setup CCI
CCIStudy = new CCIStudy(CCILookback, "HLC/3");
return;
// setup chart properties
setDefaultBarFgColor(CCIColor, 1); // set color of CCI Line
setDefaultBarThickness(CCISize, 1); // set size of CCI Line
setDefaultBarThickness(CCIHSize, 0); // set size of CCI Histogram bars
setDefaultBarFgColor(TurboColor, 2); // set color of CCI Line
setDefaultBarThickness(TurboSize, 2); // set size of CCI Line
if (TurboDisplay == "Yes") {
TurboDisp = true;
} else {
TurboDisp = false;
}
return;
}
Comment