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?

    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.

        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.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by toughiee, Today, 12:04 AM
            0 responses
            3 views
            0 likes
            Last Post toughiee  
            Started by vdoan20, Yesterday, 08:30 PM
            0 responses
            8 views
            0 likes
            Last Post vdoan20
            by vdoan20
             
            Started by gupagoer, Yesterday, 07:42 PM
            0 responses
            9 views
            0 likes
            Last Post gupagoer  
            Started by Holligoly, Yesterday, 05:13 PM
            2 responses
            11 views
            0 likes
            Last Post Holligoly  
            Started by Raginpower, Yesterday, 01:53 PM
            0 responses
            14 views
            0 likes
            Last Post Raginpower  
            Working...
            X