Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.

    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 GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,227 views
        0 likes
        Last Post xiinteractive  
        Started by andrewtrades, Today, 04:57 PM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        7 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        440 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        11 views
        0 likes
        Last Post FAQtrader  
        Working...
        X