Announcement

Collapse
No announcement yet.

custom study insertion into formula wizard generated code

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

  • custom study insertion into formula wizard generated code

    Hi

    Firstly i'll try and make my situation as clear as i can.

    1. so far ive built my strategy in the Formula Wizard using the Built-In Studies only.

    2. However, now i have got to the stage where i need to code my own Custom Studies which are not in the Built-in folder.

    3. so i read the "Guide to Developing eSignal Indicators" http://kb.esignal.com/display/2/kb/a....aspx?aid=1282

    4. at the bottom of that page there is "Example Code : Matheny Enterprises (Velocity Indicator)"

    5. i copied that code and made an .efs file

    6. i put it into the Builtin folder

    7. but it doesnt show up in the formula wizards's function editor in order for me to edit it.

    8. so after reading the "Core Javascript 1.5 tutorials" i then tried to manually insert that code into the wizards generated code and unfortunately it didnt work.

    9. here is the velocity indicator code example by Brad Metheney


    Code:
    function preMain() { 
    
      setStudyTitle("Velocity2"); 
    
        setCursorLabelName("Velocity2");
    
    } 
    
    
    function main(vLength, vFactor, vSTDLength) {
    
      if (vLength == null) { 
    
        vLength = 7;
    
    } 
    
    
      if (vFactor == null) { 
    
        vFactor = 3; 
    
    } 
    
    
      if (vSTDLength == null) { 
    
        vSTDLength = 11; 
    
    } 
    
    
    
    // create the MA studies. 
    
      var study1 = new MAStudy(vLength, 0, "Close", MAStudy.WEIGHTED); 
    
      var study2 = new MAStudy(vLength * vFactor, 0, "Close", MAStudy.WEIGHTED); 
    
    
    
    //? Get the values of the MA studies???? 
    
      var vMA1 = study1.getValue(MAStudy.MA); 
    
      var vMA2 = study2.getValue(MAStudy.MA);
    
    
    
    //? Test for null returns. 
    
      if((vMA1 == null) || (vMA2 == null)) 
    
      return; 
    
    
        return (vMA1 - vMA2); 
    
    }


    QUESTIONS

    a) so can anyone suggest what might be the problem?

    b) how can i load a custom study into the formula wizard so that i can edit it in function editor? and is that even possible?

    any help will be greatly appreciated and thanks in advance.

    cheers

  • #2
    Re: custom study insertion into formula wizard generated code

    mvd55
    See this post in reply to a similar question
    Alex


    Originally posted by mvd55
    Hi

    Firstly i'll try and make my situation as clear as i can.

    1. so far ive built my strategy in the Formula Wizard using the Built-In Studies only.

    2. However, now i have got to the stage where i need to code my own Custom Studies which are not in the Built-in folder.

    3. so i read the "Guide to Developing eSignal Indicators" http://kb.esignal.com/display/2/kb/a....aspx?aid=1282

    4. at the bottom of that page there is "Example Code : Matheny Enterprises (Velocity Indicator)"

    5. i copied that code and made an .efs file

    6. i put it into the Builtin folder

    7. but it doesnt show up in the formula wizards's function editor in order for me to edit it.

    8. so after reading the "Core Javascript 1.5 tutorials" i then tried to manually insert that code into the wizards generated code and unfortunately it didnt work.

    9. here is the velocity indicator code example by Brad Metheney


    Code:
    function preMain() { 
    
      setStudyTitle("Velocity2"); 
    
        setCursorLabelName("Velocity2");
    
    } 
    
    
    function main(vLength, vFactor, vSTDLength) {
    
      if (vLength == null) { 
    
        vLength = 7;
    
    } 
    
    
      if (vFactor == null) { 
    
        vFactor = 3; 
    
    } 
    
    
      if (vSTDLength == null) { 
    
        vSTDLength = 11; 
    
    } 
    
    
    
    // create the MA studies. 
    
      var study1 = new MAStudy(vLength, 0, "Close", MAStudy.WEIGHTED); 
    
      var study2 = new MAStudy(vLength * vFactor, 0, "Close", MAStudy.WEIGHTED); 
    
    
    
    //? Get the values of the MA studies???? 
    
      var vMA1 = study1.getValue(MAStudy.MA); 
    
      var vMA2 = study2.getValue(MAStudy.MA);
    
    
    
    //? Test for null returns. 
    
      if((vMA1 == null) || (vMA2 == null)) 
    
      return; 
    
    
        return (vMA1 - vMA2); 
    
    }


    QUESTIONS

    a) so can anyone suggest what might be the problem?

    b) how can i load a custom study into the formula wizard so that i can edit it in function editor? and is that even possible?

    any help will be greatly appreciated and thanks in advance.

    cheers

    Comment

    Working...
    X