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 cls71, Today, 04:45 AM
      0 responses
      1 view
      0 likes
      Last Post cls71
      by cls71
       
      Started by mjairg, 07-20-2023, 11:57 PM
      3 responses
      213 views
      1 like
      Last Post PaulMohn  
      Started by TheWhiteDragon, 01-21-2019, 12:44 PM
      4 responses
      544 views
      0 likes
      Last Post PaulMohn  
      Started by GLFX005, Today, 03:23 AM
      0 responses
      3 views
      0 likes
      Last Post GLFX005
      by GLFX005
       
      Started by XXtrader, Yesterday, 11:30 PM
      2 responses
      12 views
      0 likes
      Last Post XXtrader  
      Working...
      X