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

order ownership

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

    order ownership

    Hello,

    Can a strategy cancel/amend an order created by another strategy ?
    More generally : is there a strict ownership of orders ?

    Thanks

    #2
    Hello carmiFR,

    For strategies in Ninjatrader, you could think of each strategy as its own instance. each strategy manages its own orders, so it would not be able to manage another strategies orders.

    Please let me know if I may be of further assistance
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello Jesse,

      Thanks for your answer.

      To be more precise : I have severals strategies collaborating (via static container members and lockers). The goal here is to have more clarity in the source code ... Whatever, in some cases, a strategy can "suspend" its own activity and transfer the ownership of its working orders to other strategies. In terms of implementation, if one of these orders gets events via OnOrderUpdate, the callbacked strategy just calls OnOrderUpdate to the strategy now owning the order. Then the new owning strategy can amend or cancel the order, calling ChangeOrder or CancelOrder with the order reference.

      So just to be clear : you say this have no chance to work ? Will this call Change/CancelOrder throw an exeception ? Or will these calls just be quietly ignored ?

      Many thanks
      Last edited by carmiFR; 04-09-2014, 02:35 PM.

      Comment


        #4
        Hello carmiFR,

        To answer your question, Correct this would not work in Ninjatrader as this is not how strategies are designed to be run through Ninjatrader.

        One way to explain this would be each strategy contains its own orders that are tied to this specific strategy. Strategies are unaware of what another strategy is doing.

        As for the second question, depending on the order methods being used you could get a null object reference error, or it would just ignore it.

        Please let me know if I may be of additional assistance
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hi carmiFR,

          If you already have the functionality that the Strategies can communicate with another then a possible workaround could be that you create a separate strategy that has only the purpose for order handling. This means that no other strategy will initiate orders by them self. If a trigger for an order is given the strategy sends a message to the orderhandling strategy and from there this stragey manges all orders that are initiated from your other strategies.

          This is just an idea, don't know if this is really possible inside NT.

          Good Luck

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Stanfillirenfro, Today, 07:23 AM
          6 responses
          21 views
          0 likes
          Last Post Stanfillirenfro  
          Started by navyguy06, Today, 09:28 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by DayTradingDEMON, Today, 09:28 AM
          1 response
          15 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          8 responses
          31 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by helpwanted, Today, 03:06 AM
          2 responses
          22 views
          0 likes
          Last Post NinjaTrader_LuisH  
          Working...
          X