I've downloaded a few .efs files from esignal which contain code that has been "commented out". In particular, the following code for Blau Candlestick Oscillator has some code at the bottom which may or may not have anything to do with the live code.
What is it? What is it for? How do you incorporate it into the rest of the study? Is the rest of the study of any value without that code? What's going on? And why wouldn't the programmer take the 30 seconds it would take to type in a comment that explains the 'dead code'?
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Blau's CI");
setCursorLabelName("Blau's CI",0);
setDefaultBarFgColor(Color.red,0);
addBand(0, PS_DASH, 2, Color.purple);
}
var EMA_1 = 0;
var EMA1_1 = 0;
var vEMA_1 = 0;
var vEMA1_1 = 0;
function main(r,s)
{
if (r == null)
r = 32;
if(s == null)
s = 12;
var K = 2 / (r + 1);
var K1 = 2 / (s + 1);
EMA = K * (close() - open()) + (1 - K) * EMA_1;
EMA1 = K1 * EMA + (1 - K1) * EMA1_1;
vEMA = K * (high() - low()) + (1 - K) * vEMA_1;
vEMA1 = K1 * vEMA + (1 - K1) * vEMA1_1;
if (getBarState() == BARSTATE_NEWBAR){
EMA_1 = EMA;
EMA1_1 = EMA1;
vEMA_1 = vEMA;
vEMA1_1 = vEMA1;
}
if(vEMA1 != 0)
return EMA1 / vEMA1;
else
return;
}
/*
{w. Blau's Candlestick Indicator}
Inputs: r(32), Zeroline(0);
Value1 = ErgCSI(r, 5, 1);
Value2 = XAverage(CSI(r, 5, 1), 5);
Plot1(Value1, "ErgCSI");
Plot2(Value2, "SigLin");
Plot3(ZeroLine, "Zero");
*/
What is it? What is it for? How do you incorporate it into the rest of the study? Is the rest of the study of any value without that code? What's going on? And why wouldn't the programmer take the 30 seconds it would take to type in a comment that explains the 'dead code'?
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
function preMain()
{
setStudyTitle("Blau's CI");
setCursorLabelName("Blau's CI",0);
setDefaultBarFgColor(Color.red,0);
addBand(0, PS_DASH, 2, Color.purple);
}
var EMA_1 = 0;
var EMA1_1 = 0;
var vEMA_1 = 0;
var vEMA1_1 = 0;
function main(r,s)
{
if (r == null)
r = 32;
if(s == null)
s = 12;
var K = 2 / (r + 1);
var K1 = 2 / (s + 1);
EMA = K * (close() - open()) + (1 - K) * EMA_1;
EMA1 = K1 * EMA + (1 - K1) * EMA1_1;
vEMA = K * (high() - low()) + (1 - K) * vEMA_1;
vEMA1 = K1 * vEMA + (1 - K1) * vEMA1_1;
if (getBarState() == BARSTATE_NEWBAR){
EMA_1 = EMA;
EMA1_1 = EMA1;
vEMA_1 = vEMA;
vEMA1_1 = vEMA1;
}
if(vEMA1 != 0)
return EMA1 / vEMA1;
else
return;
}
/*
{w. Blau's Candlestick Indicator}
Inputs: r(32), Zeroline(0);
Value1 = ErgCSI(r, 5, 1);
Value2 = XAverage(CSI(r, 5, 1), 5);
Plot1(Value1, "ErgCSI");
Plot2(Value2, "SigLin");
Plot3(ZeroLine, "Zero");
*/
Comment