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.

    Gaby V.NinjaTrader Customer Service

    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.
        Gaby V.NinjaTrader Customer Service

        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.
            Gaby V.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by owen5819, Today, 11:42 AM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Playdc, Today, 12:17 PM
            1 response
            3 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by shunsinger22, Yesterday, 11:47 AM
            3 responses
            21 views
            0 likes
            Last Post shunsinger22  
            Started by trade2vin, Today, 11:52 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by mbcito, Today, 11:43 AM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Working...
            X