Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reversing a position with a single order

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

    Reversing a position with a single order

    If I am long a single share, and I decide I want to be short a single share, is there a consensus/best practice way to do that with a single order? Does the answer vary by provider?

    I currently sell out and then short with two sequential orders, but that introduces latency I'd like to avoid if possible.

    Before I spend time experimenting with what may or may not work, I figured I'd ask to see if there is a time-saving easy answer from someone.

    #2
    Hello,

    You can utilize the 'Rev' button in any order entry window to reverse your position for an equal amount of contracts. For example, if long 2 contracts reversing would make you short 2 contracts. This is done with 2 orders, with a market order to close out the 2 long contracts followed by a market order to sell 2 contracts short.

    Comment


      #3
      I'm sorry, I was not remotely clear enough here.

      I am making orders from within an AddOn. This is not a UI question, but an API question.

      I'm trying to avoid using an order to close out a position and then a new order for opening a new position.

      For instance, if I am long 1 share, can I sell 2 shares to be short a share?
      Last edited by carnitron; 03-25-2024, 01:02 PM.

      Comment


        #4
        Hello,

        This would all be handled in the script you are submitting orders from. If you have any questions regarding how to configure this in your script you may want to consult one of our programming forums for assistance.

        Comment


          #5
          Wait, I've asked many technical and API related questions on this forum, right here. Can someone else with Add On expertise reply to this thread? Or are you suggesting I try "General Development"?
          Last edited by carnitron; 03-25-2024, 01:09 PM.

          Comment


            #6
            Hello,

            The development sections of our forum can assist with scripting questions in NinjaScript. This sections is more for platform functionality questions that come standard with NinjaTrader

            Comment


              #7
              I am not clear what you mean by "development sections of our forum". Do you have a link to this? Under NinjaTarder Desktop, I see "Platform Technical Support", "General Development", "Indicator Development" and "Strategy Development". This isn't an indicator or a strategy. So I guess that leaves "General Development," like I asked in my last post?

              FWIW, I think this could be considered a platform issue, to some extent, if this kind of mechanism is available with some brokers but not others. But whatever, I just need someone to answer my question, instead of going back and forth like this.

              Regardless, I have reposted this question to "General Development", in the hopes that it is the right place.
              Last edited by carnitron; 03-25-2024, 02:01 PM.

              Comment


                #8
                Hello,

                Any of the 'Development' oriented sections of the forum you mentioned can be used for assistance from our scripting team. As mentioned the functionality of the reverse button is hard coded, but this functionality can be simulated in various ways within NinjaScript.

                Comment


                  #9
                  FWIW, this appears to actually be a backend issue:

                  Reversing a position with a single order in an AddOn - NinjaTrader Support Forum​

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  71 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  43 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  25 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  28 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  58 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X