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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        64 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        35 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        59 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        62 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        51 views
        0 likes
        Last Post CarlTrading  
        Working...
        X