Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Could IsFirstTickOfBar Miss?

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

    Could IsFirstTickOfBar Miss?


    Could IsFirstTickOfBar Miss?

    On my OnBarUpdate method, I have it set to Price Change. Say the price of the first tick of a new bar, is the same price as the price of the last tick of previous bar. It would seem that OnBarUpdate would not fire then, so any IsFirstTickOfBar logic would also not fire then.

    Would this be the case? Thanks,



    #2
    Hello timmbbo,

    Thanks for your post.

    I am not aware of any instances where IsFirstTickOfBar does not get triggered when the first tick of a new bar occurs while using Calculate.OnPriceChange or Calculate.OnEachTick.

    When using Calculate.OnPriceChange, IsFirstTickOfBar will always return true when the first tick of a new bar occurs.

    You could add prints to your script within an IsFirstTickOfBar condition that prints something like "IsFirstTickOfBar triggered" along with the time of the bar (Time[0]) to see how the logic is evaluating.

    See the help guide documentation below for more information.

    IsFirstTickOfBar: https://ninjatrader.com/support/help...ub=isfirsttick
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    81 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    42 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    64 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    68 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    55 views
    0 likes
    Last Post CarlTrading  
    Working...
    X