Announcement

Collapse
No announcement yet.

Bar Count?

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

  • Bar Count?

    Is there an efs anywhere that allows you to count the bars so far completed for the current day?

  • #2
    Neil
    The efs in this post does something similar to what you are asking
    Alex

    Comment


    • #3
      Thanks Alex.. very helpful.. I modified the efs to add the up and down bars to give the total I was after.. great!

      One other thing is that it seems to count all the bars on the chart from the start of the chart... is there a way to set to count only the current day? I see the start time is set in the efs but presumably any day that is in the open chart is after 9.30.. ah right, as I typed that I realised my start time is gmt (14.30) so that fixed that problem, works fine now.. incidently do you know how I can set the esignal time to be est instead of my local computer time?

      I have copyed the efs below in case any others want to do the same thing.. oh and I changed the count for up bar to be equal or greater than zero.. since it seemed to not count bars of course which were flat which distorted the count a bit

      Thanks again
      Neil

      function preMain(){

      setPriceStudy(true);
      setStudyTitle("UP-DN Bar Counter");
      setCursorLabelName("UP bars",0);
      setCursorLabelName("DN bars",1);
      setCursorLabelName("TOT bars",2);
      setDefaultBarFgColor(Color.blue,0);
      setDefaultBarFgColor(Color.red,1);
      setDefaultBarFgColor(Color.black,2);
      setComputeOnClose();

      }

      var vCntrUP = 0;
      var vCntrDN = 0;
      var vCntrTOT = 0;

      function main(){

      if((getHour()*100)+getMinute()==1430){
      vCntrUP=0;
      vCntrDN=0;
      vCntrTOT=0;
      }

      if(close(0)>=open(0)){
      vCntrUP ++
      }
      if(close(0)<open(0)){
      vCntrDN ++
      }
      {
      vCntrTOT = vCntrUP + vCntrDN;
      }
      return new Array (vCntrUP+"",vCntrDN+"",vCntrTOT+"");
      }
      Last edited by Neil; 08-23-2004, 06:46 AM.

      Comment


      • #4
        Neil

        .. incidently do you know how I can set the esignal time to be est instead of my local computer time?

        AFAIK the only way you can do that is by changing the computer's time.
        Having said that see this thread where you can find an efs that will display an offset time at the bottom of the chart
        Alex

        Comment

        Working...
        X