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

PendingSubmit

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

    PendingSubmit

    Hi,

    It seems that my broker refuses more than 4 orders in the same second. From 5th on it doesn't accept the order and the order stays in IOrder with OrderStatus = PendingSubmit. I tried do CancelOrder() the order or make its position in IOrder[] = null or even submit it again. However, nothing seem to work. How do I work with this once the position remains blocked in IOrder and it doesn't disapear form Chart trader...

    The only way to make it disapear is to disconnect and connect again, but that's what I want to avoid once the strategies need all to be restarted...


    Thanks

    #2
    Hello agenor,

    Are you getting an error "Order Action rate exceeded" in the Log?

    If so, this would result in the orders becoming stuck in the PendingSubmit state.

    Once orders are stuck in PendingSubmit, the only action to remove them in NinjaTrader 7 is disconnecting and reconnecting.

    To prevent this from occurring, you would need modify your script so that orders are not submitted or changed at that rate. You could use a timer to send the orders 500 ms apart.


    NinjaTrader 8 has corrected this issue and the orders will not become stuck in PendingSubmit.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Actually the message in the log is "NinjaTrader received unsupported order type, this order will not be displayed. Please contact your broker to manage this order: 'a13a4461-cb33-42a6-972b-6440943be977:'", but I'm sure it's because the rate is being exceeded. Using a timer seems to be the solution. A minute ago I tried "System.Threading.Thread.Sleep(500);"between the orders submissions and it worked. However, the orders didn't appear in the Chart Trade in sequence, but all at once, leaving the impression that maybe this is not the most efficient way to do it. Could you tell me if there are other ways ?

      Thanks

      Comment


        #4
        Hello agenor,

        A sleep will sleep all of NinjaTrader as all scripts and the UI all run on a single thread. Sleeping that thread will freeze all of NinjaTrader.

        When I suggest a timer, I mean a System.Windows.Forms.Timer.

        Below is a link to an example.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Tim-c, Today, 03:54 AM
        0 responses
        3 views
        0 likes
        Last Post Tim-c
        by Tim-c
         
        Started by FrancisMorro, Today, 03:24 AM
        0 responses
        2 views
        0 likes
        Last Post FrancisMorro  
        Started by Segwin, 05-07-2018, 02:15 PM
        10 responses
        1,772 views
        0 likes
        Last Post Leafcutter  
        Started by Rapine Heihei, 04-23-2024, 07:51 PM
        2 responses
        31 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by Shansen, 08-30-2019, 10:18 PM
        24 responses
        945 views
        0 likes
        Last Post spwizard  
        Working...
        X