Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi Time Frame bugs

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

    Multi Time Frame bugs

    Using NT 7.0.0.22:
    I have a strategy with three time frames. Only one instrument is traded. Trading is only done on the third dataseries (if BarsInProgress==2).

    Bug 1:
    EntriesPerDirection=1 is not effective. I assume this is because EntriesPerDirection is tied to Positions[0] (only looking at the primary series). Documentation http://www.ninjatrader.com/support/h...rdirection.htm does not say this only works for primary series. Note that I have Unmanaged=false.

    Bug 2:
    Position is not operating in current BarsInProgress context
    The documentation http://www.ninjatrader.com/support/h...nstruments.htm says it should
    "The property Position always references the position of the instrument of the current context."
    When BarsInProgress==2 and my code checks Position.MarketPosition it is always showing Flat.
    Due to this false result my code places more orders (and these all pile up since EntriesPerDirection=1 is not working).

    So it looks as though in NT NT 7.0.0.22 Position only reports the status of the primary series (ie is tied to Positions[0] and is not operating in the current context as per documentation).

    Workaround: I found that using Positions[2].MarketPosition gives the true result. But here the documentation http://www.ninjatrader.com/support/h...?positions.htm is confused because it says Positions
    should only be used when your strategy is executing orders against multiple instruments
    Whereas with the current implementation it is essential to use Positions[x] when trading a single instrument if this trading is being done on anything except the primary series.

    #2
    Bug 3:
    SetTrailStop not working on non-primary series
    It I use
    SetTrailStop("", CalculationMode.Ticks, trailStopTicks, false)
    before EnterLong(DefaultQuantity) then the order (placed in context of non-primary series) always gets closed when the next primary (longer) bar gets fired (even though I have no trading code against the primary series. The trade close is marked as "TrailStop", but the simulator is not actually emulating how a trailing stop would work at a broker. Instead its just closing the trade at a fixed time, instead of looking at price!
    Note: I am running this in Strategy Analyzer.

    Comment


      #3
      I have strategies with multiple series; I haven't run extensive tests but my understanding is that "EntriesPerDirection" sets the maximum number of simultaneous trades in the same direction, without regard to what series they are.

      The reason I think this is that I once thought the limit applied to each series, so I left it at a low number. When I did that, NT7 blocked trades from being entered on other series.

      I believe that if you set "EntriesPerDirection=1", then NT7 will not enter a long(short) trade if any long(short) position exits in any series. When the position is closed, then new trades can be entered. I never want NT7 to block a trade, so I just set "EntriesPerDirection=1000000".

      Comment


        #4
        Thanks for your reply kdoren.

        I think EntriesPerDirection does work as expected in a multi- time frame strategy in some circumstances.
        But what I seem to have found is bugs that only show up when certain combinations of features are used.

        So EntriesPerDirection=1 probably does work if you dont use SetTrailStop when placing an order on a non-primary series (which uses the same instrument as the primary series).

        However EntriesPerDirection=1 does not work in the current version in conjunction with SetTrailStop, when placing orders on non-primary series. In this case NT does not detect current Position of the only instrument being used (thinks it is flat), hence allows placing of any number of orders on top of each other.

        The impression I am getting is that Multi Time Frame functionality for a single instrument has only been designed/tested by NT for trading on the primary series (but the documentation does not mention this restriction).
        It looks as though trading on non-primary series is only meant to be for instruments different to the instrument of the primary series.
        If this is how NT 7 is going to be released then the documentation needs to be updated to mention these restrictions. But if the documentation is correct then these are bugs.

        Comment


          #5
          DaveE, your findings are correct - if you're using a MTF strategy we recommend executing to the primary series in case the added series are multiples / other timeframes of the instrument being traded - I'll forward this as well so it can be added to the helpguide as well.
          BertrandNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by MarianApalaghiei, Today, 12:35 AM
          1 response
          5 views
          0 likes
          Last Post MarianApalaghiei  
          Started by Rogers101, 05-05-2024, 11:30 AM
          17 responses
          55 views
          0 likes
          Last Post Rogers101  
          Started by haas88, 03-21-2024, 02:22 AM
          13 responses
          153 views
          0 likes
          Last Post haas88
          by haas88
           
          Started by YongJane, Today, 01:00 AM
          0 responses
          2 views
          0 likes
          Last Post YongJane  
          Started by MSerag, 05-06-2024, 11:52 PM
          4 responses
          25 views
          0 likes
          Last Post MSerag
          by MSerag
           
          Working...
          X