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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      152 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      89 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      131 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      127 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      107 views
      0 likes
      Last Post CarlTrading  
      Working...
      X