Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Use trade parameters by IOrder & IExecution of other strategy

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

    Use trade parameters by IOrder & IExecution of other strategy

    Hello,

    Is it possible to fetch execution parameters of trades of other active strategies from within the strategy one is coding in using the IOrder and the IExecution interface? It seems I can only lookup order exections from within the strategy, where I would like to use trade prices of specific trade names executed by other active strategies. The IOrder and IExecution data show the EntrySignal, Name and Id's, but none of them refer to specific other (enabled) strategies, besides the one working in.

    Until now I could bypass this by creating the dummy entries of the other strategies to get the position and it's price, mostly by using the MRO method, but there are quite some situation this does not correspond to the actual execution of those strategies being created. Especially not with heavy price action and continued new highs and lows being set and MRO's need to be used nested.

    Kind regards,
    Francis

    #2
    Hi Francis,

    The strategy base will only be aware of orders/executions/positions made by the strategy itself. There is not a collection of this information from other strategies or even instances of that strategy.

    Please let me know if you have any questions.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew,

      Thank you for this confirmation. So my first assumption was correct. I'll try and figure out an alternative solution then.

      Kind regards,
      Francis

      Comment


        #4
        When is this going to change? We need to be able to see the positions and orders from other strategies. I'm guessing this won't be available till NT8 ? Is there really no code you can give us for a workaround? I'm running 4 strategies at once on different time frames. I only have enough capital in the account for one contract, so it's easy enough to use AccountItem.CashValue, but I enter on limit orders and that won't stop two from being submitted at the same time. I know the easy answer is to deposit more or cut out 3 strats but that's not optimal.

        Does the multithreadedness of NT make it so that an order could be placed from two different strategies at essentially the exact same time even if I did have a way to do a cross strategy IOrder check?

        Where is the best place I can continue to check AccountItem.CashValue that will give me the best absolute chance at avoiding this the way NT is currently? My entry limit orders last for one minute, so maybe am efficient way to keep checking the CashValue then issue a cancel order if it drops below?

        Sorry for all the questions and rambling. I've gone live now and just need the best solution currently possible.

        Thanks,

        Comment


          #5
          Originally posted by waynewright33 View Post
          When is this going to change? We need to be able to see the positions and orders from other strategies. I'm guessing this won't be available till NT8 ? Is there really no code you can give us for a workaround? I'm running 4 strategies at once on different time frames. I only have enough capital in the account for one contract, so it's easy enough to use AccountItem.CashValue, but I enter on limit orders and that won't stop two from being submitted at the same time. I know the easy answer is to deposit more or cut out 3 strats but that's not optimal.

          Does the multithreadedness of NT make it so that an order could be placed from two different strategies at essentially the exact same time even if I did have a way to do a cross strategy IOrder check?

          Where is the best place I can continue to check AccountItem.CashValue that will give me the best absolute chance at avoiding this the way NT is currently? My entry limit orders last for one minute, so maybe am efficient way to keep checking the CashValue then issue a cancel order if it drops below?

          Sorry for all the questions and rambling. I've gone live now and just need the best solution currently possible.

          Thanks,
          You can use some unsupported code to determine if the account has a position, and not allow any trades if so. Modify the code below to track what you need.
          Code:
                      foreach (Account acct in Cbi.Globals.Accounts)
                      {
                          if (acct.Positions != null)
                          {
                              PositionCollection positions = acct.Positions;
                              foreach (Position pos in positions)
                              {
                                  Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
                              }
                          }
                      }

          Comment


            #6
            That won't help me for unfilled limit orders I don't think?
            I'm thinking a combination of global variables would allow me to work around this but I don't know where to declare them or if there's any precautions to be aware of.
            Last edited by waynewright33; 04-15-2014, 06:43 AM.

            Comment


              #7
              Just got some help from Bertrand in this thread. http://www.ninjatrader.com/support/f...294#post371294

              His link should get me started! Thanks for your input.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by argusthome, Yesterday, 10:06 AM
              0 responses
              17 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              16 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              14 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              9 views
              0 likes
              Last Post TheRealMorford  
              Started by Mindset, 02-28-2026, 06:16 AM
              0 responses
              36 views
              0 likes
              Last Post Mindset
              by Mindset
               
              Working...
              X