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 charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            52 views
            0 likes
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            142 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            160 views
            0 likes
            Last Post CarlTrading  
            Started by CarlTrading, 05-10-2026, 08:12 PM
            0 responses
            96 views
            0 likes
            Last Post CarlTrading  
            Started by Hwop38, 05-04-2026, 07:02 PM
            0 responses
            276 views
            0 likes
            Last Post Hwop38
            by Hwop38
             
            Working...
            X