Announcement

Collapse
No announcement yet.

2004 Nov: Using Volume to Detect Shifts In Power (TRsV.efs)

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2004 Nov: Using Volume to Detect Shifts In Power (TRsV.efs)

    File Name: TRsV.efs

    Description:
    This indicator is based on Using Volume to Detect Shifts In Power by Vadim Gimelfarb, which appeared in the November 2004 issue of Stocks & Commodities.

    Formula Parameters:
    ATR Length: 1
    TRsV Thickness: 2
    Volume Thickness: 3
    TRsV Color: Color.red
    Volume Color: Color.blue
    Display Volume: true

    Notes:
    The background of the bar changes to light grey when the current TRsV value exceeds the prior bar's value by more than 1.5. The related article is copyrighted material. If you are not a subscriber of Stocks & Commodities, please visit www.traders.com.

    Download File:
    TRsV.efs



    EFS Code:
    PHP Code:
    /************************************
    Provided By : eSignal. (c) Copyright 2004
    Study:        Using Volume to Detect Shifts In Power, by Vadim Gimelfarb
    Version:      1.0

    9/3/2004

    Notes:
    The background of the bar changes to light grey when the current
    TRsV value exceeds the prior bar's value by more than 1.5.

    Formula Parameters:                 Default:
    ATR Length                          1
    TRsV Thickness                      2
    Volume Thickness                    3
    TRsV Color                          Color.red
    Volume Color                        Color.blue
    Display Volume                      true
    ************************************/

    function preMain() {
        
    setStudyTitle("True Range Specified Volume ");

        
    // TRsV
        
    setCursorLabelName("TRsV"0);
        
    setDefaultBarFgColor(Color.red0);
        
    setDefaultBarThickness(20);
        
        
    // Volume
        
    setCursorLabelName("Vol"1);
        
    setDefaultBarFgColor(Color.blue1);
        
    setDefaultBarThickness(31);
        
    setPlotType(PLOTTYPE_HISTOGRAM1);

        
    setShowTitleParameters(false);
        
        var 
    fp1 = new FunctionParameter("nTRlength"FunctionParameter.NUMBER);
        
    fp1.setName("ATR Length");
        
    fp1.setLowerLimit(0);
        
    fp1.setDefault(1);
        
        var 
    fp2 = new FunctionParameter("nThick0"FunctionParameter.NUMBER);
        
    fp2.setName("TRsV Thickness");
        
    fp2.setLowerLimit(1);
        
    fp2.setDefault(2);

        var 
    fp2a = new FunctionParameter("nThick1"FunctionParameter.NUMBER);
        
    fp2a.setName("Volume Thickness");
        
    fp2a.setLowerLimit(1);
        
    fp2a.setDefault(3);

        var 
    fp3 = new FunctionParameter("cColor0"FunctionParameter.COLOR);
        
    fp3.setName("TRsV Color");
        
    fp3.setDefault(Color.red);

        var 
    fp3a = new FunctionParameter("cColor1"FunctionParameter.COLOR);
        
    fp3a.setName("Volume Color");
        
    fp3a.setDefault(Color.blue);

        var 
    fp4 = new FunctionParameter("bVol"FunctionParameter.BOOLEAN);
        
    fp4.setName("Display Volume");
        
    fp4.setDefault(true);
    }

    var 
    bEdit true;
    var 
    nCntr 0
    var 
    vATR null;
    var 
    nTRsV null;
    var 
    nTRsV1 null;

    function 
    main(nTRlengthnThick0nThick1cColor0cColor1bVol) {
        if (
    bEdit == true) {
            
    setDefaultBarFgColor(cColor00);
            
    setDefaultBarThickness(nThick00);
            
    setDefaultBarFgColor(cColor11);
            
    setDefaultBarThickness(nThick11);
            if (
    vATR == nullvATR = new ATRStudy(nTRlength);
            
    bEdit false;
        }

        if (
    getBarState() == BARSTATE_NEWBAR && nTRsV != null) {
            
    nTRsV1 nTRsV;
            
    nCntr++;
            if (
    nCntr 200nCntr 0;
        }

        
    bVol = eval(bVol);
        
        var 
    nATR vATR.getValue(ATRStudy.ATR);
        if (
    nATR == null) return;
        
        var 
    nVol volume();
        if (
    nATR == 0) {
            
    nTRsV 0;
        } else {
            
    nTRsV nVol nATR;
        }
        
        if (
    nTRsV1 != null) {
            if ( (
    nTRsV nTRsV1) > 1.5setBarBgColor(Color.lightgrey);
        }
        
        if (!
    bVolnVol += "";
        
        
        return new Array(
    nTRsVnVol);

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation
Working...
X