Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

when does firstTickOfBar trigger?

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

    when does firstTickOfBar trigger?

    Click image for larger version

Name:	image_73303.png
Views:	167
Size:	56.1 KB
ID:	1199854 i have a indicatorA that has 1 timeframes.

    1. baseTimeframe that renders the values and plots values on isFirstTickOfBar
    2. higherTimeframe that does calculation on isFirstTickOfBar for that particular timeframe

    I have other indicators /Strategies that calls on indicatorA on the same base timefraem and works on isFirstTickOfBar.
    Would the sFirstTickOfBar be triggered after both the isFirstTickOfBar for both timerames in indicator A?
    I attempted to explain my confusion in the following picture

    #2
    Hello junkone,

    Thank you for your note.

    IsFirstTickOfBar only relates to the current series updating OnBarUpdate. So it will be true, if the tick currently processing in OBU is the first tick of that bar series, and we'd see it be true multiple times, once for each series on the first tick of a new bar for that series.

    As a note, the first tick of bar first for the primary series when both series have the same tick that opens a new bar (for example, if your primary series is a 1 minute series and the secondary is a 5 minute, every 5 minutes when the two bars end at the same time, the first tick of the 1 minute bar will be processed before the 1st tick for the 5 minute bar).

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

    Comment


      #3
      lets assume UTC for convenience and i am using it for EURUSD.
      lets take 3 timeframes as part of indicator A
      1. 30 minute bar(base timeframe)
      2. daily timeframe bar

      When indicator B(30 minute timeframe as base) calls A
      #1. At every half hour mark except midnight, will the firstTickOfBar for B be after the completion of FirstTickofBar for all 30 minute Timeframes in A
      #2. At midnight, will the first TickOfBar be after the completion of FirstTickofBar for daily and 30 minute timeframe of A?

      Comment


        #4
        Hello junkone,

        Thank you for your reply.

        You'd need to use Update() to update both series of the hosted indicator on historical data. I'm attaching a simple pair of example scripts that demonstrates...we update the indicator so we see first the print for 1st tick for bar A, 5 updates for the secondary series for A, then the print for indicator B. Indicator B can be tested on a 1 minute chart.

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        46 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        28 views
        0 likes
        Last Post PaulMohn  
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        163 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        98 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        158 views
        2 likes
        Last Post CaptainJack  
        Working...
        X