Announcement

Collapse
No announcement yet.

Editing Out Menu In Existing EFS

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

  • Editing Out Menu In Existing EFS

    Hi,

    I downloaded a free EFS from a website and would like to send it to a friend, however, I have edited the script with all of the necessary defaults for the particular chart my buddy is looking at. He is completely new to eS and I want to remove ALL the input variables that are currenly available if you select the 'edit' option.

    Is there a way I can simply 'hide' all of the input options for the study so he cannot make any changes? In other words you 'instert study' and all the defaults I have now loaded are contained (as they are now) but he cannot click a menu/entry and change it, other than perhaps a few basics like colour? If this is too difficult and I simply need to remove all options, thats ok too.

    I am not a programmer myself so the specific script or link to would be appreciated please!

    Many thanks,

    HP

  • #2
    Hi,

    Just remove all of the FunctionParameter code block, convert the main parameters to global variables with required values, and remove these parameters from the "function main()".

    This sample code has the menu options intact:
    PHP Code:
    function preMain(){
        var 
    aFPArray = new Array();
        
    setPriceStudy(true);
        
    setCursorLabelName("",0);
        
    setDefaultBarFgColor(Color.blue,0);
        
    setDefaultBarThickness(2,0);
        
        var 
    x=0;
        
    aFPArray[x] = new FunctionParameter("vSymbol"FunctionParameter.STRING);
        
    with(aFPArray[x++]){
            
    setName("Symbol");
            
    setDefault();
        }
        
    aFPArray[x] = new FunctionParameter("Interval"FunctionParameter.STRING);
        
    with(aFPArray[x++]){
            
    setName("Interval");
            
    setDefault();
        }
        
    aFPArray[x] = new FunctionParameter("Length"FunctionParameter.NUMBER);
        
    with(aFPArray[x++]){
            
    setName("Interval");
            
    setDefault();
        }
        
    aFPArray[x] = new FunctionParameter("PlotX"FunctionParameter.BOOLEAN);
        
    with(aFPArray[x++]){
            
    setDefault(false);
        }
        
    aFPArray[x] = new FunctionParameter("LineClr"FunctionParameter.COLOR);
        
    with(aFPArray[x++]){
            
    setName("Line Color");
            
    setDefault(Color.red);
        }
    }

    var 
    bInit=false;
    function 
    main(vSymbol,Interval,Length,PlotX,LineClr){
        if(!
    bInit){
            var 
    Sym=null,Intvl=null;
            if(
    vSymbol==nullSym=getSymbol();
            else 
    Sym=vSymbol;
            if(
    Interval==nullIntvl=getInterval();
            else 
    Intvl=Interval;
            
    Sym=Sym+","+Intvl;
            
    bInit=true;
        }
        
    //code here
        
    return;

    Here is one way to remove "Edit Menu" access to values in the script (the user can change plot colors via the edit menu for all plotted values). Leave any menu items you want the user to access in preMain and add the parameter names to the main function as parameters .

    PHP Code:
    function preMain(){
        var 
    aFPArray = new Array();
        
    setPriceStudy(true);
        
    setCursorLabelName("",0);
        
    setDefaultBarThickness(2,0);
        
        var 
    x=0;
        
    aFPArray[x] = new FunctionParameter("LineClr"FunctionParameter.COLOR);
        
    with(aFPArray[x++]){
            
    setName("Line Color");
            
    setDefault(Color.red);
        }
    }
    //global variables
    var bInit=false;
    var 
    vSymbol=null;
    var 
    Interval=null;
    var 
    Length=null;//create parameters into these global variables
    var PlotX=false;//you can add the values here or in bInit as I did with "Length"

    function main(LineClr){//remove unwanted main parameters and convert them to global variables with values.
        
    if(!bInit){
            if(
    vSymbol==nullvSymbol=getSymbol();
            if(
    Interval==nullInterval=getInterval();
            
    Length=7;//add values to the converted parameters
            
    setDefaultBarFgColor(LineClr,0);
            
    bInit=true;
        }
        
    //code here
        
    return;

    Note: the user can still see the values for the variables by opening the efs script. To prevent that you would need to encrypt the efs study.

    Wayne
    Last edited by waynecd; 01-13-2014, 05:30 AM.

    Comment


    • #3
      Thanks Wayne!
      I know you just answered my question PERFECTLY but I have NO idea what that means...

      My trouble is I don't know what values/variables are actually necessary for the script to operate normally, I have simply found the ones which change the output, I haven't a clue what the rest of these things mean!

      HP

      Comment


      • #4
        Consider going over tutorials at:

        and


        I am not a programmer myself so the specific script or link to would be appreciated please!
        I don't know which script you are using, posting it would be helpful.
        My trouble is I don't know what values/variables are actually necessary for the script to operate normally,
        I expect all values/variables are necessary. Programmers normally only include necessary code.

        Wayne
        Last edited by waynecd; 01-13-2014, 11:47 AM.

        Comment

        Working...
        X