Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Some properties of an order can not be updated

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

    Some properties of an order can not be updated

    Hi
    I am connected to CQG and working with NT8
    I have a Superdom column indicator which generates target and stop orders according to logic I developed. To those orders i assign OCO and Name during the generation process of that order.
    This indicator which reacts to changes in my position works fine.
    However in case a manual target order is entered by the user I have to identify it in OnOrderUpdate(OrderEventArgs orderUpdate)
    set OCO to that manual order so that I will be able to attach to it stop loss order with the same OCO
    However the property OCO can not be updated , also the property Name can not be updated . Please enable both properties to be accessed.
    Attached error message
    Attached Files

    #2
    Hello,

    Thank you for the inquiry.

    The OCO and Name are set when you initially create the order by using the standard methods of creating orders in NinjaScript. After the fact these are read only as they should not be changed after the order has already been submitted. If a property was changed on this object, this would not be reflected on the brokers side because the platform would not have been aware of that change to provide that to the broker.

    The state OnOrderUpdate would indicate the order is already working though its states or has been created so it will have properties that are Read Only to persist the correct values being reported about that order from the various events. Only by calling supported methods the order can be updated, such as the methods to Cancel orders or resubmit an order using the same name to update its price.

    I am unsure of the logic that needs to occur for what you are trying to do, but manually assigning an OCO to an already existing order would not work as the order already exists and is not editable in this way.

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

    Comment


      #3
      when i update the limit price of an order or the qty of an order
      the new values are submitted to the broker
      so why the update process wont work in case of OCO or NAME ?
      This sounds to me as limitation which exist at this moment at ninja and can be corrected

      Comment


        #4
        hi again
        I am still looking to understand why OCO and name of working order in the market can not be update , while other properties can be updated
        Can this be fixed ?

        Comment


          #5
          Hello,

          In general a major modification to an order such as the orders type, OCO, Name, ID etc.. would need to be a new order as these properties are no longer changeable after the order has been submitted. The callback or OnOrderUpdate is relaying the information back through the orders update events. To change the values that are readonly, you would need to cancel and resubmit the order with the values needed.

          To perform the actions you are trying, you would need to cancel any orders that need edited and resubmit all of the orders with needed OCO's at once per the standard order submission methods.

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

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by WHICKED, Today, 04:10 PM
          0 responses
          1 view
          0 likes
          Last Post WHICKED
          by WHICKED
           
          Started by Trasss_Kenneth, Today, 01:49 PM
          2 responses
          32 views
          0 likes
          Last Post bltdavid  
          Started by Newtrader101, Today, 03:22 PM
          1 response
          8 views
          0 likes
          Last Post NinjaTrader_JustinD  
          Started by johnMoss, Today, 01:43 PM
          5 responses
          34 views
          0 likes
          Last Post NinjaTrader_ChrisL  
          Started by qs121, Today, 12:24 PM
          2 responses
          44 views
          0 likes
          Last Post qs121
          by qs121
           
          Working...
          X