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
    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Belfortbucks, Today, 09:29 PM
    0 responses
    3 views
    0 likes
    Last Post Belfortbucks  
    Started by zstheorist, Today, 07:52 PM
    0 responses
    7 views
    0 likes
    Last Post zstheorist  
    Started by pmachiraju, 11-01-2023, 04:46 AM
    8 responses
    150 views
    0 likes
    Last Post rehmans
    by rehmans
     
    Started by mattbsea, Today, 05:44 PM
    0 responses
    6 views
    0 likes
    Last Post mattbsea  
    Started by RideMe, 04-07-2024, 04:54 PM
    6 responses
    33 views
    0 likes
    Last Post RideMe
    by RideMe
     
    Working...
    X