Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IsFirstTickOfBar kind of not working

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

    IsFirstTickOfBar kind of not working

    Hi,

    I have a custom indicator in which I check the values of various indicators from the previous bar on the first tick of a new bar. If certain conditions are met, I mark the bar. What is odd is that the conditions are often not detected in live markets even when I know they should have been. If I refresh the chart, causing the same bars to be reevaluated as historical data, the marks appear. That of course doesn't do me any good since I need the information in real time. The custom indicator is configured to update on every tick.

    Are the values for indicators from the previous bar not reliably available as of the first tick of the next, new bar? The issue isn't limited to the indicators from just one vendor. Thanks.

    Gordon

    #2
    Hello Gordon,

    Thank you for your post.

    So I may accurately assist you, please answer all of the following questions:
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
    • What are the results if you add print statements for the indicator values when IsFirstTickOfBar is true? Do you see the expected results in real-time printing to the NinjaScript Output window?​
    • What instrument symbol (and expiry if applicable) have you selected? For example, ES 03-22, AAPL, EURUSD, etc.
    • (For a chart) what interval is selected? For example, 5 minute, 1 day, 2000 volume, 4 Renko, etc.
    • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
    ​We have a reference sample that demonstrates how to separate logic to either calculate once for each bar or on every tick that might be a useful resource here:


    I look forward to your reply.

    Comment


      #3
      I'm highly confident that IsFirstTickOfBar works correctly and that the previous (closed) bar values at [1] are available. Most likely you have a bug in your code. If you can reduce your code down to the very smallest code that demonstrates the problem and does not contain anything proprietary, you should post it and I'm sure someone can tell you what's wrong.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      646 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      367 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      107 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      569 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      573 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X