Announcement

Collapse
No announcement yet.

Using efs() to call external efs studies

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

  • Using efs() to call external efs studies

    This is the parameters for efs():
    myVar = efs( "myCustomEFS.efs", 0, sym( "IBM,15" ), 20, 5 );

    I'm having an error return: Formula file not found. Do I have to include the entire path to the efs in parantheses?("C:\Program Files\eSignal\Formulas\Downloads\myCustomEFS.efs")

    And what is the correct syntax if I do not want to specify a symbol and interval and don't want to override any of myCustomEFS.efs parameters?

    efs("C:\Program Files\eSignal\Formulas\Downloads\mycustom.efs", 0, 0, 0, 0);

  • #2
    WilliamV
    If the efs you are calling is in a different folder then you need to add the path which in your example would be "/Downloads/myCustomEFS.efs"
    As to the parameters you can simply omit them. The enclosed example will use the efs() function to call the customStoch study that is in the EFS 2 Custom folder
    Alex

    PHP Code:
    function preMain() {
        
    setPriceStudy(false);
        
    setStudyTitle("Stochastic");
        
    setCursorLabelName("%K",0);
        
    setCursorLabelName("%D",1);
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.red1);
        
    setPlotType(PLOTTYPE_LINE,0);
        
    setPlotType(PLOTTYPE_LINE,1);
        
    setDefaultBarThickness(1,0);
        
    setDefaultBarThickness(1,1);
    }

    function 
    main() {

        var 
    efs("/EFS 2 Custom/customStoch.efs",0);
        var 
    efs("/EFS 2 Custom/customStoch.efs",1);

        return new Array (
    K,D);

    Comment


    • #3
      That worked! Thank you.

      Where does the efs have to be in order not to have to add additional path?

      Comment


      • #4
        WilliamV
        In the same folder of the called efs in which case you would just use efs("myCustomEFS.efs", <series index>, etc);
        Alex

        Comment


        • #5
          That certainly is a great capability addition to Esignal. As is the diffrent time intervals.

          Now if I could only add and most importantly write the correct entry and stop parameters

          Comment


          • #6
            I want to plot the difference between two moving averages that will be called bia efs(), but it's not returning a value.

            Here is the script:

            function preMain() {
            setPriceStudy(false);
            setColorPriceBars(true);
            setDefaultPriceBarColor(Color.black);
            }

            function main() {
            if((MA1 == null) || (MA2 == null)) return;
            var MA1= efs("/Downloads/MA1.efs")
            var MA2= efs("/Downloads/MA2.efs")


            return (MA2-MA1);
            }

            What am I missing?

            Comment


            • #7
              WilliamV
              Try the enclosed revision
              Alex

              PHP Code:
              function preMain() {
                  
              setPriceStudy(false);
                  
              setColorPriceBars(true);
                  
              setDefaultPriceBarColor(Color.black);
              }

              function 
              main() {
                  
              //if((MA1 == null)  || (MA2 == null)) return; //removed
                  
              var MA1efs("/Downloads/MA1.efs",0);//added series index
                  
              var MA2efs("/Downloads/MA2.efs",0)//as above
                  
                  
                  
              return (MA2-MA1);

              Comment


              • #8
                With a little digging and a little help the EFS2 language is making more sense.

                Can't express how valuable your help is to me. Thank you Alex.

                Comment


                • #9
                  WilliamV
                  Glad to hear that and you are most welcome
                  Alex

                  Comment

                  Working...
                  X