Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Dots (DrawDot) not being displayed in the chart

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

    Dots (DrawDot) not being displayed in the chart

    I'm coding an indicator that prints a dot on the high or low of a bar under certain conditions (e.g. SMA cross). For some reason, when I run the script, I can see the dot ONLY ONCE in the last few minutes.

    As I go back in time no other 'dots' are being displayed.

    I used a Print statement to confirm that a DrawDot was called in my code, and it shows in the Output window many times ("RED DOT ****"), but the dots don't display in the chart, although the code logic is correct and DrawDot is being called as confirmed by the Print statement just after it.

    if (condition)
    {
    // Paint Red DOT
    DrawDot("RedDot", true, 0, High[0] + 2 * TickSize, Color.Red);
    Print("RED DOT ****");

    }


    Any clues?

    Thanks.
    PS: I"m new to Ninjascript.
    Last edited by ds1111; 03-01-2012, 08:54 PM.

    #2
    Ok... I did some research... looking at others code in the forum... it seems that the 'tag'
    in DrawDot(string tag, bool autoScale, int barsAgo, double y, Color color) needs to be unique.

    The solution I saw and it worked for me was to use 'CurrentBar.ToString() to create a unique tag for each dot being drawn in the char.
    Please, let me know if there are other ways to do this... but so far this work.


    DrawDot(CurrentBar.ToString(), true, 0, High[0] + 2 * TickSize, Color.Red);


    Comment


      #3
      Thanks for posting the update, yes that could be one solution. The official sample on that topic would be found here - http://www.ninjatrader.com/support/f...ead.php?t=3419

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Hwop38, 05-04-2026, 07:02 PM
      0 responses
      160 views
      0 likes
      Last Post Hwop38
      by Hwop38
       
      Started by CaptainJack, 04-24-2026, 11:07 PM
      0 responses
      307 views
      0 likes
      Last Post CaptainJack  
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      245 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      348 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      178 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Working...
      X