Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategies disappeared from Strategies tab.

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

    #16
    Hi Jesse,

    Again this morning I open up my virtual machine and I'm met with an interactive brokers window asking me if I want to re-login or exit the application. I chose Re-login and it re-logined. I wonder why that happened since i only have Auto-restart on for 11:30 PM CET.

    Then i looked at the log and see this:
    Click image for larger version

Name:	image.png
Views:	114
Size:	9.5 KB
ID:	1255329

    according to IBKR's website there is no schedule server maintainance or the like during the times in yellow above.

    Click image for larger version

Name:	image.png
Views:	77
Size:	7.0 KB
ID:	1255330

    Now all strategies are re-enabled and showing green but I don't like to e.g. see the Acct. Position = 1 and Position = 0. for example:

    Click image for larger version

Name:	image.png
Views:	77
Size:	3.2 KB
ID:	1255331

    My IBKR account is indeed in a position and I don't see any planned order to exit that position from the Orders tab, hence I could be in such position forever and that's not what I want. I do have bit custom order handling in ninjascript for the strategies that I may look into but I want to hear what you have to say about the above first! Looking forward to your reply!

    Best,
    Cedalgo

    Comment


      #17
      Hello Cedalgo,

      When you say that you opened the virtual machine, was it running? the machine would need to be open for the platform and data feed to work. If the machine is going to sleep or is not always on that may be why. You may need to view the logs in TWS to better understand what happened and why it was asking to log on again.

      The errors in NinjaTrader are just saying that the connection was lost, that is what TWS reported to NinjaTrader.

      The strategies are currently not in sync with the account, that would be due to the start behaviour being used. If you have a strategy that is disabled and then you re enable it the strategy will completely restart and won't know about existing positions or orders. For it to know about those positions or orders it needs to re process and resubmit those orders in historical so it can correctly match the position. Because the strategies currently do not know about those positions they won't exit those position, you would need to manually close those positions and restart the strategies.
      JesseNinjaTrader Customer Service

      Comment


        #18
        The virtual machine was kept running all night. The remote desktop application i closed.

        Ok i contacted IBKR to know more about the secdef error.

        Is it normal for the strategy to cancel e.g. a stop loss order when a connection issue occurs? I would wish in this case that the stop loss order was not cancelled because then the real account position would be "safe". Here you see the cancellation order in red box:

        Click image for larger version

Name:	cancelorder.png
Views:	107
Size:	206.0 KB
ID:	1255444
        The cancellation order is placed after the strategy was automatically re-enabled when the connection was re-established and I can see that the strategy correctly identified that there was one long position on the account when it was re-enabled, so why doesn't it keep the stop loss order instead of cancelling it? :

        Click image for larger version

Name:	image.png
Views:	78
Size:	38.5 KB
ID:	1255445
        I have checked that the stop loss price was never reached.

        Comment


          #19
          Hello Cedalgo,

          I believe you should read the sync account position page as it explains the strategies start behaviors. It would be expected for most start behaviors to cancel open orders if your strategy is re enabled and it did not re generate the same exact order. A strategy needs to work exactly the same as it did previously when it re processes the historical data and submit the exact same orders if they should be resumed. if it does not do that then it will cancel the orders.



          When your strategy starts it will check for any active orders previously generated by the strategy on your account and cancel those first. Should the strategy be unable to cancel and receive confirmation on the cancellation of these orders within 40 seconds the strategy will not start and an alert will be issued.
          others may try to resume the orders:

          Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled. Should the strategy be unable to cancel and receive confirmation on the cancellation of these orders within 40 seconds the strategy will not start and an alert will be issued.

          * A previously generated order is considered to match an active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical.
          JesseNinjaTrader Customer Service

          Comment


            #20
            Ok thanks for that, i will try to read more up on the account syncing.

            For now I would like to cover another important issue regarding re-login on TWS after the scheduled auto-restart around 11:30 PM CET. I still am asked if I want to re-login or exit application. Pressing re-login multiple times yields nothing so I exited the application. Then I went to Connections in NT and clicked on the TWS connection where I had configured an auto-logon with a logon path. That yields this pop up (lost or unable to establish communications with IB TWS/GW):


            Click image for larger version

Name:	image.png
Views:	129
Size:	5.8 KB
ID:	1255494

            I found another post that mentions this error but it's bit old so not sure the steps there are relevant. I have TWS 10.19.1.k (installed in below 1019 folder) and running latest version of NT. I do have also ibgateway installed and some remains of a previous tws installation (1022 folder):

            Click image for larger version

Name:	image.png
Views:	67
Size:	2.8 KB
ID:	1255495

            How do I resolve this issue?

            Thanks

            Comment


              #21
              Hello Cedalgo,

              The auto login feature in the NinjaTrader connection menu is to be able to auto sign into TWS when it launches the TWS application. The re login screen you are referring to i believe is part of TWS and is some kind of prompt coming from TWS is that correct?

              The auto login feature requires you to specify the path so as long as you used the path to the current supported version 10.19.1k that should be correct.

              Please make sure you have everything configured as shown in the connection guide: https://support.ninjatrader.com/s/ar...language=en_US

              JesseNinjaTrader Customer Service

              Comment


                #22
                Hi Jesse,

                Yes the re-login screen is a TWS prompt. I will save a sceenshot of it it happens again but that can be a TWS issue so we can park that for now.
                My question is on the expected behaviour of the auto-logon when TWS is closed:
                Let's say NT is open and TWS is closed. I have configured the TWS connection correctly with auto-logon (with password).
                I go to Connections and click on the TWS connection, then i see TWS opens and credentials get filled, it tries to open it but the attached pop up appears.

                If I have TWS open already it establishes the connection without issues.

                Thanks

                ​​​​
                Attached Files

                Comment


                  #23
                  Hello Cedalgo,

                  I would not be sure on that message, I would suggest to use the help->email support option to connect with the platform support team for further assistance with TWS.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by PaulMohn, Today, 03:49 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post PaulMohn  
                  Started by inanazsocial, Today, 01:15 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_Jason  
                  Started by rocketman7, Today, 02:12 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post rocketman7  
                  Started by dustydbayer, Today, 01:59 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post dustydbayer  
                  Started by trilliantrader, 04-18-2024, 08:16 AM
                  5 responses
                  23 views
                  0 likes
                  Last Post trilliantrader  
                  Working...
                  X