Announcement

Collapse
No announcement yet.

adding triangular ma to "builtin200-alert efs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • adding triangular ma to "builtin200-alert efs

    Wanted to find out if this amTriangular ma can be added to the attached "builtin200-alert efs so it can be edited the same way as the other ma's in the "builtin200-alert efs ?

    PHP Code:
    /*********************************************************
    Alexis C. Montenegro © January 2005                       
    Use and/or modify this code freely. If you redistribute it
    please include this and/or any other comment blocks and a 
    description of any changes you make.                      
    **********************************************************/

    // NOTE:                                                                          
    // This efs requires amStudies.efsLib in the FunctionLibrary folder.              
    // If you do not have this file you can download it at the link below.            
    //http://share.esignal.com/groupcontents.jsp?folder=Formulas-Libraries&groupid=10

    var fpArray = new Array();

    function 
    preMain() {

        
    setPriceStudy(true);
        
    setStudyTitle("Triangular MA");
        
    setCursorLabelName("TMA",0);
        
    setDefaultBarFgColor(Color.blue,0);
        
    setPlotType(PLOTTYPE_LINE,0);
        
    setDefaultBarThickness(1,0);
        
    askForInput();
                
        var 
    x=0;
        
    fpArray[x] = new FunctionParameter("Length"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setLowerLimit(1);        
            
    setDefault(10);
        }
        
    fpArray[x] = new FunctionParameter("Source"FunctionParameter.STRING);
        
    with(fpArray[x++]){
            
    addOption("open"); 
            
    addOption("high");
            
    addOption("low");
            
    addOption("close");
            
    addOption("hl2");
            
    addOption("hlc3");
            
    addOption("ohlc4"); 
            
    setDefault("close"); 
        }
        
    fpArray[x] = new FunctionParameter("Symbol"FunctionParameter.STRING);
        
    with(fpArray[x++]){
            
    setDefault();
        }
        
    fpArray[x] = new FunctionParameter("Interval"FunctionParameter.STRING);
        
    with(fpArray[x++]){
            
    setDefault();
        }
        
    fpArray[x] = new FunctionParameter("Offset"FunctionParameter.NUMBER);
        
    with(fpArray[x++]){
            
    setDefault(0);
        }
        
    fpArray[x] = new FunctionParameter("Params"FunctionParameter.BOOLEAN);
        
    with(fpArray[x++]){
            
    setName("Show Parameters");
            
    setDefault(false);
        }
    }

    var 
    amLib addLibrary("amStudies.efsLib");
    var 
    bInit false;
    var 
    xTMA null;

    function 
    main(Length,Source,Symbol,Interval,Offset,Params) {

        if(
    bInit == false){
            
    withamLib ) {
            if(
    Symbol == nullSymbol getSymbol();
            if(
    Interval == nullInterval getInterval();
            var 
    vSymbol Symbol+","+Interval;
            
    xTMA offsetSeries(amTMA(Length, eval(Source)(sym(vSymbol))), Offset);
            
    setShowTitleParameters(eval(Params));
            
    bInit true;
            }
        }

        return 
    getSeries(xTMA);

    Attached Files
Working...
X