Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order rejected under Managed approach

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

    Order rejected under Managed approach

    Hi Ninjas,

    I'm clearing certain theoretical details before going totally "live" with a new Strategy.
    My Strategy use Managed Approach for orders, and all orders will be submitted as "Market orders". So, let's suppose that we have this situation:

    I have no connection issues, my strategy is running and it sends over a new order, but somehow that order is rejected by my broker's server, so my question:

    After that event, how does NinjaTrader react ?
    Will it continue to send the order?
    Will my Strategy disable itself?

    Please, I'd like to know exactly howt NinjaTrader acts in order to make sure that my Strategy can "handle" this rare event.

    Thanks

    #2
    Hello pstrusi,

    By default, RealtimeErrorHandling is set to StopStrategyCancelOrdersClosePosition. As long as this is not changed, the rejected order will cause the strategy to be disabled.

    The order will not be resubmitted, the strategy will be disabled.
    Last edited by NinjaTrader_ChelseaB; 07-07-2015, 07:25 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your response, now I have some new doubts:

      1.
      Evaluating this condition: OnConnectionStatus(ConnectionStatus orderStatus, ConnectionStatus priceStatus) Might the Strategy run and send orders ( somehow ) if any of priceStatus / orderStatus are not actually fully connected ?

      2.
      If any of priceStatus / orderStatus is not fully connected, can I be sure that the Strategy is automatically fully suspended until possible recovery?

      3.
      Is there a way to prevent OnBarUpdate runs when OnConnectionStatus is NOT fully connected ? or is this an automatic function that ninjaTrader takes care?

      Thanks a lot
      Last edited by pstrusi; 07-07-2015, 03:33 AM.

      Comment


        #4
        Hello pstrusi,

        The methods in NinjaTrader are event driven. OnBarUpdate() cannot run unless there is tick data received. (You may notice that when a price feed stops at the end of a session, the new bar does not form until the first tick is received at the open of the new session. If a tick is not received, the previous session's bar does not close and the new bar does not open.)

        This means that OnBarUpdate(), OnMarketData(), and OnMarketDepth() do not trigger unless there are ticks being received to drive these events.

        A loss of order feed will cause the connection status to change. This will pause the strategy until the order feed is reconnected. If too many disconnects are received within x minutes (4 restarts in 5 minutes by default, but this can be changed in Tools -> Options... -> Strategies -> NinjaScript), then the strategy is disabled.
        If your strategy sends out an order just before the order feed is lost, the strategy would not be able to continue until it receives a message back from the brokerage that the order was accepted or rejected. Until then the order is stuck and no further orders will be allowed until a message is received back for that order.

        All said, your strategy cannot work unless both the data feed and order feed are connected as the lack of data prevents the methods from triggering, and the lack of order routing causes the strategy to wait for messages to be received from the brokerage before continuing.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hi Super Chelsea ! :-)

          Thanks a lot for your complete answer; I know my questions might sound kind of obvious but I'd like to eliminate any doubt about the operational routine by knowing this or create a snippet.

          As always, all the best for you,

          Regards

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by CortexZenUSA, Today, 12:53 AM
          0 responses
          2 views
          0 likes
          Last Post CortexZenUSA  
          Started by CortexZenUSA, Today, 12:46 AM
          0 responses
          1 view
          0 likes
          Last Post CortexZenUSA  
          Started by usazencortex, Today, 12:43 AM
          0 responses
          5 views
          0 likes
          Last Post usazencortex  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          168 responses
          2,266 views
          0 likes
          Last Post sidlercom80  
          Started by Barry Milan, Yesterday, 10:35 PM
          3 responses
          13 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X