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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X