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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        607 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        353 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        560 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        561 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X