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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        650 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        370 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        109 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        574 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        577 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X