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 Waxavi, Today, 02:10 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by TradeForge, Today, 02:09 AM
      0 responses
      4 views
      0 likes
      Last Post TradeForge  
      Started by Waxavi, Today, 02:00 AM
      0 responses
      2 views
      0 likes
      Last Post Waxavi
      by Waxavi
       
      Started by elirion, Today, 01:36 AM
      0 responses
      4 views
      0 likes
      Last Post elirion
      by elirion
       
      Started by gentlebenthebear, Today, 01:30 AM
      0 responses
      4 views
      0 likes
      Last Post gentlebenthebear  
      Working...
      X