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

Where is the NT BarTimer code?

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

    Where is the NT BarTimer code?

    Hello,

    I am looking for the NinjaTrader BarTimer code that was released by NinjaTrader as official reference code. Unfortunately, I cannot find it. (I am looking for the NT8 version.)

    Can someone please post a link to the official NinjaTrader 8 BarTimer indicator code?

    Thanks.

    #2
    Hello flonkle,

    Thanks for your post.

    The bar timer code in NT8 can be accessed by New>Ninjascript Editor.
    In the editor on the right side double left click the "indicators" folder. The indicators are alphabetically listed, you can then double left click on the indicator "BarTimer" to then see the code in the editor.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the info Paul. I didn't realize the BarTimer indicator came pre-loaded with NT8. I was looking for it in the reference code section of the support forum.

      However, upon looking at the BarTimer code, I see a few checks to make sure data is real-time data with the code:

      Code:
      if (State == State.Realtime) { // do something here }
      But in the Help Guide in the Code Breaking Changes section, the guide indicates we should check for real-time data with the following conditional:

      Code:
      if (State >= State.Realtime) {  // do something here }
      So, which is the preferred method for checking for the presence of real-time data in our code? Should we check with an "==" or a ">=" operator when checking for the presence of real-time data in our NinjaScript code?

      Comment


        #4
        Hello flonkle,

        Thanks for your reply.

        You can use either as they both will work.

        Personally, I prefer the == as there is no question about what state you are in when true.

        I would encourage you to test what works best for you.
        Paul H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by agclub, 04-21-2024, 08:57 PM
        4 responses
        18 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Irukandji, Today, 04:58 AM
        0 responses
        2 views
        0 likes
        Last Post Irukandji  
        Started by fitspressoburnfat, Today, 04:25 AM
        0 responses
        2 views
        0 likes
        Last Post fitspressoburnfat  
        Started by Skifree, Today, 03:41 AM
        1 response
        4 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by usazencort, Today, 01:16 AM
        0 responses
        1 view
        0 likes
        Last Post usazencort  
        Working...
        X