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 SalmaTrader, 07-07-2026, 10:26 PM
        0 responses
        47 views
        0 likes
        Last Post SalmaTrader  
        Started by CarlTrading, 07-05-2026, 01:16 PM
        0 responses
        22 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 06-17-2026, 10:32 AM
        0 responses
        15 views
        0 likes
        Last Post CaptainJack  
        Started by kinfxhk, 06-17-2026, 04:15 AM
        0 responses
        21 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 06-17-2026, 04:06 AM
        0 responses
        23 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X