Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

market positions across multiple strategies running

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

    market positions across multiple strategies running

    Say I have 2 strategies running at the same time. Stategy A and Strategy B. Both strategies have

    If (Position.MarketPosition == MarketPosition.Flat)
    //do something here

    and

    If (Position.MarketPosition == MarketPosition.Long)
    //do something here

    My question is, do simultaneous strategies pull from the same market position? For example if strategy A made a trade and now strategy A's market position is long, would that make strategy B's market position long as well, even if B did not make a trade?

    If this is indeed the case, is there a way to make sure the market positions stay independent from each other between strategies?

    #2
    sra1837, each strategy instance will have it's own strategy position. So in your case B would still be flat, as only the A instance is managing a trade.

    Comment


      #3
      great, thanks for the clarification.

      Comment


        #4
        Following from this clarification each instance of a strategy has its own strategy Position.
        Is the way to ensure if we want to be in Synch with the Account position ie for running 1 strategy and want to ensure only 1 live position active at any time ie 1 live order submitted from Strategy OR 1 live order submitted using DOM or chart trade - to set the Synch Account Position to True in the strategy window? Otherwise if we dont want this restriction and wish to run multiple strategies independent and then within strategy control number of entries per direction or enter only with strategy position flat keep this Synch Account Position flag to false?

        thanks

        Comment


          #5
          soulfx, unfortunately I'm not clear what you're asking here - do you only want to have one position active at any time from either a strategy or manual trading through ChartTrader or DOM? The sync would only be a concern for the automated strategy, only if the strategy position it's currently managing would be reflected in the executed to account as well the sync would be present (starting the script up with the Immediately Submit option).

          Comment


            #6
            Originally posted by NinjaTrader_Bertrand View Post
            soulfx, unfortunately I'm not clear what you're asking here - do you only want to have one position active at any time from either a strategy or manual trading through ChartTrader or DOM? The sync would only be a concern for the automated strategy, only if the strategy position it's currently managing would be reflected in the executed to account as well the sync would be present (starting the script up with the Immediately Submit option).
            Hello yes sorry for the confusion i realise on re reading again. Was reviewing over weekend and over the strategy vs account position.

            I was looking to see if there was an Position.AccountPosition equivalent to
            Position.MarketPosition to determine if the account position for whole account is Flat.
            IE is there a way within a strategy to test for any live orders on the account before initiating / submitting an order within a strategy? If i wanted to manage this that either there is a manual position running or i can initiate from within a strategy IF i am not in a live manual trade. Does this make sense?

            thanks

            Comment


              #7
              soulfx, thanks, that makes more sense. Currently in NinjaScript there would be not supported means to access the account position directly. However our next major platform update will provide more coverage here for developers.

              You could check into the snippet shared in this thread - http://www.ninjatrader.com/support/f...30&postcount=7

              Comment


                #8
                Originally posted by NinjaTrader_Bertrand View Post
                soulfx, thanks, that makes more sense. Currently in NinjaScript there would be not supported means to access the account position directly. However our next major platform update will provide more coverage here for developers.

                You could check into the snippet shared in this thread - http://www.ninjatrader.com/support/f...30&postcount=7
                OK thanks for the confirmation. I was searching through the Help manual and forum to see if i was missing something as i couldnt see a way to do this in ninjascript.

                I take it this would be a useful tool to have and that has been requested by other strategy developers over time?

                will take a look at code snippet
                thanks

                Comment


                  #9
                  Accessing Account position

                  So just to clarify the following code will not be able to access any account position in a different strategy from where the following condition is written?

                  && Account.Positions.Count <=0


                  I am basically trying to see if there is an existing position on a specific account on another strategy before firing the second strategy.

                  Will NT enable this account access functionality?

                  Regards and thx

                  Comment


                    #10
                    everington_f, this is just accessing the account position, it would not get any account position for a specific strategy only.

                    Comment


                      #11
                      thankyou for the prompt reply Betrand. So this code would prevent any new strategy firing if the account position was not flat?

                      Comment


                        #12
                        Right, that's just the account level and not tied to any specific strategy instance (as the Strategy Base Position concept would be).

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                        0 responses
                        655 views
                        0 likes
                        Last Post Geovanny Suaza  
                        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                        0 responses
                        370 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by Mindset, 02-09-2026, 11:44 AM
                        0 responses
                        109 views
                        0 likes
                        Last Post Mindset
                        by Mindset
                         
                        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                        0 responses
                        574 views
                        1 like
                        Last Post Geovanny Suaza  
                        Started by RFrosty, 01-28-2026, 06:49 PM
                        0 responses
                        577 views
                        1 like
                        Last Post RFrosty
                        by RFrosty
                         
                        Working...
                        X