Announcement

Collapse
No announcement yet.

KVO thickening lines

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

  • KVO thickening lines

    Hello;
    Does anyone know how to thicken the lines in the KVO?
    They are hard to see.
    Here is the EFS.
    THX...Greg
    /************************************************** *****************
    Description : This Study Plots Klinger Volume Oscillator
    Provided By : TS Support, LLC for eSignal
    ************************************************** ******************/

    function preMain(){
    setStudyTitle("Klinger Volume Oscillator");
    setCursorLabelName("KVO",0);
    setDefaultBarFgColor(Color.red,0);
    setDefaultBarFgColor(Color.brown,1);
    setComputeOnClose();
    addBand(0, PS_SOLID, 1, Color.black);
    }

    var FXAvg_1 = 3;
    var SXAvg_1 = 3;
    var Trigger_1 = 3;

    function main(FastX, SlowX, TrigLen, Smooth){
    if(FastX == null)
    FastX = 34;
    if(SlowX == null)
    SlowX = 55;
    if(TrigLen == null)
    TrigLen = 13;
    if(Smooth == null)
    Smooth = 1;
    var KFastX = 2 / (FastX + 1), KSlowX = 2 / (SlowX + 1), KTrig = 2 / (TrigLen + 1);

    if(high() + low() + close() > high(-1) + low(-1) + close(-1))
    Trend = 1;
    else
    Trend = -1;

    VForce = volume() * Trend * 100;

    FXAvg = KFastX * VForce + (1 - KFastX) * FXAvg_1;
    SXAvg = KSlowX * VForce + (1 - KSlowX) * SXAvg_1;


    KVO = FXAvg - SXAvg;
    Trigger = KTrig * KVO + (1 - KTrig) * Trigger_1;

    if (getBarState() == BARSTATE_NEWBAR){
    FXAvg_1 = FXAvg;
    SXAvg_1 = SXAvg;
    Trigger_1 = Trigger;
    }

    return new Array(KVO,Trigger);
    }

  • #2
    Greg
    You do that by adding the required setDefaultBarThickness() statements in preMain()
    In the specific case of the script you posted add the following two lines of code in preMain()
    setDefaultBarThickness(2,0);
    setDefaultBarThickness(2,1);

    The first parameter controls the thickness of the plot and the second one assigns the command to the item in the return statement (0 is the first item, 1 is the second, etc)
    Alex

    Comment


    • #3
      Alex;
      Works like a charm. Thanks again for all you do.
      Have a great week....greg

      Comment


      • #4
        Greg
        My pleasure. You too have a great week
        Alex

        Comment

        Working...
        X