Announcement

Collapse
No announcement yet.

simple efs help

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

  • simple efs help

    Could someone show me how to get my signals to update with each tick. Right now they come on and stay on even if the bar finishes without the conditions being met. Thanks for any help!

    Steve

    var vCCI = null;

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("CCI V -4 0" );
    setShowCursorLabel(false);
    setCursorLabelName("CCI V -4 0", 0);
    setDefaultBarFgColor(Color.blue, 0);

    var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
    fp1.setLowerLimit(1);
    fp1.setDefault(14); //Edit this value to set a new default

    var fp2 = new FunctionParameter("Source", FunctionParameter.STRING);
    fp2.setName("CCISource");
    fp2.addOption("Close");
    fp2.addOption("High");
    fp2.addOption("Low");
    fp2.addOption("Open");
    fp2.addOption("HL/2");
    fp2.addOption("HLC/3");
    fp2.addOption("OHLC/4");
    fp2.setDefault("Close"); //Edit this value to set a new default

    }

    function main(Length, Source, Upper, Lower) {

    if (vCCI == null) vCCI = new CCIStudy(Length, Source);

    /********************************************
    Insert your code following this text block
    Use vCCI.getValue(CCIStudy.CCI) for your code
    *********************************************/

    if(vCCI.getValue(CCIStudy.CCI,-4) < vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-3) > 100 &&
    vCCI.getValue(CCIStudy.CCI,-3) < 190 &&
    vCCI.getValue(CCIStudy.CCI,-2) < vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-2) > 0 &&
    vCCI.getValue(CCIStudy.CCI,-1) < 0 &&
    vCCI.getValue(CCIStudy.CCI) > 0 ) {
    //Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
    //Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
    drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
    }

    if(vCCI.getValue(CCIStudy.CCI,-4) > vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-3) < -100 &&
    vCCI.getValue(CCIStudy.CCI,-3) > -190 &&
    vCCI.getValue(CCIStudy.CCI,-2) > vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-2) < 0 &&
    vCCI.getValue(CCIStudy.CCI,-1) > 0 &&
    vCCI.getValue(CCIStudy.CCI) < 0 ) {
    //Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
    //Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
    drawShapeRelative(0, high()+1, Shape.SQUARE, "", Color.fushcia, Shape.BOTTOM);
    } //closes the crossing down condition


    return null;//new Array(vCCI.getValue(CCIStudy.CCI));
    }

  • #2
    Re: simple efs help

    Steve
    See the example provided in this thread on the same problem.
    Alex


    Originally posted by opstock
    Could someone show me how to get my signals to update with each tick. Right now they come on and stay on even if the bar finishes without the conditions being met. Thanks for any help!

    Steve

    var vCCI = null;

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("CCI V -4 0" );
    setShowCursorLabel(false);
    setCursorLabelName("CCI V -4 0", 0);
    setDefaultBarFgColor(Color.blue, 0);

    var fp1 = new FunctionParameter("Length", FunctionParameter.NUMBER);
    fp1.setLowerLimit(1);
    fp1.setDefault(14); //Edit this value to set a new default

    var fp2 = new FunctionParameter("Source", FunctionParameter.STRING);
    fp2.setName("CCISource");
    fp2.addOption("Close");
    fp2.addOption("High");
    fp2.addOption("Low");
    fp2.addOption("Open");
    fp2.addOption("HL/2");
    fp2.addOption("HLC/3");
    fp2.addOption("OHLC/4");
    fp2.setDefault("Close"); //Edit this value to set a new default

    }

    function main(Length, Source, Upper, Lower) {

    if (vCCI == null) vCCI = new CCIStudy(Length, Source);

    /********************************************
    Insert your code following this text block
    Use vCCI.getValue(CCIStudy.CCI) for your code
    *********************************************/

    if(vCCI.getValue(CCIStudy.CCI,-4) < vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-3) > 100 &&
    vCCI.getValue(CCIStudy.CCI,-3) < 190 &&
    vCCI.getValue(CCIStudy.CCI,-2) < vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-2) > 0 &&
    vCCI.getValue(CCIStudy.CCI,-1) < 0 &&
    vCCI.getValue(CCIStudy.CCI) > 0 ) {
    //Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
    //Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
    drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
    }

    if(vCCI.getValue(CCIStudy.CCI,-4) > vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-3) < -100 &&
    vCCI.getValue(CCIStudy.CCI,-3) > -190 &&
    vCCI.getValue(CCIStudy.CCI,-2) > vCCI.getValue(CCIStudy.CCI,-3) &&
    vCCI.getValue(CCIStudy.CCI,-2) < 0 &&
    vCCI.getValue(CCIStudy.CCI,-1) > 0 &&
    vCCI.getValue(CCIStudy.CCI) < 0 ) {
    //Alert.playSound("C:\\Progam Files\\eSignal\\Sounds\\ding.wav");
    //Alert.addToList(getSymbol(),"V -4 0",Color.black,Color.RGB(65,65,65));
    drawShapeRelative(0, high()+1, Shape.SQUARE, "", Color.fushcia, Shape.BOTTOM);
    } //closes the crossing down condition


    return null;//new Array(vCCI.getValue(CCIStudy.CCI));
    }

    Comment


    • #3
      Alex, thanks. I inserted the code as you suggested in that thread, but i'm getting and error. The formual output window is telling me that I have an "Invalid number of arguments (7) for removeShape", but I don't. I copy and pasted the exact tag id from my drawShapeRelative...

      drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
      } else {
      removeShape(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);}

      any thoughts

      Comment


      • #4
        Steve
        The removeShape() command has only one parameter ie the tagID of the shape that you want to remove [see the link to the corresponding article in the EFS KnowledgeBase]
        You will also need to add a tagID in the drawShapeRelative() command [for the complete syntax of this function see the link to the corresponding article in the EFS KnowledgeBase]
        Alex


        Originally posted by opstock
        Alex, thanks. I inserted the code as you suggested in that thread, but i'm getting and error. The formual output window is telling me that I have an "Invalid number of arguments (7) for removeShape", but I don't. I copy and pasted the exact tag id from my drawShapeRelative...

        drawShapeRelative(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);
        } else {
        removeShape(0, low()-1, Shape.SQUARE, "", Color.fushcia, Shape.TOP);}

        any thoughts

        Comment


        • #5
          OK, thanks so much alex, I thought the tag meant the six parameters for the drawShapeRelative. So I will need to add a tag ID with it's own variable and include a CURRENT_BARSTATE? Am I on the right track at all, lol?

          Steve

          Comment


          • #6
            Steve
            As the tagID just use a string and concatenate to it the current value of rawtime which is constant throughout the bar and is unique to each bar eg "myString"+rawtime(0)
            Then use the same tagID in the removeShape() command
            Alex


            Originally posted by opstock
            OK, thanks so much alex, I thought the tag meant the six parameters for the drawShapeRelative. So I will need to add a tag ID with it's own variable and include a CURRENT_BARSTATE? Am I on the right track at all, lol?

            Steve

            Comment


            • #7
              Thanks Alex, I will keep reading the knowledge base and tried to find examples of what you're talking about.

              Steve

              Comment


              • #8
                Steve
                You are most welcome
                Alex


                Originally posted by opstock
                Thanks Alex, I will keep reading the knowledge base and tried to find examples of what you're talking about.

                Steve

                Comment

                Working...
                X