Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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:	118
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.
    Kate W.NinjaTrader Customer Service

    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
        Kate W.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        6 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        8 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X