Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Problems with Draw.Dot, Draw.TriangleUp, etc

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

    Problems with Draw.Dot, Draw.TriangleUp, etc

    Hello,

    This piece of code:

    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.
    if (CurrentBar < 1) return;

    if (Close[0]>Close[1])
    Draw.TriangleUp(this, "tag2", true, 0, Low[0] - 1*TickSize, Brushes.Blue);

    }

    compiles just fine, but does nothing to the chart. The triangles (or dots) are not being drawn as they are in NT 7 where I use this piece of code:

    DrawTriangleUp(CurrentBar.ToString(), true, 0, Low[0] - 1*TickSize, Color.Blue);

    What is wrong here? Any help in resolving this issue would be appreciated.

    Thanks.

    #2
    Hello,

    Thank you for the post.

    The fundamental difference between these two lines of code is the Tag being used, in your NT7 code you have a unique tag and in the NT8 code you do not:

    Code:
    DrawTriangleUp([B]CurrentBar.ToString()[/B], true, 0, Low[0] - 1*TickSize, Color.Blue); 
    
    Draw.TriangleUp(this, [B]"tag2"[/B], true, 0, Low[0] - 1*TickSize, Brushes.Blue);
    The NT8 code would only draw 1 triangle on the entire chart, the NT7 code would draw multiple. To make this the same you could use the same code:

    Code:
    Draw.TriangleUp(this, [B]CurrentBar.ToString()[/B], true, 0, Low[0] - 1*TickSize, Brushes.Blue);
    Or to be less generic to prevent future problems in case you add more objects, a more correct solution would be:

    Code:
    Draw.TriangleUp(this,[B] "SomeTag" + CurrentBar[/B], true, 0, Low[0] - 1*TickSize, Brushes.Blue);

    I look forward to being of further assistance.

    Comment


      #3
      Jesse, thanks! That does appear to have solved my problem.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      566 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      330 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      547 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      548 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X