Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Urgency attention needed: Bug in real trading NT 7.0.1000.39

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

    Urgency attention needed: Bug in real trading NT 7.0.1000.39


    NT 7.0.1000.39
    TWS 960.2G


    I began this morning activating for live trading, an automated Strategy working with IB.

    I set "Wait until Flat before executing" and obviously "Sync Account Position", so the Strategy began with the color Yellow at first.

    When the first trade came, it was executed fine BUT the Strategy Tab didn't show the Update for the new position, as you can compare in the files below, called " Position and Strategy". You can clearly see that there is an active position but not shown properly in the Strategy-Tab. Another proof is the color changed from Yellow to Green. So at this point, I decided to stop the Strategy cause I feared problems ahead.

    After reset NT, connecting it once again, I repeated the process but this time is different, even worse. Now when the Strategy, synced with the IB-account in flat, got its first trade executed with just 1 contract, the Update in the Strategy-Tab shows Quantity of 2 instead of just one contract as it was filled. You can see this in the files below called "Strategy Bug and OrderBug".

    Clearly, there's a bug in NT 7.0.1000.39 and I don't know how to fix this. Repair/Reset DB? Downgraded to NT 7.0.1000.38 ? Reinstalling ?

    I have a lot of pressure on me but with this bug I can't work. It's really weird cause NT7 is a mature product.

    Please put your attention on this
    Looking forward
    Attached Files
    Last edited by pstrusi; 10-25-2018, 03:18 AM.

    #2
    Hello pstrusi,

    Thanks for your post.

    It sounds like there is a misunderstanding surrounding start behaviors and strategy/account position. The way you describe the occurence sounds like NinjaTrader did exactly what it was configured to do.

    You have Wait Until Flat and Sync Account Position enabled. The strategy calculates what trades would have been taken and what the strategy's virtual position is. It determines it is not flat (shows yellow in the strategies tab) and waits until that virtual position gets closed before allowing live trades. Sync account position does exactly that. It will sync the account position to the calculated strategy position. This does not flatten a strategy position so it is synchronized with the account, it will submit an additional order to the account to sync it with the strategy position. The strategy position would not change and the strategy will still need to flatten this virtual position before the strategy can trade live.

    I've included a video that explains start behaviors further and I have included documentation links for Strategy vs. Account position and Syncing Account Positions.

    Understanding Strategy Position vs. Account Position - https://www.youtube.com/watch?v=US9cKUwLMOA

    Strategy vs. Account Position - https://ninjatrader.com/support/help..._account_p.htm

    Syncing Account Position - https://ninjatrader.com/support/help..._positions.htm

    Please let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Jim,

      I understand perfectly how the start (behaviors and strategy/account position). Perhaps I didn't explain good enough the issue.

      Initially, my IB account ( live account ) and my Strategy Position ( NT ) are both flat, and besides that, they begin "synced" and waiting for a new trade to start a position. So far so good.
      The first trade happened, order filled and then my IB account has Short Position of 1, and NT ( in the position-tab ) shows the same BUT the Strategy-tab shows nothing, all in zero, and now on green color but not Position at all. So now, do you see the issue or do you still think I don't know what I'm doing? I've been around NT for a decent time Jim.

      After realized this issue I decided to stop the Strategy, reset NT looking for a quick fresh start and beginning once again, it failed again.
      After searching in the executions and orders filled, I've realized that the database with trades is corrupt, therefore the Strategy positions give errors always.
      I'm gonna do a total reinstallation erasing old folder and files, for sure it will help.

      This is a benevolent advice: I don't know if you guys are collapsed for much work, but the Support forum is a difficult tool to use now after the done changes. The index search is a mess, you can't look for older posts as you did before which can be actually helpful. Searching older post with experiences usually are very useful to solve problems quickly.

      Thanks
      Last edited by pstrusi; 10-25-2018, 09:05 AM.

      Comment


        #4
        Hello pstrusi,

        Let's look closer at what happened when enabling.

        Initially, my IB account ( live account ) and my Strategy Position ( NT ) are both flat, and besides that, they begin "synced" and waiting for a new trade to start a position. So far so good.
        The first trade happened, order filled and then my IB account has Short Position of 1, and NT ( in the position-tab ) shows the same BUT the Strategy-tab shows nothing, all in zero, and now on green color but not Position at all.
        You mention that account was flat and the strategy calculated a flat position from processing historical data when it was enabled. If the strategy calculates flat and the account is flat, they would already be synchronized and the Synchronize Account Position behavior would not submit an additional order. We do see an order for "Syncing strategy position" in your orders tab which would mean that the strategy did not calculate the same position as the account and a reconciliary order was placed to the account to sync it to the calculated strategy position.

        Another item that sticks out is that the strategy was not green when you enabled, but turned green after the first order. This is another sign that the strategy was not flat when it was enabled and then that first order closed the strategy's virtual position to return it to flat. The strategy then is in a flat position and turns green. The next order from the strategy will then submit live.

        This synchronization order is what would have changed the actual position before the strategy turns green.

        We should also be clear that the strategy position that is calculated from historical data is conceptually the same thing as a backtest. The strategy uses that data to calculate what trades would have been placed, not to be confused with orders that were actually placed with realtime data in previous runs.

        I've been using Google to search the forums and I would rarely use the old search tool except for searching the NinjaScript File Sharing forums. The search utility would be built into the forum and wouldn't be something that we could easily change, but if you have some other feedback for the new forum, I'll be happy to send your feedback to the Marketing team.

        Let me know if there is anything else I can do to help.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hi Jim,

          Last night I decided to complete a whole new Ninjatrader7 installation, so a fresh start from zero. I'm gonna tell you in few lines what happened this morning. I think to know what the flaw is. I'll tell you step by step:

          - After the new reinstallation, I connected to IB-TWS, with data come alone seamlessly and since there has not been a single trade since installation all position or Qty are zero. So far so good.

          - So, I have my IB-live account totally flat ( just cash ) , and I have my new NT7 installation ready for work, therefore, both obviously "synchronized" or synced with all in "zero".

          - I start the only Strategy that I work with, activating it with the following "start behavior: Wait until flat before executing live", it began as "yellow color" in the strategy-tab.

          - Since both accounts are totally synced there's NOT need for additional orders at all.

          - Before continuing it's important to say this: The Strategy is pretty simple. It starts by opening the first position and it keeps reversing positions with one order ( Qty = 2 ) as needed to have always an active position. So, in this case to have always an active position of 1, you have to submit orders by Qty = 2. So, now I continue with the narrative.

          - When I start my Strategy as "Wait until flat before executing live", NT calculates and keeps an internal active StrategyPosition = 1, so the order will be submitted when the internal StrategyPosition has to change because a new signal. My Strategy is designed to reverse a position with just one order with a double Qty of actual Position, so NT internally should be submitted an order of Qty = 2, but since it should be synced with all accounts which are at Zero, it correctly submitted an order QTY = 1, as you can see in the file attached below "Bug1". So far so good. But here comes the problem: it seems that NT is unable to set the right actual StrategyPosition because weirdly it shows as 2L, which is clearly wrong! as you can see in the file attached below as "Bug2" My thought about the possible cause of this is since this Strategy reverses position with just one order with a Qty = 2, this causes, somehow a mess with the actual StrategyPosition. Not needed to tell the dangers of this bug if I would have my Algo running without supervision. Obviously, this error is avoidable if I start my strategy when markets open a new session.

          So, please take note, pass it to "Dev Team". NT7 is a mature product that it should be prepared to manage this simple operation.

          EDIT: additional note
          1. If you start the Strategy instead as "immediately submit live working historical orders" the issue doesn't show. I really hoped to bring some new info here.


          In regards to search in the forum, previous the change, I was able to look for anything within the forum, no need to use google, that's what I meant.


          In any case thanks for your attention, I really hope you can fix this.




          Attached Files
          Last edited by pstrusi; 10-26-2018, 07:39 AM.

          Comment


            #6
            Hello pstrusi,

            So we are on the same page, I've recorded a demo reviewing Wait Until Flat and Synchronize Account Position using the SampleMACrossover strategy.

            Demo - https://drive.google.com/file/d/1x6v...w?usp=drivesdk

            - When I start my Strategy as "Wait until flat before executing live", NT calculates and keeps an internal active StrategyPosition = 1, so the order will be submitted when the internal StrategyPosition has to change because a new signal. My Strategy is designed to reverse a position with just one order with a double Qty of actual Position, so NT internally should be submitted an order of Qty = 2, but since it should be synced with all accounts which are at Zero, it correctly submitted an order QTY = 1, as you can see in the file attached below "Bug1". So far so good. But here comes the problem: it seems that NT is unable to set the right actual StrategyPosition because weirdly it shows as 2L, which is clearly wrong! as you can see in the file attached below as "Bug2" My thought about the possible cause of this is since this Strategy reverses position with just one order with a Qty = 2, this causes, somehow a mess with the actual StrategyPosition. Not needed to tell the dangers of this bug if I would have my Algo running without supervision. Obviously, this error is avoidable if I start my strategy when markets open a new session.
            I could see where the strategy is in a virtual 1L position, then has the account synchronize to that position, and then logically the strategy enters 2L. It gets a little bit hazy with the information provided, though. I would expect the Strategy and Account to be synchronized and have the same position, but I don't exactly see this in the Orders tab, and I can't confirm without a picture of the Accounts tab.

            I think with the last item here that more needs to be explained. How simple is this strategy? If it is simple enough to follow, could you share it with me and give me some clear steps where I can reproduce on the Market Replay connection? You can send me a message at platformsupport [at] ninjatrader [dot] com with the text "Attn Jim" and a link to this thread.

            I look forward to being of further assistance.
            JimNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            18 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Working...
            X