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

cancel market order in sim account and market order in live account

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

    cancel market order in sim account and market order in live account

    Hi Team,

    I have an addon that cancels orders, but I have a problem with market orders if the account is a demo or live account. Let say I need to cancel an order based on the number of contracts. If it's bigger than 2 contracts, cancel the order. Using the market buttons in the dom, with the sim account I don't have problems, it works, but if the account is live or demo it doesn't cancel the order. Any idea of what is happening?

    Regards

    #2
    Hello ofaprotrader,

    I believe this is expected, market orders are not a type of order which generally can be cancelled. This is submitted as an active order to the market which will fill as quickly as possible as the market allows. You can cancel resting orders such as limit orders which have not yet filled. Cancelling a resting order also does not guarantee a total cancel will happen if a fill is possible at the same time.

    Can you provide more detail on what your addons purpose is? Are you trying to block orders under certain criteria?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi NinjaTrader_Jesse

      Thank you for your fast answer. Yes, I'm trying to block orders based under certain criteria. For example, if contracts are bigger than 2 I want to block the option to open limit or market orders in the dom, chart or any other place at NinjaTrader platform. I have the problem working with live or demo accounts that the addon doesn't block market orders. Any idea what can I do?

      Regards

      Comment


        #4
        Hello ofaprotrader,

        Blocking user interaction such as orders is not generally something we can provide samples for as this is really not a concept in the platform currently. It is suggested to avoid this in case the user needs to take a corrective action.

        For this specific use case, rather than trying to cancel already submitted orders, you may instead try to observe the quantity control for the order entry in question, and if the value is out of range you can disable the WPF buttons preventing the click. I still don't recommend this, but that potentially is a work around for cancelling the market order, it wouldn't need cancelled if it cant be clicked.

        A more suitable solution is to avoid modifying the default trading tools to give the user an option to restrict themselves or have full control. A good example of this would be the addon sample in the help guide which creates a whole new window. In that window you can do whatever you want with the GUI and buttons, so you could limit the users interaction if needed. I suggest this because this still allows you to manage your position or place trades under your own discretion. When the addon is enabled, if something does not go to plan and is effectively reflected across the platform you may have to emergency call the broker to manage the account.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello ofaprotrader,

          Blocking user interaction such as orders is not generally something we can provide samples for as this is really not a concept in the platform currently. It is suggested to avoid this in case the user needs to take a corrective action.

          For this specific use case, rather than trying to cancel already submitted orders, you may instead try to observe the quantity control for the order entry in question, and if the value is out of range you can disable the WPF buttons preventing the click. I still don't recommend this, but that potentially is a work around for cancelling the market order, it wouldn't need cancelled if it cant be clicked.

          A more suitable solution is to avoid modifying the default trading tools to give the user an option to restrict themselves or have full control. A good example of this would be the addon sample in the help guide which creates a whole new window. In that window you can do whatever you want with the GUI and buttons, so you could limit the users interaction if needed. I suggest this because this still allows you to manage your position or place trades under your own discretion. When the addon is enabled, if something does not go to plan and is effectively reflected across the platform you may have to emergency call the broker to manage the account.


          I look forward to being of further assistance.
          Thank you for the guide!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by funk10101, Today, 12:02 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Started by GLFX005, Today, 03:23 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Erick  
          Started by nandhumca, Yesterday, 03:41 PM
          1 response
          12 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by The_Sec, Yesterday, 03:37 PM
          1 response
          11 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by vecnopus, Today, 06:15 AM
          0 responses
          1 view
          0 likes
          Last Post vecnopus  
          Working...
          X