Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TickCounter in DataBox

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

    TickCounter in DataBox

    Hello,

    Can you please advise what the Value[0] = ? should be to get the TickCounter countdown to display in the DataBox? I have tried Value[0] = CountDown, but that does not work.
    Thank you.

    #2
    Hello GeorgeW,

    Thank you for your post.

    You can use Bars.TickCount, this returns the total number of ticks of the current bar processing.

    Comment


      #3
      Thank you for your response Gaby.
      When I use the orignal TickCounter & select Display in DataBox, I get a heading displayed although obviously no data as there is not Value[0] setting. I save a copy of the TickCounter and insert the additional code below, which compiles, but then nothing (not even the heading) for the TickCounter2 displays in the DataBox.

      protected override void OnBarUpdate()
      {
      Value[0] = Bars.TickCount; //Added to OnBarUpdte section; OR Value[0] = periodValue - Bars.TickCount;
      }

      protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
      {
      return;
      }​

      Comment


        #4
        Can you clarify, are you trying to edit the original TickCounter indicator's code or are you creating your own script?

        If you're editing the TickCounter code, you need to make sure you set DisplayInDataBox to true. This is set to false in the original code.

        Additionally, I would suggest removing the OnRender call as it is not necessary and it doesn't seem like you have any logic within OnRender.

        Comment


          #5
          Hello,
          I save the original TickCounter code as TickCounter2 then add the additional code to that. What I am saying is that I don't understand why the original TickCounter heading will appear in the DataBox if I tick DisplayInDataBox (I understand there will be no data as the additional code is not there), but when I add the additional code to TickCounter2 and tick DisplayInDataBox I do not get the heading or the data.
          I thought the OnRender call was used if you wanted data to appear in the DataBox but did not want a plot to appear on the chart as indicated here: https://forum.ninjatrader.com/forum/...t-not-on-chart ​ anyway, even if I comment it out, I still get nothing in the databox.
          Last edited by GeorgeW; 01-26-2025, 02:49 AM.

          Comment


            #6
            Hello George,

            I suggest debugging your edited script. Are you assigning values to the plot? If so, what value is being assigned?

            You could also simply just give the plot a transparent color if you don't want the plot to appear on the chart.

            Comment


              #7
              Hello,
              I am still getting an "Error on calling 'OnBarUpdate' method on bar 0: Index was outside the bounds of the array.​" on this indicator, even when all I have added to the original "TickCounter Code" is as below. ny ideas what I need to do? Thank you!

              Code:
              if (CurrentBar < 1)
                          return;​
              "Original TickCounter Code here"
              
              Value[0] = periodValue - Bars.TickCount;

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
              0 responses
              577 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              334 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              101 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
              0 responses
              553 views
              1 like
              Last Post Geovanny Suaza  
              Started by RFrosty, 01-28-2026, 06:49 PM
              0 responses
              551 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X