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

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
      BertrandNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by elderan, Today, 08:03 PM
      0 responses
      3 views
      0 likes
      Last Post elderan
      by elderan
       
      Started by algospoke, Today, 06:40 PM
      0 responses
      10 views
      0 likes
      Last Post algospoke  
      Started by maybeimnotrader, Today, 05:46 PM
      0 responses
      9 views
      0 likes
      Last Post maybeimnotrader  
      Started by quantismo, Today, 05:13 PM
      0 responses
      7 views
      0 likes
      Last Post quantismo  
      Started by AttiM, 02-14-2024, 05:20 PM
      8 responses
      169 views
      0 likes
      Last Post jeronymite  
      Working...
      X