Announcement

Collapse
No announcement yet.

KST - Know Sure Thing indicator

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • KST - Know Sure Thing indicator

    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);



    }

  • #2
    If you comment out the "addBand(...)" code line I think you will see the full plot. As you can see in the image below (I loaded the script where the blue vertical line is plotted), in a 1T chart when the indicator is at 0 it is obscured by the band at 0. Other than that I don't know.

    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	14.4 KB
ID:	242849

    Wayne
    Last edited by waynecd; 03-12-2013, 03:33 AM.

    Comment

    Working...
    X