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 CaptainJack, 05-29-2026, 05:09 AM
      0 responses
      240 views
      0 likes
      Last Post CaptainJack  
      Started by CaptainJack, 05-29-2026, 12:02 AM
      0 responses
      156 views
      0 likes
      Last Post CaptainJack  
      Started by charlesugo_1, 05-26-2026, 05:03 PM
      0 responses
      165 views
      1 like
      Last Post charlesugo_1  
      Started by DannyP96, 05-18-2026, 02:38 PM
      1 response
      247 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 05-11-2026, 05:56 AM
      0 responses
      199 views
      0 likes
      Last Post CarlTrading  
      Working...
      X