Announcement

Collapse
No announcement yet.

Tick Bar - Ticks remaining

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    RSy
    Jason has already written one that does that. You can find it here
    Alex

    Comment


    • #17
      I have adapted tib_Counter.efs trying to give an option to display the current minute or current second. I have an AddOption, and transfer that option into main(), then use if statements to give the proper display.

      I am finding that the display is static on my time interval chart (ES #F at 1-minute). The seconds display does not change during the bar, as I want it to.

      I am trying to get the current seconds, not the bar timestamp, so I am using a date object. But I have something wrong. I have seem the time-remaining efs, but on time-interval charts I really want to display the actual minutes or seconds, not a countdown.

      I would appreciate any help you can offer. Thanks. Joe.
      Attached Files

      Comment


      • #18
        Joe
        Comment out (or delete) lines 25, 30, 32 and 33 and change line 31 to var today = new Date();
        Once you make this modification you should see the seconds update on every execution of the efs
        Alex

        Comment


        • #19
          Thank you for that advice, Alexis. This gives the result I want.

          May I ask why, in this case, it does not work to assign the new Date() object once, using the bInit structure? Why must it be re-assigned each time the efs is called?

          When calling functions, we only need to assign the study variable once, then we use the getValue. Is the date object handled differently?

          Thank you again. Joe.

          Comment


          • #20
            Joe
            When you instantiate the date object it retrieves the date, time, etc at that specific moment so if you want to have a continuous update you need to execute it on every tick
            Alex

            Comment


            • #21
              Volume countdown

              Alexis
              I use primarily volume charts. I have tried to modify your efs to count down volume but everything I try I am getting a NaN error. I cannot figure out why. I have attached the efs and was wondering if you could help me modify it to countdown volume.

              /***********************************
              Alexis C. Montenegro © February 2004
              ************************************/

              function preMain() {
              setPriceStudy(true);
              setStudyTitle("TIC Countdown");
              setCursorLabelName("TIC Countdown");
              setShowCursorLabel(true)
              }

              var y = 0;

              function main() {

              var x = getInterval();
              var n = parseInt(x);

              if(1==1)
              y += 1;
              if(getBarState()==BARSTATE_NEWBAR){
              y=1;
              }
              var z = n-y;

              drawTextRelative(3,close(),z,Color.blue,null,Text. BOLD|Text.VCENTER,"Arial",16,"TIB");

              return z+" ";
              }
              Last edited by pmcd; 02-13-2007, 02:37 PM.

              Comment


              • #22
                pcmd
                Enclosed below is a revised version of the efs that should provide the correct count down with Volume bars
                Alex

                PHP Code:
                /***********************************
                Alexis C. Montenegro Â© February 2004
                ************************************/

                function preMain() {
                    
                setPriceStudy(true);
                    
                setStudyTitle("Vol Countdown");
                    
                setCursorLabelName("Vol Countdown");
                    
                setShowCursorLabel(true)      
                }
                 
                function 
                main() {
                 
                    var 
                getInterval();
                    var 
                parseInt(x);
                 
                    var 
                n-volume(0);
                 
                    
                drawTextRelative(3,close(),z,Color.blue,null,Text.BOLD|Text.VCENTER,"Arial",16,"TVB");
                 
                    return 
                z+" ";

                Comment


                • #23
                  Is it possible to have the option for the user to assign a sound when a bar closes or reach zero during the countdown? This could be another way to sense/hear momentum.

                  Comment


                  • #24
                    kevinmclark
                    To do that just add a condition [after the line where z is calculated] that checks for z to be less than a value of your choice in which case it triggers an alert eg
                    PHP Code:
                    if(yourvalueAlert.playSound("ding.wav"); 
                    If you then want the alert to play once only per bar then see this thread for an example on how to accomplish that
                    Alex

                    Comment


                    • #25
                      Thanks!

                      Comment


                      • #26
                        kevinmclark
                        You are most welcome
                        Alex

                        Comment


                        • #27
                          On my charts, the tick counter only seems to advance when there is a price change. It does not update on every order that comes through the time and sales window. Is this the correct behavior or I am missing a setting.

                          Thanks.

                          Comment


                          • #28
                            HJSeese
                            Not sure which script you are referring to [ie the tick or volume counter] but as far as I can see both are executing on every trade regardless of whether this was at the same or different price than the previous trade [see enclosed screenshots as an example]
                            Alex






                            Originally posted by HJSeese View Post
                            On my charts, the tick counter only seems to advance when there is a price change. It does not update on every order that comes through the time and sales window. Is this the correct behavior or I am missing a setting.

                            Thanks.

                            Comment

                            Working...
                            X