Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8, b3 - Playback - market replay - using multiple strategies on same contract

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

    NT8, b3 - Playback - market replay - using multiple strategies on same contract

    It's definitely not doing what I expected.

    I have my "base" strategy.

    I renamed it 4 times, and in each variation - I changed my allowable entry times out every 2 minutes.

    I attached each strategy to Strategies tab,

    So

    strategy4, ES 03-14, 9:30-10:05 entry only
    strategy3, ES 03-14, 9:30-10:00 entry only
    strategy2, ES 03-14, 9:30- 9:55 entry only
    strategy1, ES 03-14, 9:30- 9:50 entry only


    So far - only strategy 4 and 3 have done anything, 2 and 1 are idle. Strategy1 was the original - and would be up $$$ ...

    I can tell they are all running - as each is opening an external file for each day, that's in the output log.

    This would have worked in NT7.

    The only thing I can guess is that each one has a named entry - and having the same name come from the other strategies - is ignoring it. So it's like it is no longer strategy name +order name as the unique key. Maybe this was intentional?


    I guess if I had parameters for this time entry - running multiple strategies with different times submitting orders with the same name would be blocked. This doesn't sound right.



    I'm going to uniquely name each entry and restart the test. This would at least prove unique entries need named in NT8 b3.

    #2
    That didn't exactly help either.

    Strategy1 was firing and filling..

    I added the SampleMACrossover - and changed parameters - 9/24, 11/24, 10/25. Those appear to be doing their own thing as expected and accumulating losses.


    Is this new? OnPositionUpdate fires for other strategies in your strategy?

    When each SampleMACrossover fires - my Strategy1,2,3,4 OnPositionUpdate fire for the MACrossover change.

    (I never tried in NT7). This could be bad as my strategy depends on it's trades as to a position loss/gain, not something else.

    Comment


      #3
      ok - I tracked it down... the OnPositionUpdate fires for ALL strategies after the 1st strategy takes a trade, my logic detects that a trade has happened for that day, increments a counter and resets it the next day..but since this is being called for all strategies, each one is detecting the trade, increments their own counter, and thinks a trade has happened for that strategy.

      So why is OnPositionUpdate now called for all strategies when orders were submitted from else where?

      I thought it would be for only the strategy that submitted the order. How do I filter? Or is this a bug?
      Last edited by sledge; 09-08-2015, 08:31 PM. Reason: more details

      Comment


        #4
        Alright, looked at the documentation, and that's kind of disappointing.

        There should be a way to know if it was the source strategy and filter out other strategies.



        -----------------------------------


        Definition
        An event driven method which is called for every time the position of an instrument which matches the strategy changes state.

        • This method is called after OnExecutionUpdate()
        • OnPositionUpdate() is guaranteed to be called for every change in position for a strategy's instrument
        • You will also receive position updates for manually placed orders, or orders managed by other strategies.


        Note: Since the strategies position update method is called for every change in position by the underlying instrument and account on which the strategy is running, you will receive position updates for orders which were NOT managed by the strategy.

        Comment


          #5
          Hello sledge,

          Thank you for your note.

          Currently, I have not found a way to filter these, however, I am working with development to find further information for you.

          I appreciate your patience.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello sledge,

            Thank you for your note.

            Currently, I have not found a way to filter these, however, I am working with development to find further information for you.

            I appreciate your patience.
            You might need to get NinjaTrader_Dave,NinjaTrader Product Management.

            If there is no way to isolate each strategy - that's a serious problem.

            I can understand a "code breaking change" to have strategies that can be able to act independent of each other... But if there's no way - we need to hold the phone.

            Maybe they can work something out in NT8 B4.

            Comment


              #7
              We are currently working on exactly this issue, as it came up in another discussion as well. Our plan is to revert to the NT7 behavior of triggering OnPositionUpdate() for each update in the strategy position, but it is currently triggering on each update of the account position. I do not believe this will be included in Beta 4, but you should see it implemented in the near future.
              Dave I.NinjaTrader Product Management

              Comment


                #8
                Multiple accounts

                This is a very serious issue in my opinion the ability to trade multiple contracts with nt8. I cant see how we don't have this functionality. I hear many folks each day complain they have mutiple accounts and would like these accounts to be mirror traded.

                Comment


                  #9
                  Originally posted by NinjaTrader_Dave View Post
                  We are currently working on exactly this issue, as it came up in another discussion as well. Our plan is to revert to the NT7 behavior of triggering OnPositionUpdate() for each update in the strategy position, but it is currently triggering on each update of the account position. I do not believe this will be included in Beta 4, but you should see it implemented in the near future.
                  We could probably do with both. So the Strategy can track its own position, and we can also track the overall position created by multiple strategies running on the same instrument.

                  Comment


                    #10
                    Agreed, Both is what I would use...

                    If ID is passed I can check the ID of the strategy vs the ID of the source.

                    Comment


                      #11
                      I can see how that could be useful, as well. I've added a note to this effect to our task related to this, so that we can at least take it into account and consider possibilities around this.
                      Dave I.NinjaTrader Product Management

                      Comment


                        #12
                        I've got a correction for you guys on my last post. While we are changing the implementation of OnPositionUpdate() back to the NT7 behavior of only triggering on strategy position updates for Beta 5 (Beta 4 will remain as-is), we actually already have a number of event handlers defined within the Account class which you can subscribe to in order to create your own callback methods.

                        For example, you can subscribe to the Account.Accounts[0].PositionUpdate event handler, then attach it to a callback method called MyOnAccountPositionUpdate(), which you can then use for any code to be triggered on any account position updates. The Account class also has an OrderUpdate and ExecutionUpdate event handler, among numerous others.

                        We are going to beef up our documentation around these event handlers and filtering for account position updates vs. strategy position updates to clarify this, and we will add a few more relevant code examples to the page below:

                        http://ninjatrader.com/support/helpG...tionupdate.htm
                        Dave I.NinjaTrader Product Management

                        Comment


                          #13
                          Originally posted by NinjaTrader_Dave View Post
                          I've got a correction for you guys on my last post. While we are changing the implementation of OnPositionUpdate() back to the NT7 behavior of only triggering on strategy position updates for Beta 5 (Beta 4 will remain as-is)
                          I have revisited this in running 2 strategies with OnPositionUpdate and AllTrades in NT8b6, and each strategy does keep to themselves and does not cross over.

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by fitspressoburnfat, Today, 04:25 AM
                          0 responses
                          2 views
                          0 likes
                          Last Post fitspressoburnfat  
                          Started by Skifree, Today, 03:41 AM
                          1 response
                          4 views
                          0 likes
                          Last Post Skifree
                          by Skifree
                           
                          Started by usazencort, Today, 01:16 AM
                          0 responses
                          1 view
                          0 likes
                          Last Post usazencort  
                          Started by kaywai, 09-01-2023, 08:44 PM
                          5 responses
                          604 views
                          0 likes
                          Last Post NinjaTrader_Jason  
                          Started by xiinteractive, 04-09-2024, 08:08 AM
                          6 responses
                          23 views
                          0 likes
                          Last Post xiinteractive  
                          Working...
                          X