Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

FirstTickOfBar problem

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

    FirstTickOfBar problem

    The FirstTickOfBar event is called before the bar closes!
    This only happens on the last bar. After we put the indicator on the chart.

    Code:
    protected override void Initialize()
    {
          CalculateOnBarClose=false;
          Overlay= true;
          Add(PeriodType.Tick,1);
    }
    
    protected override void OnBarUpdate()
    {
         if(BarsInProgress==1)
    	  Print(Times[1][0]);
    
         if(BarsInProgress==0 && FirstTickOfBar)
    	  Print(Times[0][0]);
    
    }
    Last edited by vladko; 04-07-2016, 11:11 AM.

    #2
    Hello,
    I have tested this on my end and I do not see the first tick of bar occur until the bar closes.
    What type of chart are you running this code on?
    Cody B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

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