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 sjsj2732, 03-23-2026, 04:31 AM
          0 responses
          69 views
          0 likes
          Last Post sjsj2732  
          Started by NullPointStrategies, 03-13-2026, 05:17 AM
          0 responses
          312 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          306 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          146 views
          1 like
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          105 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Working...
          X