I have a couple efs that update on some charts in real time but do not update on others. I can not seem to figure out why.
Can someone point out the issues that may cause this?
Fyi, here is one that updates correctly on some charts but not others.
function preMain() {
setStudyTitle("*** Tick Vol");
setCursorLabelName("*** Tick Vol", 0);
setPlotType(PLOTTYPE_HISTOGRAM);
setDefaultBarThickness(3);
addBand(0, PS_SOLID, 1, Color.black);
}
var aTick = null;
function main(nLength) {
if (nLength == null)
nLength = 13;
if (aTick == null)
aTick = new Array(nLength);
var vValue = close(0, 1, "$TICKQ")*(close(0,1,"$TVOLQ")-open(0,1,"$TVOLQ"))/1000000000;
if (vValue == null)
vValue = 0;
if (getBarState() == BARSTATE_NEWBAR) {
aTick.pop();
aTick.unshift(vValue);
} else {
aTick[0] = vValue;
}
if (aTick[nLength-1] == null)
return;
var dSum = 0;
for (i = 0; i < nLength; ++i) {
dSum += aTick[i] * 1;
}
return dSum;
}
Can someone point out the issues that may cause this?
Fyi, here is one that updates correctly on some charts but not others.
function preMain() {
setStudyTitle("*** Tick Vol");
setCursorLabelName("*** Tick Vol", 0);
setPlotType(PLOTTYPE_HISTOGRAM);
setDefaultBarThickness(3);
addBand(0, PS_SOLID, 1, Color.black);
}
var aTick = null;
function main(nLength) {
if (nLength == null)
nLength = 13;
if (aTick == null)
aTick = new Array(nLength);
var vValue = close(0, 1, "$TICKQ")*(close(0,1,"$TVOLQ")-open(0,1,"$TVOLQ"))/1000000000;
if (vValue == null)
vValue = 0;
if (getBarState() == BARSTATE_NEWBAR) {
aTick.pop();
aTick.unshift(vValue);
} else {
aTick[0] = vValue;
}
if (aTick[nLength-1] == null)
return;
var dSum = 0;
for (i = 0; i < nLength; ++i) {
dSum += aTick[i] * 1;
}
return dSum;
}