Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame strategy glitch.

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

    Multi Time Frame strategy glitch.

    Curious if some one can offer some info on this issue.

    I have a multi time frame strategy on the same equity.

    CalculateOnBarClose = true;

    The primary [0] time frame is a 1 min and the second [1] is a 5 min.

    I have a strategy running on the 5 min time frame. Let's call it "Y".
    If Y is true --> Open a trade.
    This strategy works fine and triggers trades on the correct bars.

    I added a condition (lets call it "X") on the 1 min time frame.
    The condition "X" simply states: if X is true, do Y.

    As an example:
    When running Y only (this is on the 5 min time frame), I get a trade trigger that, for instance, is initiated on the close of the 10:35am bar, which means the trade is executed on open of the following bar at 10:40am.
    This is correct.

    However when altering this strategy and adding:

    if (BarsInProgress == 1)
    If Y is true --> set someVariable = 1 (do not open a trade)

    if (BarsInProgress == 0)
    If X is true & someVariable == 1 --> open a trade.

    What I'm noticing is that the Y trigger still takes place on the 10:35am bar.
    However the trade is only executed on the open 1 min after, hence on the open of the 10:37am (1min time frame) bar.

    Shouldn't this be triggered on the open of the 10:36am bar?
    Why is there a 1 min lag?

    #2
    Expected. At 10:35 you get the 5 minute signal. At 10:36 you check for condition x + y. It is evaluated to true, BUT since it was evaluated to true at the end of the 10:36 bar that bar is untradeable. Next tradeable location is the open of the 10:37 bar and that is where it is placed.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick answer!

      However all conditions are true on the close of the 10:35 bar. Shouldn't execution in this case happen on the open of the 10:36 bar.

      So what you are saying, it's my understanding that in a multi time frame strategy, variables passed between different time frames require additional bars to execute?

      So for instance if I were to add an additional condition "M" for instance, on another time frame it would require another 1 minute (1 min chart) before execution?

      Comment


        #4
        No, you need to consider the order of events. 1 minute is your primary. You processed the 1 minute 10:35 before the 5 minute 10:35. Next call to 1 minute is 10:36.

        If you want to get a signal from 5 minute and submit right away you should just use the overload method on your entry orders to place it to the correct BarsInProgress.

        EnterLong(int barsInProgressIndex, int quantity, string signalName)


        Roll all of your logic into 5 minute series. Use BarsArray[0] to check the 1minute for information instead of waiting for the next update to check. Then just send your order to BarsInProgress 0.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Perfect! Thanks Josh.
          I was starting to think this had to do with the sequence of events.
          Cheers!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by alifarahani, Today, 09:40 AM
          6 responses
          31 views
          0 likes
          Last Post alifarahani  
          Started by Waxavi, Today, 02:10 AM
          1 response
          17 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by Kaledus, Today, 01:29 PM
          5 responses
          13 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by Waxavi, Today, 02:00 AM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by gentlebenthebear, Today, 01:30 AM
          3 responses
          17 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X