• 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

BarsType

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

    BarsType

    I looked at the various built in BarTypes and would appreciate some clarification:


    1. The UpdateBar updates the bar that matches the 'time' parameter, not necessarily the last, right?

    2. How are the other parameters used, e.g. is 'volume' added to the existing volume in the bar, is the maximum taken between the supplied 'high' and existing 'high'?

    3. Historical bars are added in the background and not passed through OnDataPoint, right?

    Thanks, Adi

    #2
    Hello adyle0,

    Thank you for your post.

    1. UpdateBar() updates the bar that is currently being built. There is no means to update a prior bar by time. The time of the UpdateBar() function is the time you set for the current bar.

    2. Volume is the bar's volume as of the data point and would be the cumulative volume until you call AddBar() again.

    3. All bars are created through OnDataPoint() including the historical bars.

    Please refer to the BarsTypes in the NinjaScript Editor for examples of these uses. I recommend experimenting with your own BarsTypes to see how each item updates.

    You can also refer to the Help Guide for more information: http://ninjatrader.com/support/helpG.../bars_type.htm

    Please let me know if I may be of further assistance.
    Patrick H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your reply Patrick.

      I did experiment and set a breakpoint at OnDataPoint with @SecondBarType. The first time it was hit bars.Count was already non zero. Another attempt with TickBarsType and first time the breakpoint hit bars.Count = 0 but the second time it was quite a large number.

      What am I missing?

      Thanks,
      Adi

      Comment


        #4
        Hello adyle0,

        Thank you for your response.

        Can you provide an example of the code used and the Output you received?
        Patrick H.NinjaTrader Customer Service

        Comment


          #5
          Could caching be taking place? I noticed the bars.Count starts with a value other than 0 when I decrease the Number Of Days to load

          Comment


            #6
            Hello adyle0,

            Thank you for your response.

            What number is it starting with?

            Can you provide an example of the code used and the Output you received?

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

            Comment


              #7
              Hello Patrick,

              Can we discuss it further via email? How do I email you?

              Thanks,
              Adi

              Comment


                #8
                Hello Adi,

                Thank you for your response.

                Please send a note to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email.
                Patrick H.NinjaTrader Customer Service

                Comment


                  #9
                  Hello adyle0,

                  Thank you for your patience.

                  After reviewing and testing your code I found what you were referring to on the bars.Count. The reason it is a larger number at times is because the BarsType has already ran when we run the debugger, so the value is far larger than 0 in most cases.

                  I will follow up with you on email as well.
                  Patrick H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by sergey_z, Today, 02:34 AM
                  3 responses
                  12 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by frankduc, Today, 05:24 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_PaulH  
                  Started by shmarola, Today, 01:01 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post shmarola  
                  Started by CriticalMind, 11-29-2015, 12:39 PM
                  3 responses
                  1,323 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Started by novel168, 06-14-2019, 09:20 PM
                  2 responses
                  10 views
                  0 likes
                  Last Post novel168  
                  Working...
                  X