Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Adding to a Position?

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

    Adding to a Position?

    Hello,
    I'm sure this is an easy question for most people, but I can't seem to figure it out. So I have a strategy where I want a position to be added to an already open position.(qty 1 open and add another qty 1)

    This seems easy enough but where I am running into a problem is I already have signal that opens a new position of qty 2 when this same signal is given.(thus giving me 3 qty when the max I ever want is 2)Is there a way to only open a qty 1 when this previous signal is given and give a qty 2 if the previous signal is not given?

    Thanks for the help!

    #2
    Hello,

    Thank you for your note.

    Just so that I understand correctly. You want to use a QTY of 2 only if you are already in the position. if you are not in the position already with a QTY of 1 then you want to use a QTY of 1.

    I look forward to assisting you further.
    BrettNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Brett View Post
      Hello,

      Thank you for your note.

      Just so that I understand correctly. You want to use a QTY of 2 only if you are already in the position. if you are not in the position already with a QTY of 1 then you want to use a QTY of 1.

      I look forward to assisting you further.
      Sorry my explanation was poor. I ment that I want to use a QTY of 1 if I am already in the position and a QTY of 2 if there is no current position.

      Or if there is another way, such as having code that only allows the QTY of 1 to be added if the previous signal has been triggered and then using a separate signal to open the QTY of 2 position if no current positions are open.

      Comment


        #4
        Is there a way to say if there is already a position open don't use this signal? I found the NTMarketPosition(string account) code, but I'm not sure if I can use it to say if there is a long position already don't use this buy entry?

        Comment


          #5
          Ok I figured it out haha...here is what I ended up doing to make sure the QTY of 2 signal wasn't being entered when there was already an open position.

          && (Position.MarketPosition == MarketPosition.Flat))

          Comment


            #6
            Hello,

            Excellent, This would be what I would have recommended.

            Let me know if I can be of further assistance.
            BrettNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            649 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
            576 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X