Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Test for the FirstTickOfBar for a Higher Time Frame Bar CurrentBars[1]

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

    How to Test for the FirstTickOfBar for a Higher Time Frame Bar CurrentBars[1]

    Hi,
    I have an Indicator that plots the possible closes for the Current UniRenko Bar, for Both the Chart time frame and also a Higher time frame (Ex. 4 Tick and a 8 Tick)

    I would like to know how to test the for the FirstTickOfBar of the Higher time frame?

    This did not work: if ( CurrentBars[1] == FirstTickOfBar[1] )

    And

    This Also did not work: if ( BarsInProgress[1] == FirstTickOfBar[1] )

    Thank You.
    Joe
    Last edited by jmca2000; 01-17-2020, 03:19 PM.

    #2
    Hello jmca2000,

    Thank you for your note.

    You could structure that like this: (note this assumes you only have 1 additional data series added to the script)

    Code:
    if(BarsInProgress == 1) //this makes sure we're only looking at the secondary series
    {
         if (FirstTickOfBar) //check if it's the first tick of the bar
         {
              //Do something 
         }
    }
    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Hi Kate,

      Thank You for your reply...

      Will your code "Do something" ONLY If it is the First Tick of the BarsInProgress == 1 and NOT "Do Something" if it's the FirstTickOfBar of the BarsInProgress == 0 ...?

      I just want the code to "Do Something" if it's the First Tick of the Bar for BarsInProgress == 1

      Thank You Again and in Advance...

      Joe

      Comment


        #4
        Hello jmca2000,

        Thank you for your reply.

        Yes, because I've nested the first tick of bar check inside the bars in progress check, it will first make sure that we're processing that secondary series, then check to see if the incoming tick is the first tick of a new bar for that secondary series.

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Thank You Again Kate...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          558 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          324 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
          545 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          547 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X