Announcement

Collapse
No announcement yet.

Klinger Volume Histogram

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

  • Klinger Volume Histogram

    Hello;
    Enclosed is the Klinger Volume OSC efs. Would it be possible to have somone convert it to a Histogram?
    Thanks.....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 = 5;
    var SXAvg_1 = 5;
    var Trigger_1 = 5;

    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,

    Try adding

    setPlotType(PLOTTYPE_HISTOGRAM, 1);

    in your preMain function.

    Steve

    Comment


    • #3
      Klinger Volume Histogram

      Steve;
      Just what I wanted. Perfect. Thanks for your time.....
      Greg

      Comment

      Working...
      X