This version, shown below, is different to the standard KST indicator. It doesn't update on tick charts and stops drawing 13 bars from the last bar. Does anyone have any ideas?
Cheers.
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
var roc6 = new ROCStudy(6, "Close");
var roc10 = new ROCStudy(10, "Close");
var roc15 = new ROCStudy(15, "Close");
var roc20 = new ROCStudy(20, "Close");
function preMain()
{
setStudyTitle("KST");
setCursorLabelName("KST", 0);
setDefaultBarFgColor(Color.blue, 0);
addBand(0, PS_SOLID, 1, Color.black);
}
function main() {
var i;
var vROC6 = roc6.getValue(ROCStudy.ROC,0,-10);
var vROC10 = roc10.getValue(ROCStudy.ROC,0,-10);
var vROC15 = roc15.getValue(ROCStudy.ROC,0,-8);
var vROC20 = roc20.getValue(ROCStudy.ROC,0,-15);
var Sum6 = 0, Sum10 = 0, Sum15 = 0, Sum20 = 0;
if(vROC6 == null || vROC10 == null || vROC15 == null || vROC20 == null)
return;
for(i = 0; i < 15; i++){
if(i < 10)
Sum6 += vROC6[i];
if(i < 10)
Sum10 += vROC10[i];
if(i < 8)
Sum15 += vROC15[i];
Sum20 += vROC20[i];
}
return (Sum6 / 10 + (Sum10 / 10) * 2 + (Sum15 / 8) * 3 + (Sum20 / 15) * 4);
}
Cheers.
/************************************************** *****************
Provided By : TS Support, LLC for eSignal. (c) Copyright 2002
************************************************** ******************/
var roc6 = new ROCStudy(6, "Close");
var roc10 = new ROCStudy(10, "Close");
var roc15 = new ROCStudy(15, "Close");
var roc20 = new ROCStudy(20, "Close");
function preMain()
{
setStudyTitle("KST");
setCursorLabelName("KST", 0);
setDefaultBarFgColor(Color.blue, 0);
addBand(0, PS_SOLID, 1, Color.black);
}
function main() {
var i;
var vROC6 = roc6.getValue(ROCStudy.ROC,0,-10);
var vROC10 = roc10.getValue(ROCStudy.ROC,0,-10);
var vROC15 = roc15.getValue(ROCStudy.ROC,0,-8);
var vROC20 = roc20.getValue(ROCStudy.ROC,0,-15);
var Sum6 = 0, Sum10 = 0, Sum15 = 0, Sum20 = 0;
if(vROC6 == null || vROC10 == null || vROC15 == null || vROC20 == null)
return;
for(i = 0; i < 15; i++){
if(i < 10)
Sum6 += vROC6[i];
if(i < 10)
Sum10 += vROC10[i];
if(i < 8)
Sum15 += vROC15[i];
Sum20 += vROC20[i];
}
return (Sum6 / 10 + (Sum10 / 10) * 2 + (Sum15 / 8) * 3 + (Sum20 / 15) * 4);
}
Comment