Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding a timeframe

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

    Adding a timeframe

    I have a 1 minute strategy that works fine however I want to add a second timeframe for entry conditions. I've gone through all the multi timeframe reference material but as soon as I add the following:

    protected override void Initialize()
    {
    //
    Add(PeriodType.Minute, 5);

    }

    without any further references to the 5 minute index my strategy compiles but stops working. Should it not just run as before unless I add in some if(BarsInProgress == 1) conditions?

    Or do I need to change all my references for the primary series? I've tried nesting it all within a if(BarsInProgress == 0 ) condition but that doesn't help.

    Thanks in advance.

    #2
    Actually I think I've figured it out, I wasn't using an overload version of BarsSinceEntry...seems ok now

    Comment


      #3
      so what does the working code look like? care to share?

      Comment


        #4
        Originally posted by outstretchedarm View Post
        so what does the working code look like? care to share?
        I just changed:
        BarsSinceEntry() > 2

        to:
        BarsSinceEntry(0,"myTrade",0) > 2

        and it all worked fine...

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X