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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      595 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      343 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      556 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      554 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X