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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    155 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    307 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    244 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    346 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    176 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X