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 charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      67 views
      0 likes
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      150 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      162 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 05-10-2026, 08:12 PM
      0 responses
      99 views
      0 likes
      Last Post CarlTrading  
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      286 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Working...
      X