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 GussJ, 03-04-2020, 03:11 PM
    16 responses
    3,281 views
    0 likes
    Last Post Leafcutter  
    Started by WHICKED, Today, 12:45 PM
    2 responses
    19 views
    0 likes
    Last Post WHICKED
    by WHICKED
     
    Started by Tim-c, Today, 02:10 PM
    1 response
    9 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Taddypole, Today, 02:47 PM
    0 responses
    5 views
    0 likes
    Last Post Taddypole  
    Started by chbruno, 04-24-2024, 04:10 PM
    4 responses
    53 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X