• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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:
    
     protected override void OnBarUpdate()
     {
     if ( (Open[1]-Close[1])>0) 
         {
                        Draw.Dot(this, "D", true, 0 , Low[0]-TickSize, Brushes.Red);
    
      
     }
    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"+CurrentBar, true, 0 , Low[0]-TickSize, Brushes.Red);
    }
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by indy73, Today, 10:52 PM
    0 responses
    3 views
    0 likes
    Last Post indy73
    by indy73
     
    Started by martyn73, Today, 07:04 PM
    0 responses
    5 views
    0 likes
    Last Post martyn73  
    Started by sergey_z, Today, 02:56 PM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by samir, Today, 02:46 PM
    1 response
    20 views
    0 likes
    Last Post NinjaTrader_Kate  
    Started by neoikon, Today, 02:24 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Working...
    X