Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 Haiasi, 04-25-2024, 06:53 PM
      2 responses
      17 views
      0 likes
      Last Post Massinisa  
      Started by Creamers, Today, 05:32 AM
      0 responses
      5 views
      0 likes
      Last Post Creamers  
      Started by Segwin, 05-07-2018, 02:15 PM
      12 responses
      1,786 views
      0 likes
      Last Post Leafcutter  
      Started by poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,408 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Working...
      X