Announcement

Collapse
No announcement yet.

Watch List Refresh Frequency

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

  • Watch List Refresh Frequency

    Hello

    I have an EFS which has setComputeOnClose();

    When I add this EFS to a watchlist, the EFS seems to be executed multiple times per bar.. Is there a way to configure watchlist so that the EFS executes only once per bar ?

    thanks in advance
    saurabh

  • #2
    saurabh

    the EFS seems to be executed multiple times per bar
    How did you come to this conclusion?
    Alex


    Originally posted by saurmitt View Post
    Hello

    I have an EFS which has setComputeOnClose();

    When I add this EFS to a watchlist, the EFS seems to be executed multiple times per bar.. Is there a way to configure watchlist so that the EFS executes only once per bar ?

    thanks in advance
    saurabh

    Comment


    • #3
      the EFS code is something like this..

      -----------

      setComputeOnClose();
      setPriceStudy(false);

      function main() {
      if (getBarState() == BARSTATE_NEWBAR)
      {
      //some code
      //some code
      Alert.addToList(getSymbol(),"alpha alert", Color.white, Color.black);
      }
      }

      -------
      1) add this EFS to watchlist..
      2) edit column and set time interval as 15 mins..
      3) open alerts log.. look at the symbol column and time column as the data in the watch list refreshes

      for each symbol, there are multiple alerts in the alert log for every 15 minutes duration.. This is making me conclude that the EFS is executed more than once every 15 mins, and hence more than once per bar.. Same EFS when added to a chart generates just one alert per bar

      Alex: let me know if you need more info on the above steps

      Thanks
      Saurabh

      Comment


      • #4
        Saurabh
        As far as I can see the script is executing (and triggering the alert) once only per bar.
        As an aside using a check for BARSTATE_NEWBAR is redundant since you already have set the formula to compute on close only
        Alex


        Originally posted by saurmitt View Post
        the EFS code is something like this..

        -----------

        setComputeOnClose();
        setPriceStudy(false);

        function main() {
        if (getBarState() == BARSTATE_NEWBAR)
        {
        //some code
        //some code
        Alert.addToList(getSymbol(),"alpha alert", Color.white, Color.black);
        }
        }

        -------
        1) add this EFS to watchlist..
        2) edit column and set time interval as 15 mins..
        3) open alerts log.. look at the symbol column and time column as the data in the watch list refreshes

        for each symbol, there are multiple alerts in the alert log for every 15 minutes duration.. This is making me conclude that the EFS is executed more than once every 15 mins, and hence more than once per bar.. Same EFS when added to a chart generates just one alert per bar

        Alex: let me know if you need more info on the above steps

        Thanks
        Saurabh

        Comment


        • #5
          Alex

          Click image for larger version

Name:	Capture2.PNG
Views:	1
Size:	69.1 KB
ID:	243003


          See attached screenshot showing 2 alerts within 1 minute for the same script..

          here's the full EFS code for your reference

          function preMain(){
          setComputeOnClose();
          setPriceStudy(false);
          }

          function main() {

          if (getBarState() == BARSTATE_NEWBAR)
          {

          Alert.addToList(getSymbol(),"alpha alert", Color.white, Color.black);



          }
          }

          -----------

          Does this prove that the issue is reproducible ? or am i doing something wrong ?

          Thanks for pointing out the redundancy.. I had added it just to be double sure..

          Please do help resolve the issue..

          Saurabh

          Comment


          • #6
            Saurabh
            As I said in my prior reply and as illustrated in the set of screenshots enclosed below your script is executing and triggering the alerts once only per bar at my end
            Alex

            Image captured after first loading the script



            Image captured after the first 15 minute period. As you can see there is only the first set of alerts followed by those at the new 15 minute bar



            Image captured after the second 15 minute period. Again the only executions are those at the time a new bar is created




            Originally posted by saurmitt View Post
            Alex

            [ATTACH=CONFIG]16792[/ATTACH]


            See attached screenshot showing 2 alerts within 1 minute for the same script..

            here's the full EFS code for your reference

            function preMain(){
            setComputeOnClose();
            setPriceStudy(false);
            }

            function main() {

            if (getBarState() == BARSTATE_NEWBAR)
            {

            Alert.addToList(getSymbol(),"alpha alert", Color.white, Color.black);



            }
            }

            -----------

            Does this prove that the issue is reproducible ? or am i doing something wrong ?

            Thanks for pointing out the redundancy.. I had added it just to be double sure..

            Please do help resolve the issue..

            Saurabh

            Comment


            • #7
              Saurabh
              I may know why you are seeing that behavior. That said this is just a guess as you did not provide any pertinent information.
              Do you have Hibernation enabled in the Watch List? Also do you have any symbols in that Watch List that are outside of the visible area?
              If so keep in mind that any time a symbol is put into - or taken out of - hibernation [by scrolling through the Watch List] the data set for that symbol is refreshed thereby triggering a reload of the script [for that symbol].
              Also the data set of any symbol in hibernation is refreshed every 5 minutes again triggering a reload of the script [for that symbol].
              Once you disable Hibernation in that Watch List the script will execute once only per bar as I illustrated in my prior reply. Note however that doing this will affect your symbol count [if that is important to you]
              Alex

              Comment


              • #8
                Thanks for your reply Alex.. I did have 100+ symbols and many were outside the visible area.. That must have been causing the problem..

                How do I disable hibernation in watch list ?

                Thanks
                Saurabh

                Comment


                • #9
                  found the option to turn off hibernate mode in watchlist menu

                  thanks for your support alex

                  -saurabh

                  Comment


                  • #10
                    Saurabh
                    You are welcome
                    If you do not already have it you may want to bookmark the link to the eSignal KnowledgeBase where you can find most of the information on the program (including for example what you inquired about)
                    Alex


                    Originally posted by saurmitt View Post
                    found the option to turn off hibernate mode in watchlist menu

                    thanks for your support alex

                    -saurabh

                    Comment

                    Working...
                    X