I've read through this post, and but i can't get the getValue function to work in the code posted below. It tells me the call function is undefined. Any ideas?
debugClear();
function preMain() {
setPriceStudy(true);
setStudyTitle("Daily Drummond");
setCursorLabelName("D",0);
setCursorLabelName("D",1);
setCursorLabelName("D",2);
setCursorLabelName("D",3);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),0);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),1);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),2);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),3);
setPlotType(PLOTTYPE_FLATLINES,0);
setPlotType(PLOTTYPE_FLATLINES,1);
setPlotType(PLOTTYPE_FLATLINES,2);
setPlotType(PLOTTYPE_FLATLINES,3);
setDefaultBarThickness(2,0);
setDefaultBarThickness(2,1);
setDefaultBarThickness(2,2);
setDefaultBarThickness(2,3);
}
var prevH = null;
var prevL = null;
var prev2H = null;
var prev2L = null;
var H2H = null;
var H2L = null;
var L2H = null;
var L2L = null;
var bInit = false;
var xHigh = null;
var xLow = null;
function main() {
if(bInit == false){
xHigh = high(inv("D"));
xLow = low(inv("D"));
bInit = true;
}
var prevH = xHigh.getValue(-1);
var prevL = xLow.getValue(-1);
var prev2H = xHigh.getValue(-2);
var prev2L = xLow.getValue(-2);
if(prev2H == null)
if(prev2L == null)
if(prevH == null)
if(prevL == null)
return;
H2H = (prevH - prev2H) + prevH;
H2L = (prevL - prev2H) + prevL;
L2H = (prevH - prev2L) + prevH;
L2L = (prevL - prev2L) + prevL;
return;
return new Array(H2H.getValue(0),H2L.getValue(0),L2H.getValue (0),L2L.getValue(0));
}
I've tried different variations on this theme, including trying to define another set of variables and then calling the function (i.e., newvar = H2H.getValue(0);...
return new Array(newvar...);
Same result.
Any help woul dbe appreciated.
debugClear();
function preMain() {
setPriceStudy(true);
setStudyTitle("Daily Drummond");
setCursorLabelName("D",0);
setCursorLabelName("D",1);
setCursorLabelName("D",2);
setCursorLabelName("D",3);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),0);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),1);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),2);
setDefaultBarFgColor(Color.RGB(0xFF,0xFF,0x00),3);
setPlotType(PLOTTYPE_FLATLINES,0);
setPlotType(PLOTTYPE_FLATLINES,1);
setPlotType(PLOTTYPE_FLATLINES,2);
setPlotType(PLOTTYPE_FLATLINES,3);
setDefaultBarThickness(2,0);
setDefaultBarThickness(2,1);
setDefaultBarThickness(2,2);
setDefaultBarThickness(2,3);
}
var prevH = null;
var prevL = null;
var prev2H = null;
var prev2L = null;
var H2H = null;
var H2L = null;
var L2H = null;
var L2L = null;
var bInit = false;
var xHigh = null;
var xLow = null;
function main() {
if(bInit == false){
xHigh = high(inv("D"));
xLow = low(inv("D"));
bInit = true;
}
var prevH = xHigh.getValue(-1);
var prevL = xLow.getValue(-1);
var prev2H = xHigh.getValue(-2);
var prev2L = xLow.getValue(-2);
if(prev2H == null)
if(prev2L == null)
if(prevH == null)
if(prevL == null)
return;
H2H = (prevH - prev2H) + prevH;
H2L = (prevL - prev2H) + prevL;
L2H = (prevH - prev2L) + prevH;
L2L = (prevL - prev2L) + prevL;
return;
return new Array(H2H.getValue(0),H2L.getValue(0),L2H.getValue (0),L2L.getValue(0));
}
I've tried different variations on this theme, including trying to define another set of variables and then calling the function (i.e., newvar = H2H.getValue(0);...
return new Array(newvar...);
Same result.
Any help woul dbe appreciated.
Comment