• 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

Equivalent IBar Interface of NT7 in NT8

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

    Equivalent IBar Interface of NT7 in NT8

    Hi,
    Was looking for Equivalent IBar Interface for of in NT8.

    IBars in NT8 has a totally different interface. Any suggestions?

    Regards

    Vivek

    #2
    Hello AnkaS,

    Thank you for your post.

    As IBar was not documented in NinjaTrader 7 can you detail what you used it for and I can provide the equivalent in NinjaTrader 8?
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      I came here wanting to ask the same question. Let me give you an example of how I used IBar in NT7, hoping that you can advise me on how to transition my code to NT8:

      Case 1 - Get an absolute bar by index

      Code:
              var bar = Bars.Get(i);  // Get the i-th bar
      Case 2 - Bar Math

      Code:
              public static double Height(IBar bar)
              {
                  return bar.High - bar.Low;
              }
      
              public static double Top(IBar bar)
              {
                  return Math.Max(bar.Open, bar.Close);
              }
      
              public static double Bottom(IBar bar)
              {
                  return Math.Min(bar.Open, bar.Close);
              }
      It looks like you've removed Bars.Get(int) from NT8, so I'll have to change my Bar Math functions to take an index and a Bars object, e.g.:

      Code:
              public static double Bottom(Bars b, int i)
              {
                  return Math.Min(b.GetOpen(i), b.GetClose(i));
              }
      It's not the end of the world, but it's certainly not as elegant as before.

      Is there a better way? Please advise.

      PS. Overall, I love the changes in NT8

      Comment


        #4
        Hello xsgex,

        Thank you for your post.

        The means in which you are handling this would make sense in context to what you did in NinjaTrader 7. I do no see a better way to achieve this.

        Please let me know if you have any questions.
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          finally, what is the equivalent of IBar object and how to get in NT8?

          Comment


            #6
            Hello TazoTodua,

            Thank you for your post.

            IBar was undocumented in NinjaTrader 7, this means that if it's equivalent is in NinjaTrader 8 we would need to know what you use IBar for to then provide the desired operation in NinjaTrader 8.

            I look forward to your response.
            Patrick H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Mike3238, Today, 07:09 PM
            0 responses
            1 view
            0 likes
            Last Post Mike3238  
            Started by sambo81, Today, 06:57 PM
            0 responses
            2 views
            0 likes
            Last Post sambo81
            by sambo81
             
            Started by erichuff, Today, 04:53 AM
            1 response
            26 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by stevenev1, Today, 01:43 PM
            0 responses
            8 views
            0 likes
            Last Post stevenev1  
            Started by shinuvu, Today, 11:05 AM
            3 responses
            18 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Working...
            X