Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

problem with if(BarsPeriods[0].Id == PeriodType.Day)

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

    problem with if(BarsPeriods[0].Id == PeriodType.Day)

    My strategy has minute bars and day bars as follows
    In the Initialize region I have
    Add(PeriodType.Minute,720); // 720 MINUTES=12 HOURS
    Add(PeriodType.Day,1);

    Neither of the two following statements in the Onbarsupdate region, intended to prohibit entry to a block of code, has any effect.
    if(BarsPeriods[0].Id == PeriodType.Day)
    if(BarsPeriods[1].Id == PeriodType.Minute)

    any thoughts or suggestions will be appreciated

    #2
    joemiller, I would just filter via the recommended BarsInProgress - this lets you know which bars object is actually calling the OnBarUpdate() method - http://www.ninjatrader.com/support/h...inprogress.htm

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    94 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    49 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    31 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    35 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    71 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X