• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ConnectionLost and SubmitOrder

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

    ConnectionLost and SubmitOrder

    Hi NT support team

    suppose I have just used the function SubmitOrder to go Long at some limit. But just after that I have my orderStatus = ConnectionStatus.ConnectionLost or ConnectionStatus.Disconnected detected in OnConnectionStatus.
    What does happen to my submit order after a connection is established again?
    Do I have to take care of the orders which did not have time to reach the brokers and resubmit them or is that handled automatically and as soon as we have a connection, the orders are sent automatically to the Broker?

    Thanks for your help

    #2
    Hello jakjak74, and thank you for your question.

    Please refer to this thread, where this question is answered in detail. If there are any further questions we may answer, we will be happy to.

    http://ninjatrader.com/support/forum...635#post488635
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thanks.
      I went through the links and need to ask some additional questions.
      First I am interested in FXCM. We can find here (http://ninjatrader.com/support/forum...ead.php?t=5349)

      FXCM
      Orders in a state "Accepted" or "Working" are on FXCM servers.
      OCO (One Cancels Other) functionality is simulated on your local PC.

      1 - If the connection is lost, and during this time one of the OCO orders is hit, do we receive after the reconnection a confirmation of that?
      In general, any order hit during a lost connection, will NT receive any information after the connection is re established?
      If yes, does it show as the original order (same name, same oco) and therefore we can let NT handle the OCO?
      If no, what mecanism do we have for cancelling the other order locally as we need some information to decide af an order was executed during the lost connection?

      2- if both OCO are hit during the lost connection, what happens with NT after reconnection? In case it received the confirmation from FXCM, one is hit, then the other, how will it handle this case?

      Thanks

      Comment


        #4
        I will be happy to answer these additional questions. I am providing an excerpt from the FXCM connection guide.

        Originally posted by http://ninjatrader.com/ConnectionGuides/FXCM-Connection-Guide
        For any order submitted during a prior trading session, NinjaTrader will be unable to determine if the order was filled or cancelled. As a result NinjaTrader will set this order to a state of "Unknown" on reconnect. It is your responsibility to call your broker to determine the true state of this order.

        OCO (One cancels other) orders are locally simulated on your PC. This means that NinjaTrader MUST be connected to your broker in order for the OCO capabilities to function. If you are disconnected and one of the OCO orders are filled, the other WILL NOT be cancelled.

        This answers your question about what happens when Ninja is disconnected with an active OCO order. Ninja will not try to cancel the other order on reconnect, and both orders can be filled by the broker.


        To mitigate this you may set up your strategy so that it forces your account position to immediately submit and to sync your strategy's position to your account position. In NT8, both these options are combined in the Start Behavior section of your strategy's properties. In NT7, the "Immediately submit live working historical orders" setting is in the Tools -> Options -> Strategies -> NinjaScript section, and "Sync account position" is an option in your strategy's properties. In each case I recommend setting your strategies to Recalculate when you reconnect. This setting in Tools -> Options -> Strategies (-> NinjaScript in NT7) -> On Connection Loss -> Handling.
        Jessica P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by superkolleech, Today, 12:46 AM
        2 responses
        12 views
        0 likes
        Last Post superkolleech  
        Started by davidwade, Today, 02:51 AM
        0 responses
        3 views
        0 likes
        Last Post davidwade  
        Started by aviat72, 04-26-2020, 09:41 PM
        10 responses
        92 views
        0 likes
        Last Post kissandfly  
        Started by healthooa, Today, 01:28 AM
        0 responses
        8 views
        0 likes
        Last Post healthooa  
        Started by harjinderjit, Yesterday, 08:24 PM
        0 responses
        20 views
        0 likes
        Last Post harjinderjit  
        Working...
        X