Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw an ArrowUp fails with a strange exceprion

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

    Draw an ArrowUp fails with a strange exceprion

    Hi
    I have run into an issue when trying to draw an ArrowUp from a button press event.
    I have created a custom button and on click it is firing of the below method:

    Code:
    protected void Button1Click(object sender, RoutedEventArgs e)
    {
    int lowestBar = LowestBar(Low, -10);
    double low = Low[lowestBar];
    
    Draw.ArrowUp(this, CurrentBar+"", false,2, Low[0]-TickSize*5, Brushes.Green);
    
    ForceRefresh();
    }
    Now i get an rather strange exceptin telling me that "barsago" need to be between 0 and 4872 but it is 1.
    In my best understanding 1 is between 0 and the other number.

    Please see the attached image.

    Best Regards,
    Sune ​
    Attached Files

    #2
    Hello SuneSorgenfrei,

    The button click is run from a non-data-driven method.

    You will need to use TriggerCustomEvent() to synchronize the series first.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea
      Thank you very much, that solved the issue and taught me something new so a win win situation.

      Best Regards,
      Sune

      Comment

      Latest Posts

      Collapse

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