Announcement

Collapse
No announcement yet.

2015 Aug (June): The Slow Volume Strength Index by Vitali Apirine

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

  • 2015 Aug (June): The Slow Volume Strength Index by Vitali Apirine

    File Name: SVSI.efs

    Description:
    The Slow Volume Strength Index by Vitali Apirine

    Formula Parameters:

    SVSI.efs
    Length EMA: 6
    Length Average Differences: 14
    Upper Bound: 80
    Lower Bound: 20

    Notes:
    The related article is copyrighted material. If you are not a subscriber
    of Stocks & Commodities, please visit www.traders.com.

    Download File:
    SVSI.efs

    SVSI.efs


    EFS Code:
    PHP Code:

    /*********************************
    Provided By:  
        Interactive Data Corporation (Copyright В© 2015) 
        All rights reserved. This sample eSignal Formula Script (EFS)
        is for educational purposes only. Interactive Data Corporation
        reserves the right to modify and overwrite this EFS file with 
        each new release. 

    Description:        
        The Slow Volume Strength Index by Vitali Apirine

    Formula Parameters:                     Default:
    Length EMA                              6
    Length Average Differences              14 
    Upper Bound                             80
    Lower Bound                             20

    Version:            1.00  06/05/2015

    Notes:
        The related article is copyrighted material. If you are not a subscriber
        of Stocks & Commodities, please visit www.traders.com.

    **********************************/

    var fpArray = new Array(); 

    function 
    preMain(){

        
    setStudyTitle("SVSI");
        
        
    setCursorLabelName("Upper Bound"0);
        
    setCursorLabelName("Lower Bound"1);
        
    setCursorLabelName("Center Line"2);
        
    setCursorLabelName("SVSI"3);
        
        
    setDefaultBarFgColor(Color.grey0);
        
    setDefaultBarFgColor(Color.grey1);
        
    setDefaultBarFgColor(Color.grey2);
            
        
    setShowCursorLabel(false0);
        
    setShowCursorLabel(false1);
        
    setShowCursorLabel(false2);
        
    setShowCursorLabel(true3);
        
        
    setDefaultBarStyle(PS_SOLID0);
        
    setDefaultBarStyle(PS_SOLID1);
        
    setDefaultBarStyle(PS_DASHDOT2);
        
    setDefaultBarStyle(PS_SOLID3);

        var 
    0;

        
    fpArray[x] = new FunctionParameter("fpLengthEMA"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("Length EMA");
            
    setLowerLimit(1); 
            
    setDefault(6);
        };

        
    fpArray[x] = new FunctionParameter("fpLengthAvgDiff"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("Length Average Differences");
            
    setLowerLimit(1);
            
    setDefault(14);
        };

        
    fpArray[x] = new FunctionParameter("fpSRSIHighBorder"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("Upper Bound");    
            
    setLowerLimit(0);
            
    setUpperLimit(100); 
            
    setDefault(80);
        };
        
        
    fpArray[x] = new FunctionParameter("fpSRSILowBorder"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("Lower Bound");    
            
    setLowerLimit(0);
            
    setUpperLimit(100); 
            
    setDefault(20);
        };
    }

    var 
    bInit false;
    var 
    bVersion null;

    var 
    xDifferences null;
    var 
    xPositiveDiff null;
    var 
    xNegativeDiff null;
    var 
    xPositiveDiffAvg null;
    var 
    xNegativeDiffAvg null;

    function 
    main(fpLengthEMAfpLengthAvgDifffpSRSIHighBorderfpSRSILowBorder){

        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;

        if (!
    bInit){

            
    xDifferences efsInternal('Calc_Differences'fpLengthEMA);
            
    xPositiveDiff getSeries(xDifferences0);
            
    xNegativeDiff getSeries(xDifferences1);
            
            
    xPositiveDiffAvg smma(fpLengthAvgDiffxPositiveDiff);
            
    xNegativeDiffAvg smma(fpLengthAvgDiffxNegativeDiff);
                          
            
    bInit true
        };

        var 
    nPositiveDiffAvg xPositiveDiffAvg.getValue(0);
        var 
    nNegativeDiffAvg xNegativeDiffAvg.getValue(0);

        if (
    nPositiveDiffAvg == null || nNegativeDiffAvg == null)
            return;
        
        var 
    nSVSI = (nNegativeDiffAvg == 0) ? 100 100 - (100 / (+ (nPositiveDiffAvg nNegativeDiffAvg)));
        
        return [
    fpSRSIHighBorderfpSRSILowBorder50nSVSI];
    }

    var 
    xClose null;
    var 
    xEMA null;
    var 
    xVol null;

    function 
    Calc_Differences(nLength){
        
        if (
    getBarState() == BARSTATE_ALLBARS){
            
    xClose close();
            
    xEMA ema(nLength);
            
    xVol volume();
        }
        
        var 
    nClose xClose.getValue(0);
        var 
    nEMA xEMA.getValue(0);
        var 
    nVol xVol.getValue(0);
        
        if (
    nClose == null || nEMA == null || nVol == null)
            return;
        
        var 
    nPositiveDiff nClose nEMA nVol 0;
        var 
    nNegativeDiff nClose nEMA nVol 0;
        
        return [
    nPositiveDiffnNegativeDiff];
    }

    function 
    verify(){
        var 
    false;
        if (
    getBuildNumber() < 3742){
            
            
    drawTextAbsolute(535"This study requires version 12.1 or later."
                
    Color.whiteColor.blueText.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"error");
            
    drawTextAbsolute(520"Click HERE to [email protected]=http://www.esignal.com/download/default.asp"
                
    Color.whiteColor.blueText.RELATIVETOBOTTOM|Text.RELATIVETOLEFT|Text.BOLD|Text.LEFT,
                
    null13"upgrade");
            return 
    b;
        } 
        else
            
    true;
        
        return 
    b;

Working...
X