Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Prevent Order Submission

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

    Prevent Order Submission

    If a Strategy is listening to Account order updates by setting up a custom listener:
    Code:
    Account.OrderUpdate += OnAccountOrderUpdate
    I can prevent submission of the order with Acount.Cancel() but I still see an alert in the UI -- Is it possible to prevent order submission without getting the alert?
    Last edited by johnathanhebert; 08-25-2023, 04:52 PM.

    #2
    Hello johnathanhebert,

    Thanks for your post.

    So I may accurately assist, what 'alert' are you referring to when you mention you see an alert in the UI?

    If possible, please share a screenshot of the 'alert' you are referring to.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    ​I look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Sure, I am talking about the "Error" modal popup. It shows that my code has started to cancel the order, but I want to know if I can suppress the popup window.​

      Click image for larger version

Name:	image.png
Views:	74
Size:	7.8 KB
ID:	1266678

      Comment


        #4
        Hello johnathanhebert,

        Thanks for your notes.

        There are no methods or properties available for preventing/suppressing the pop-up error message from appearing on the screen.

        Note that there is not a way to force a cancellation, if the action you are doing results in the order becoming stuck you would have to review the cancellation logic and make sure that is only happening while the order is in a working state. If you are cancelling an order when its only been submitted that may result in the order becoming stuck.

        Simulated orders can sometimes become stuck in a 'pending' state if the platform unexpectedly loses connection or shuts down while the order is in the process of updating from one state to another. To remove the order if it is stuck, you will need to reset the simulation account.

        Resetting a simulation account will clear all historical trade data from this account. Please follow the instructions below to reset a simulation account:
        • From the NinjaTrader Control Center window select the Accounts tab
        • Right-click on your simulation account and select 'Edit Account'
        • Press the "Reset" button > Yes > OK
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        126 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X