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 Mindset, 04-21-2026, 06:46 AM
      0 responses
      67 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      96 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      53 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      108 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      63 views
      0 likes
      Last Post PaulMohn  
      Working...
      X