File Name: Star_MA.efs, Star_MACD.efs

Description:
Zero In On The MACD by Barbara Star

Formula Parameters:

Star_MA.efs

Fast MACD Length: 12
Slow MACD Length: 26
Weighted Average Length: 34
Exponential Average Length: 55
Default Price Bar Color: dark grey
Color Price Bars based on MACD: true
Color when MACD above 0: blue
Color when MACD below 0: red
Show Arrow at MACD crossing 0: true
Up Arrow Color: blue
Down Arrow Color: red
Show Warning Diamonds: true
Upper Diamond Color: magenta
Lower Diamond Color: grey
Show Parameters: false

Star_MACD.efs

Fast MACD Length: 12
Slow MACD Length: 26
Default MACD Color: blue
Default Price Bar Color: dark grey
Color MACD: true
Color Price Bars based on MACD: true
Color when MACD above 0: blue
Color when MACD below 0: red
Show Parameters: false

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

Download File:
Star_MA.efs
Star_MACD.efs

Star_MA.efs, Star_MACD.efs


EFS Code:

Star_MA.efs
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:         
    Zero in on MACD by Barbara Star 

Formula Parameters:                     Default: 
Fast MACD Length                        12 
Slow MACD Length                        26
Weighted Average Length                 34
Exponential Average Length              55
Default Price Bar Color                 dark grey
Color Price Bars based on MACD          true
Color when MACD above 0                 blue
Color when MACD below 0                 red
Show Arrow at MACD crossing 0           true
Up Arrow Color                          blue
Down Arrow Color                        red
Show Warning Diamonds                   true
Upper Diamond Color                     magenta
Lower Diamond Color                     grey
Show Parameters                         false

Version:            1.00  11/23/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(){

    
setPriceStudy(true)
    
setStudyTitle("Star Warning");
    
setCursorLabelName("AvgW",0);
    
setCursorLabelName("AvgE",1);
    
setDefaultBarFgColor(Color.green0);
    
setDefaultBarFgColor(Color.red1);
    
setDefaultBarThickness(1,0);
    
setDefaultBarThickness(1,1);
    
setColorPriceBars(true);
    
setDefaultPriceBarColor(Color.RGB(110,110,110));
        
    var 
x=0;
    
fpArray[x] = new FunctionParameter("Fast"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Fast MACD Length");    
        
setLowerLimit(1);        
        
setDefault(12);
    }
    
fpArray[x] = new FunctionParameter("Slow"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Slow MACD Length");    
        
setLowerLimit(1);        
        
setDefault(26);
    }
    
fpArray[x] = new FunctionParameter("AvgW"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Weighted Avg Length");
        
setLowerLimit(1);        
        
setDefault(34);
    }
    
fpArray[x] = new FunctionParameter("AvgE"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Exponential Avg Length");
        
setLowerLimit(1);        
        
setDefault(55);
    }
    
fpArray[x] = new FunctionParameter("DefaultPBColor"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Default Price Bar Color");        
        
setDefault(Color.RGB(110,110,110));
    }
    
fpArray[x] = new FunctionParameter("ColorPriceBars"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Color Price Bars based on MACD");        
        
setDefault(true);
    }
    
fpArray[x] = new FunctionParameter("MACDColorUp"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Color when MACD above 0");        
        
setDefault(Color.blue);
    }
    
fpArray[x] = new FunctionParameter("MACDColorDn"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Color when MACD below 0");        
        
setDefault(Color.red);
    }
    
fpArray[x] = new FunctionParameter("showArrow"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Show Arrow at MACD crossing 0");        
        
setDefault(true);
    }
    
fpArray[x] = new FunctionParameter("ArrowUp"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Up Arrow Color");        
        
setDefault(Color.blue);
    }
    
fpArray[x] = new FunctionParameter("ArrowDn"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Down Arrow Color");        
        
setDefault(Color.red);
    }
    
fpArray[x] = new FunctionParameter("showDiamond"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Show Warning Diamonds");        
        
setDefault(true);
    }
    
fpArray[x] = new FunctionParameter("DiamondUp"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Upper Diamond Color");        
        
setDefault(Color.magenta);
    }
    
fpArray[x] = new FunctionParameter("DiamondDn"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Lower Diamond Color");        
        
setDefault(Color.grey);
    }
    
fpArray[x] = new FunctionParameter("Params"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Show Parameters");        
        
setDefault(false);
    }
}

var 
bInit false;
var 
xMACD null;
var 
xAvgW null;
var 
xAvgE null;
var 
bVersion null

function 
main(FastSlowAvgWAvgEDefaultPBColorColorPriceBarsMACDColorUpMACDColorDn
              
showArrowArrowUpArrowDnshowDiamondDiamondUpDiamondDnParams){

    if (
bVersion == nullbVersion verify(); 
    if (
bVersion == false) return;               
    
    if(
bInit == false){
        
xMACD macd(FastSlow1);
        
xAvgW wma(AvgW);
        
xAvgE ema(AvgE)
        
setDefaultPriceBarColor(DefaultPBColor);
        
setShowTitleParameters(eval(Params));
        
bInit true;
    }

    var 
nMACD xMACD.getValue(0);
    var 
nMACD_1 xMACD.getValue(-1);
    var 
nAvgW xAvgW.getValue(0);
    var 
nAvgE xAvgE.getValue(0);
    var 
nRawtime rawtime(0);

    if(
nMACD_1 == null || nAvgW == null || nAvgE == null) return;
    
    if(
ColorPriceBars){
        if(
nMACD 0){
            
setPriceBarColor(MACDColorUp);
        }
        if(
nMACD 0){
            
setPriceBarColor(MACDColorDn);
        }
    }

    if(
showArrow){
        if(
nMACD && nMACD_1 <= 0){
            
drawShape(Shape.UPARROWBelowBar2ArrowUp"UpArrow"+nRawtime);
        } else {
            
removeShape("UpArrow"+nRawtime);
        }
        if(
nMACD && nMACD_1 >= 0){
            
drawShape(Shape.DOWNARROWAboveBar2ArrowDn"DnArrow"+nRawtime);
        } else {
            
removeShape("DnArrow"+nRawtime);
        }
    }

    if(
showDiamond){
        if(
close(0) < nAvgW && high(0) >= nAvgE){
           
drawShape(Shape.DIAMONDAboveBar1DiamondUp,  "UpDiamond"+nRawtime);
        } else {
            
removeShape("UpDiamond"+nRawtime);
        }
        if(
nAvgE nAvgW && close(0) > nAvgW){
            
drawShape(Shape.DIAMONDBelowBar1DiamondDn"DnDiamond"+nRawtime);
        } else {
            
removeShape("DnDiamond"+nRawtime);
        }
    }
    
    return [
nAvgWnAvgE];
}

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

Star_MACD.efs
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:         
    Zero in on MACD by Barbara Star 

Formula Parameters:                     Default: 
Fast MACD Length                        12 
Slow MACD Length                        26
Default MACD Color                      blue
Default Price Bar Color                 dark grey
Color MACD                              true
Color Price Bars based on MACD          true
Color when MACD above 0                 blue
Color when MACD below 0                 red
Show Parameters                         false

Version:            1.00  11/23/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("Star MACD");
    
setCursorLabelName("MACD",0);
    
setDefaultBarFgColor(Color.RGB(0xFE,0x00,0x6D), 0);
    
setPlotType(PLOTTYPE_HISTOGRAM,0); 
    
setDefaultBarThickness(2,0);
    
setColorPriceBars(true);
    
setDefaultPriceBarColor(Color.RGB(110,110,110));
        
    var 
x=0;
    
fpArray[x] = new FunctionParameter("Fast"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Fast MACD Length");    
        
setLowerLimit(1);        
        
setDefault(12);
    }
    
fpArray[x] = new FunctionParameter("Slow"FunctionParameter.NUMBER);
    
with(fpArray[x++]){
        
setName("Slow MACD Length");    
        
setLowerLimit(1);        
        
setDefault(26);
    }
    
fpArray[x] = new FunctionParameter("DefaultMACDColor"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Default MACD Color");        
        
setDefault(Color.blue);
    }
    
fpArray[x] = new FunctionParameter("DefaultPBColor"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Default Price Bar Color");        
        
setDefault(Color.RGB(110,110,110));
    }
    
fpArray[x] = new FunctionParameter("ColorMACD"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Color MACD");        
        
setDefault(true);
    }
    
fpArray[x] = new FunctionParameter("ColorPriceBars"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Color Price Bars based on MACD");        
        
setDefault(true);
    }
    
fpArray[x] = new FunctionParameter("MACDColorUp"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Color when MACD above 0");        
        
setDefault(Color.blue);
    }
    
fpArray[x] = new FunctionParameter("MACDColorDn"FunctionParameter.COLOR);
    
with(fpArray[x++]){
        
setName("Color when MACD below 0");        
        
setDefault(Color.red);
    }
    
fpArray[x] = new FunctionParameter("Params"FunctionParameter.BOOLEAN);
    
with(fpArray[x++]){
        
setName("Show Parameters");        
        
setDefault(false);
    }
}

var 
bInit false;
var 
xMACD null;
var 
bVersion null

function 
main(FastSlowDefaultMACDColorDefaultPBColorColorMACDColorPriceBarsMACDColorUpMACDColorDnParams){

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

    if(
bInit == false){
        
xMACD macd(FastSlow1);
        
setDefaultPriceBarColor(DefaultPBColor);
        
setDefaultBarFgColor(DefaultMACDColor);
        
setShowTitleParameters(eval(Params));
        
bInit true;
    }

    var 
nMACD xMACD.getValue(0);

    if(
nMACD == null) return;
    
    if(
nMACD 0){
        if(
ColorMACD){
            
setBarFgColor(MACDColorUp,0);
        }
        if(
ColorPriceBars){
            
setPriceBarColor(MACDColorUp);
        }
    }
    if(
nMACD 0){
        if(
ColorMACD){
            
setBarFgColor(MACDColorDn,0);
        }
        if(
ColorPriceBars){
            
setPriceBarColor(MACDColorDn);
        }
    }
    
    return 
nMACD;
}

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