Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawText Error

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

    DrawText Error

    Using the following DrawText() statement:
    "DrawText("hiTick"+CurrentBar, "T", 0, High[0] + (5*TickSize), Color.Red);"

    I am getting the following error:
    "Error on calling 'OnBarUpdate' method for indicator 'A1TrendPeriodColors' on bar 103: A1TrendPeriodColors.DrawText: startBarsAgo out of valid range 0 through -1, was 0."

    I am drawing on bar index 0, at bar number 103, yet the error says valid bar index range is 1- to 0 ???? What is going on?

    #2
    Hello monpere,

    The error you're getting is not expected with the snippet you posted.

    Can you share some details about the series you're running this on and the complete code?

    Do you get the same results with all charts?
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      I see the reason. I am running multiple bar series in the indicator, I need to check barsInProgress. Thanx

      Comment


        #4
        Glad to hear, monpere. Thanks for the update.
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        324 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        250 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        351 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        180 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X