Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Draw.Dot in Historical Bar

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

    Draw.Dot in Historical Bar

    hi, i try this code :

    Code:
    [COLOR=#add8e6]
     protected override void OnBarUpdate()
     [/COLOR][COLOR=#000000]{[/COLOR]
     [COLOR=#000000]if ( (Open[1]-Close[1])>0) 
         {
                        Draw.Dot(this, "D", true, 0 , Low[0]-TickSize, Brushes.Red);
    [/COLOR]
      
     [COLOR=#000000]}[/COLOR]
    but i see that it plot only last bar...
    How i must do to solve it? (i want to plot all bar in historic)

    #2
    Hello turbofib,

    Thanks for your post.

    Each drawn object requires a unique "tag name". In the example you are using the tag name of "D" for each object drawn. When you use the same tag name on successive objects what happens is that the current object is removed and the new object is drawn. In your case it would have repeated up to the last occurrence of the condition leaving just the last dot plotted.

    To show all the dots, you will need a unique tag name for each one. One way to do this is to add the CurrrentBar to the name:

    Code:
    if ( (Open[1]-Close[1])>0) 
    {
        Draw.Dot(this, "D"[COLOR="Blue"]+CurrentBar[/COLOR], true, 0 , Low[0]-TickSize, Brushes.Red);
    }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    673 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    379 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    111 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    578 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    582 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X