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 kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        28 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        17 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        26 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        24 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        139 views
        0 likes
        Last Post SalmaTrader  
        Working...
        X