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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      52 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      38 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      99 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      60 views
      0 likes
      Last Post PaulMohn  
      Working...
      X