Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy entered a position but it doesn't show up in the Strategies tab

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

    Strategy entered a position but it doesn't show up in the Strategies tab

    My strategy just executed a position, I saw it in the log (my log, using Print method) but my strategy shows "-" in the position column. When I look on the Positions tab I see the position is in fact open. when I look at executions and Orders the order was filled.

    How could my strategy not know that the order was filled?

    Furthermore, is there anything I can do about it? Currently I'm watching the logs watching for it to log that it's going to exit and then I'll exit manually. But if this should happen when I'm not at the computer it could be a real problem.

    Thanks.

    #2
    The strategy could be in a flat state while your account could be long/short. Please see this article: http://www.ninjatrader-support2.com/...ead.php?t=4033
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      The strategy could be in a flat state while your account could be long/short. Please see this article: http://www.ninjatrader-support2.com/...ead.php?t=4033
      I have read that page. When I ran the strategy before the open, both the strategy and the account were in the flat state.

      Comment


        #4
        When the exit criteria was met my strategy exited the position. The position tab still shows "-". I was afraid the strategy was going to think it was short.

        What's weird is the code in the Position.MarketPosition = SHORT was being executed, so the strategy was short and it knew it. It seems that it's the Position tab of the control center that was not updating correctly.

        Comment


          #5
          Try resetting your account/database and try again. Your NinjaScript should have no confusion as to what position it has as you have already identified.
          Josh P.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Josh View Post
            Try resetting your account/database and try again. Your NinjaScript should have no confusion as to what position it has as you have already identified.
            Try again? This was live.

            What do you mean by reset the account?

            BTW I think I may have posted this in the wrong forum. I'm using Ninjatrader with Mirus. It wasn't obvious which forum was for discussing automated trading (but without tradestation or esignal).

            Comment


              #7
              I see. I thought you were live with sim. You are sure there have been no manual trades occurring in the meantime?
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Please try resetting your database regardless. Tools->Options->Misc->Reset DB.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_Josh View Post
                  Please try resetting your database regardless. Tools->Options->Misc->Reset DB.
                  I'm positive. I've never done a manual trade on this account because I set it up specifically for Ninjatrader. I do all manual trades with IB.

                  After market close I will reset my database and exit and restart. If it happens again I'll update the post. It turned out to be harmless, but it'd be nice to have the position tab correct for monitoring purposes.

                  Thanks

                  Comment


                    #10
                    My second trade appears correctly. The trade that didn't appear was not the primary instrument, I added it myself. I'm betting that the Position column is only for the primary instrument of a strategy!!!

                    If so, one would have to be careful if you run a strategy and it starts out with a position (that's not the primary instrument), because that position won't show up on the strategies tab. It would show up in the positions tab but then you wouldn't know which strategy it belonged to if you were running several.

                    This seems to be a potential problem but I don't have any ideas for an easy solution.

                    Comment


                      #11
                      Thank you for the clarification cunparis.
                      Josh P.NinjaTrader Customer Service

                      Comment


                        #12
                        I'm still not convinced this is not a problem

                        After thinking on this some more, I have a follow-up question:

                        Let's say I run my strategy that has two instruments ES & YM. It will rerun the recent history to see if there were any trades. Let's say there was a trade earlier in the day on the 2nd instrument YM. The strategy will then think it is long 1 YM. Let's say for this discussion that the account is flat.

                        The strategies tab will show positions "-" because it only shows the primary position.

                        What will the positions tab show? Does it show the open positions of strategies or open positions of accounts?

                        If it is the latter (account open positions) then there is a problem. Because the strategy would be long 1 YM yet the user would not be able to know this. If it is the former (strategy open positions) then there is a problem because we cannot know to which strategy the position belongs. I'm pretty sure it's the account positions that are shown, but in either case I believe there is a problem here.

                        Comment


                          #13
                          It is the account position. You can inform yourself in many other ways. For example, print to the Output Window.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Originally posted by NinjaTrader_Josh View Post
                            It is the account position. You can inform yourself in many other ways. For example, print to the Output Window.
                            I don't find it acceptable that a user would have to put in Print statements to know his/her position, and that the position reported by Ninjatrader would be incomplete.

                            I think the best solution is for the strategies tab to show all the open positions. My guess is that it was first designed to be single instrument and multi-instrument was added on and the situation I describe above was not thought about. It doesn't make any sense that a strategy would report no positions when in fact it does have positions, and searching through the logs to see the positions doesn't make sense. When there are several strategies running it would not be easy to see which has positions since there is only one output window.

                            Comment


                              #15
                              Not sure I follow. In the Control Center NT has never displayed information regarding virtual strategy positions besides unrealized PnL. When you have live trades it will show all the positions regardless of which instrument it is on in the Positions tab, in the Executions tab, in the Orders tab. You are asking to see the strategy position. To see this you have to print from the strategy.

                              If you are concerned about seeing the trades and which strategy it came from I suggest you monitor the executions tab and just give meaningful signal names so you know where the order came from.
                              Josh P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              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  
                              Started by DanielSanMartin, Yesterday, 02:37 PM
                              2 responses
                              13 views
                              0 likes
                              Last Post DanielSanMartin  
                              Working...
                              X