Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

my dot doesn't draw at the current bar

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

    my dot doesn't draw at the current bar

    here is my indicator specified 20 dots forward but it didn't plot the new dot.


    after I hit F5 it plotted the new dots



    here is my code
    Code:
            /// <summary>
            /// Called on each bar update event (incoming tick)
            /// </summary>
            protected override void OnBarUpdate()
            {
    			if(CurrentBar == 0)
    			{
    				textFont1 = new Font("Wingdings",srDotSize );
    			}
    			if (CurrentBar < 2)
    				return;
    			
    	
    
    // Note: savebar1 = CurrentBar at the first dot + 20   
    // Note: savePos1 = Price Low or High at the first dot
    			
    			if ( CurrentBar < savebar1)
    			{
    				DrawText(CurrentBar.ToString()+"l1" , true, "l", 0 , savePos1,  colorUT, 
    					textFont1, StringAlignment.Center, Color.Empty, Color.Empty, 1);
    				savebar1 = savebar1 - 1;
    
    			}

    #2
    nkhoi,

    In 6.5, you cannot draw objects into the future.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      draw forward just mean I will plot 20 dots for the next 20 bars but as you can see in the first picture it didn't do that, there were 6 new bars without the dots. I don't mean I can plot beyond the current bar.

      Comment


        #4
        Suggest you check your savebar1 logic. Not sure why you would decrement it.

        Set savebar1 to be CurrentBar + 20 when your condition is true. Then as long as CurrentBar < savebar1, draw a dot.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Josh View Post
          Suggest you check your savebar1 logic. Not sure why you would decrement it.

          Set savebar1 to be CurrentBar + 20 when your condition is true. Then as long as CurrentBar < savebar1, draw a dot.
          nether do I , so that is how I got fewer dots than what I expected, thanks.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          599 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          344 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          103 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          558 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          557 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X