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 JonesJoker, Today, 12:23 PM
      2 responses
      9 views
      0 likes
      Last Post JonesJoker  
      Started by quantismo, 04-17-2024, 05:13 PM
      7 responses
      46 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by Stanfillirenfro, Today, 09:19 AM
      4 responses
      29 views
      0 likes
      Last Post Stanfillirenfro  
      Started by Irukandji, Today, 04:33 AM
      3 responses
      11 views
      0 likes
      Last Post Irukandji  
      Started by Alpnach007, Today, 11:14 AM
      2 responses
      11 views
      0 likes
      Last Post Alpnach007  
      Working...
      X