Announcement

Collapse
No announcement yet.

2008 July: Leader of the MACD, by Giorgos E. Siligardos, PhD.

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

  • 2008 July: Leader of the MACD, by Giorgos E. Siligardos, PhD.

    File Name: MACD_Leader.efs

    Description:
    The following study is based on the July 2008 article, Leader of the MACD, by Giorgos E. Siligardos, PhD.

    Formula Parameters:
    NA


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


    Download File:
    MACD_Leader.efs



    EFS Code:
    PHP Code:
    /*********************************
    Provided By:  
        eSignal (Copyright © eSignal), a division of Interactive Data 
        Corporation. 2007. 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:        Leader of the MACD
                        by Giorgos E. Siligardos, PhD

    Version:            1.0  5/13/2008

    Notes:
    * July 2008 Issue of Stocks and Commodities Magazine
    * Study requires version 8.0 or later.

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


    function preMain(){
        
    setStudyTitle("MACD Leader");
        
    setPriceStudy(false);
        
    setCursorLabelName("Leader");
    }

    var 
    bVersion    null;
    var 
    bInit false;
    var 
    xMACDLeader null;

    function 
    main(){

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

        if(
    bInit == false){
            
    xMACDLeader efsInternal("Calc");
            
    bInit true;
        }
        
        var 
    nMACDLeader xMACDLeader.getValue(0);
        
        if(
    nMACDLeader==null) return;
        
        return 
    nMACDLeader;
    }

    var 
    xInit false;
    var 
    xMACDSig1 null;
    var 
    xMACDSig2 null;
    var 
    xEMA1 null;
    var 
    xEMA2 null;

    function 
    Calc(){

        if(
    xInit==false){
            
    xMACDSig1 macdSignal(1,12,12);
            
    xMACDSig2 macdSignal(1,26,26);
            
    xEMA1 ema(12);
            
    xEMA2 ema(26);
            
    xInit true;
        }
        
        var 
    nMACDSig1 xMACDSig1.getValue(0);
        var 
    nMACDSig2 xMACDSig2.getValue(0);
        var 
    nEMA1 xEMA1.getValue(0);
        var 
    nEMA2 xEMA2.getValue(0);
        
        if(
    nMACDSig1==null || nMACDSig2==null || nEMA1==null || nEMA2==null) return;
        
        var 
    Indicator1 nEMA1+nMACDSig1;
        var 
    Indicator2 nEMA2+nMACDSig2;
        
        return 
    Indicator1-Indicator2;
    }

    function 
    verify() {
        var 
    false;
        if (
    getBuildNumber() < 779) {
            
    drawTextAbsolute(535"This study requires version 8.0 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;

    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