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 dot draw ellipse issue

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

    draw dot draw ellipse issue

    I am trying to draw a dot or an ellipse but it wont show on the screen

    this is all i have on onbarupdate

    DrawEllipse("tag1", true, 5, Close[5], 0, Close[0], Color.Blue, Color.Blue, 5);
    DrawDot("tag2", true, 0, Low[0] - TickSize, Color.Red);


    nothing shows up on the chart.

    no live connection just the chart being loaded

    #2
    Hello,
    Thank you for your post.

    This is happening because there are not enough bars contained in the data series you are accessing. The correct way to structure your OnBarUpdate() would be like this:

    if (CurrentBar<5)
    return;
    DrawEllipse("tag1", true, 5, Close[5], 0, Close[0], Color.Blue, Color.Blue, 5);
    DrawDot("tag2", true, 0, Low[0] - TickSize, Color.Red);

    This will check how many bars we have seen (CurrentBar) and to exit the OnBarUpdate() method if an insufficient number of bars has been seen.

    You may reference the following forum tips page for more information on how to ensure that enough bars have been seen.


    If you have any further questions please let me know.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      thank you I it was like you said an index issue

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by selu72, Today, 02:01 PM
      1 response
      7 views
      0 likes
      Last Post NinjaTrader_Zachary  
      Started by WHICKED, Today, 02:02 PM
      2 responses
      11 views
      0 likes
      Last Post WHICKED
      by WHICKED
       
      Started by f.saeidi, Today, 12:14 PM
      8 responses
      21 views
      0 likes
      Last Post f.saeidi  
      Started by Mikey_, 03-23-2024, 05:59 PM
      3 responses
      51 views
      0 likes
      Last Post Sam2515
      by Sam2515
       
      Started by Russ Moreland, Today, 12:54 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Erick  
      Working...
      X