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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      47 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      23 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X