Announcement

Collapse
No announcement yet.

GAP UP Alert

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

  • GAP UP Alert

    Hello,

    Does anyone have an script that will send an alert if/when a stock gaps up by a certain percentage after yesterdays close?

    Cheers

    Carlton

  • #2
    This is ugly, but it should calm you down a little

    You know how to sound an alarm by now don't you?

    /************************************************** **************************************************
    Copyright © eSignal, a division of Interactive Data Corporation. 2002. All rights reserved.
    This sample eSignal Formula Script (EFS) may be modified and saved under a new
    filename; however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    ************************************************** ************************************************** */
    function preMain() {
    setPriceStudy(true);
    setStudyTitle("Prev High (PH)");
    setCursorLabelName("PH");

    /*
    * Set the properties of the default bar. These will be the
    * properties of any bar for which style, color, thickness is
    * not specificed.
    */
    setDefaultBarStyle(PS_SOLID);
    setDefaultBarFgColor(Color.black);
    setDefaultBarThickness(2);
    setPlotType(PLOTTYPE_FLATLINES);

    }

    /*
    * This is a neat formula because it is working on multiple intervals
    */
    function main() {
    yestC= call("getPrevOHLC.efs", "Close");
    todyO= call("getTodayOHLC.efs", "Open");
    if(todyO+gap>yestC)
    debug("Gap!")
    return;
    }

    Comment


    • #3
      David,

      I'm getting the syntax error message that it cannot find getPrevOHLC.efs. I getting quite familiar with the language now. Does that error message mean that getPrevOHLC.efs should be in a default folder or in the root of the tree?

      Cheers

      Carlton

      Comment


      • #4
        Carlton
        you can either move the efs David wrote to the OHLC folder or replace the following lines
        yestC= call("getPrevOHLC.efs", "Close");
        todyO= call("getTodayOHLC.efs", "Open");
        with
        yestC= call("/OHLC/getPrevOHLC.efs", "Close");
        todyO= call("/OHLC/getTodayOHLC.efs", "Open");
        Alex

        Comment


        • #5
          Alex,

          Thanks.

          I am now getting an ReferranceError message stating that "gap is not defined"

          I can't see where I should define it.

          Thanks

          Carlton

          Comment


          • #6
            Carlton
            Substitute gap with a numerical value or if you want to be able to modify that value through Edit Studies then add
            the following just below function main()
            if(gap==null)gap=nn;
            where nn is the numerical value
            Alex

            Comment


            • #7
              Alex,

              So, do I replace the the nn with an numerical number in the actual script? Because i inserted it as you mentioned but it still keeps on telling me that gap is not defined.

              thanks

              Carlton

              Comment


              • #8
                Alex,

                I even tried it by replacing where it says gap! with a numeric and still getting same error message.

                Carlton

                Comment


                • #9
                  Alex,

                  I only get the error when I attempt to run the formula in a chart, not when I debug it.

                  Thx

                  Carlton

                  Comment


                  • #10
                    Carlton
                    Delete (or comment out with a //) the following line
                    debug("Gap!")
                    Then replace gap with a numerical value in the following line
                    if(todyO+gap>yestC)
                    Alex

                    Comment


                    • #11
                      Alex,

                      I tested this by inserted a high number but it doesn't appear to work.

                      Carlton

                      Comment


                      • #12
                        Carlton
                        What do you mean by "it doesn't work"?
                        Are you still getting syntax errors or are you not getting any alerts?
                        If the latter did you add any logic for the alerts? FYI there is none in the script as it was posted. David left that for you to insert.
                        Alex

                        Comment


                        • #13
                          Alex,

                          I think I may have it. I'm going to work on it in the morning.

                          Thanks for your help mate.

                          Cheers

                          Carlton

                          Comment

                          Working...
                          X