• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 pjsmith, 04-14-2018, 06:14 AM
        3 responses
        480 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by losfer, Today, 05:29 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_EricB  
        Started by otislauwaert, Today, 04:36 AM
        0 responses
        6 views
        0 likes
        Last Post otislauwaert  
        Started by Tiang, Yesterday, 11:33 PM
        0 responses
        5 views
        0 likes
        Last Post Tiang
        by Tiang
         
        Started by MakesTrades23, Yesterday, 07:51 PM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_AlanP  
        Working...
        X