Announcement

Collapse
No announcement yet.

2016 Mar: ADX Breakouts by Ken Calhoun

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

  • 2016 Mar: ADX Breakouts by Ken Calhoun

    File Name: ADX.efs

    Description:
    ADX Breakouts by Ken Calhoun

    Formula Parameters:

    ADX.efs
    Length: 14
    Smoothing: 14
    ADX Trigger Level: 40

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

    Download File:
    ADX.efs

    ADX.efs


    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
    eSignal (Copyright c eSignal), a division of Interactive Data 
    Corporation. 2016. All rights reserved. This sample eSignal 
    Formula Script (EFS) is for educational purposes only and may be 
    modified and saved under a new file name.  eSignal is not responsible
    for the functionality once modified.  eSignal reserves the right 
    to modify and overwrite this EFS file with each new release.

    Description:        
        ADX Breakouts by Ken Calhoun

    Version:            1.00  01/11/2016

    Formula Parameters:                     Default:
    Length                                  14
    Smoothing                               14
    ADX Trigger Level                       40


    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(){
        
    setPriceStudy(false);
        
    setStudyTitle("ADX Breakouts");
        
    setCursorLabelName("ADX",0);
        
        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("Length"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setLowerLimit(1);        
            
    setDefault(14);
        }
        
    fpArray[x] = new FunctionParameter("Smoothing"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setLowerLimit(1);        
            
    setDefault(14);
        }
        
    fpArray[x] = new FunctionParameter("TriggerLevel"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setName("ADX Trigger Level");
            
    setLowerLimit(1);        
            
    setDefault(40);
        }
    }

    var 
    bInit false;
    var 
    xADX null;
    var 
    vLongFlag false;
    var 
    vLongFlag1 false;
    var 
    vFullDate 0
    var vTriggerDate;
    var 
    bVersion null;

    function 
    main(LengthSmoothingTriggerLevel){
        
        if (
    bVersion == nullbVersion verify();
        if (
    bVersion == false) return;

        
        if(
    getBarState() == BARSTATE_ALLBARS){
            
    bInit false;
        }

        if (!
    bInit){
            
    xADX adx(Length,Smoothing);
            
    addBand(TriggerLevelPS_SOLID1Color.lightgrey"Trigger")
            
    vLongFlag false;
            
    vLongFlag1 false;
            
    vFullDate 0;
            
    bInit true;
        }

        if(
    xADX.getValue(-1) == null) return;

        if( 
    getBarState() == BARSTATE_NEWBAR){
            var 
    oBarDate getValue("time");
            var 
    vYear  oBarDate.getFullYear().toString();
            var 
    vMonth = (oBarDate.getMonth()+1) < 10"0"+(oBarDate.getMonth()+1): oBarDate.getMonth()+1;
            var 
    vDate  oBarDate.getDate() < 10"0"+oBarDate.getDate(): oBarDate.getDate();
            
    vFullDate = (vYear+vMonth+vDate)*1;
            
    vLongFlag1 vLongFlag;
        }

        if(
    xADX.getValue(0) > TriggerLevel && xADX.getValue(-1) < TriggerLevel){
            
    vTriggerDate vFullDate;
            
    vLongFlag true;
            
    drawTextRelative(0TriggerLevel-2.00"\u00E1"Color.greennullText.TOP|Text.CENTER"Wingdings"10"UpArrow"+rawtime(0));
        } else{
            
    vLongFlag vLongFlag1
            removeText
    ("UpArrow"+rawtime(0))
        }

        if(
    day(0)!=day(-1) && vFullDate >= vTriggerDate+&& vLongFlag){
            var 
    nHigh formatPriceNumber(high(-1inv("d"))+0.50);
            
    drawText("Suggested Long Entry at "+nHigh,TopRow1,Color.green,Text.LEFT,"Text"+rawtime(0));
            
    vLongFlag false;
        }

        return 
    xADX.getValue(0);
    }

    function 
    verify(){
        var 
    false;
        if (
    getBuildNumber() < 779){
            
            
    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 upgrade.@URL=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