Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Level II Data

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

    Level II Data

    Hi,
    i am trying to use the drawtext method to plot the calculated level II data on the chart.
    i have some print statements which print the information correctly in the output window.
    so what i am trying, is to plot the same data on the chart from within the onmarketdepth method, the code compiles, but when i insert the indicator in the chart, i get one of the following error messages.
    BarIndex needs to be greater/equal 0.
    or
    drawtext start barsago out of valid range 0 through -1 was 0.
    how to get the data from onmarketdepth on the chart?

    #2
    Hello keepsimple,

    Thanks for your post.

    In the OnBarUpdate section do you have code to return if a certain number of bars have not been produced? For example if (CurrentBar < 10) return; If so does the number of bars relate to the number of bars in the drawtext?

    If that does not resolve the issue, please post the section of code you are using to draw text with.

    Comment


      #3
      Hi Paul,
      thanks for quick reply.
      The indicator, is plotting on real time only, and there are way more bars, than set in the drawtext statement. when the indicator is inserted, it draws the desired text once and then i get the error message.
      code looks like the following, it is located in onmarketdepth
      DrawText("ASK" + askRows[idx].Price, "" + askRows[idx].Volume, 0, askRows[idx].Price, Color.Black);
      dont know why it does not work.

      Comment


        #4
        Hello,

        The drawText statement appear valid and assume you have tested (printed) the IDX values.

        Please post a sample code file so I can test on my end or if you prefer you can send it to PlatFormSupport[at]Ninjatrader[dot]com atten: Paul with reference to this thread.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X