Announcement

Collapse
No announcement yet.

Tick Bar - Ticks remaining

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

  • Tick Bar - Ticks remaining

    Is there a study that would show the number of ticks remaining before a bar is complete?

    As an example using a 144 tick chart, a bar has 100 ticks so far, so the study would display 44 ticks remaining until the bar is complete...

  • #2
    lassiter
    The enclosed script should do what you asked
    Alex



    PHP Code:
    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("TIB counter");
        
    setCursorLabelName("TIB counter");
        
    setShowCursorLabel(true)      
    }

    var 
    0;

    function 
    main() {

    var 
    getInterval();
    var 
    parseInt(x);

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

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

    return 
    z+" ";

    Comment


    • #3
      How To Make EFS file

      I have tried to copy and paste this formula to make anew new efs file...and can not copy and paste the text nor save the text to clipboard.

      When I see these codes like this how do I save to make into an efs file I know how to uses the editor...Thanks

      Comment


      • #4
        Hmm,

        I can copy and past the code from my browser no problem.

        Are you really back rev'd on your browser version?

        Have you tried highlighting and using ctrl-c to copy?

        Garth
        Garth

        Comment


        • #5
          betsteven1
          Attached you can find the efs.
          Alex
          Attached Files

          Comment


          • #6
            Got It

            Thanks !!!

            Comment


            • #7
              Alex, is it possible to rewrite the EFS so not "NaN" is shown when not viewing a tick-chart?

              Are the counter counting tick in current bar or tick left in current bar?

              RSy

              Comment


              • #8
                RSy
                Insert the following at the beginning of main()
                if(isRawTick()!=true||isTick()==true)
                return;

                Alex

                Comment


                • #9
                  Thank you very much Alex. You're the best.

                  Is it possible to not show any name of the EFS in the left upper corner?

                  RSy

                  Comment


                  • #10
                    RSy
                    Thank you for the compliments.
                    As to hiding the study title go to Edit Studies and put a check in the Title Override box leaving however the Title box iself empty
                    Alex

                    Comment


                    • #11
                      Alex. would you please help me to rewrite this efs so I get an alert in a alert windows when X ticks remaining?

                      RSy

                      Comment


                      • #12
                        RSy
                        The attached revision of the efs now adds a user definable Trigger level (default is set to 20 ticks) below which an Alert list that includes the symbol and interval will be triggered. The efs also includes a provision for a sound alert. To enable it open the efs with the Editor and uncomment line 41.
                        Lastly when the count falls under the Trigger level the value in the Cursor Window and that plotted in the chart will be colored in red instead of the default blue.
                        Alex

                        Attached Files

                        Comment


                        • #13
                          Wow... just what I needed.
                          Is it possible to make the "fp1.setDefault(20);" to be X % of ticks per bar.

                          tickchart: 233T
                          using alarm at 5% of ticks per bar
                          = 233 * 0,05 = 11,65 rounded up to: 12 ---> Then fp1.setDefault(12)?

                          Then if I change to 89 tick per bar the alarm will be triggered at:
                          89 * 0,05 = 4,45 rounded up to 5.

                          And is it possible to have the alarm showed in a Alert Ticker Window? File-New-Ticker-Alert Ticker?
                          Then it will be possible to change background colour of alert window.

                          Did you understand my (very) bad english Alex?

                          And again, thanks a lot for helping us with efs!

                          RSy

                          Comment


                          • #14
                            RSy
                            In line 45 of the formula add the following

                            if(Trigger==0)
                            Trigger = Math.round(n*0.05);

                            Then when you want to use a percentage simply set 0 for the Trigger level using Edit Studies and it will calculate 5% of the interval.
                            Alex

                            Comment


                            • #15
                              Alex, could you add "minutes left per bar" to this efs, please?

                              RSy

                              Comment

                              Working...
                              X