Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can I be long/short simultaneously?

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

    Can I be long/short simultaneously?

    I realize I can't be long/short the same instrument in the same "bar"... but any reason I can't be long/short in different BarsInProgress?

    ie:

    - Bar1, added with the Add() function... use EnterShort().
    - Bar2, also added with the Add() function... use EnterLong().

    My strategy seems to be having issues trying to do this, and I just want to understand whether this is a fundamental limitation, or if I just have a hidden bug somewhere.

    #2
    Hello,

    You cannot be literally long and short at the same time. However you can simulate it:

    One of the great features of NinjaTrader is its ability to manage multiple virtual positions in the same market. This allows you to manage a long and short position in the same market simultaneously.
    Here is how this is accomplished:
    • Open 2 SuperDOMs and set them both to the same market
    • Right click in on of the SuperDOMs and select the menu "Properties"
    • Set the 'ATM Strategy selection mode' parameter to "DisplaySelectedAtmStrategyOnly"
    • Repeat the last two instructions on the second SuperDOM
    • Submit a buy order to open a long position in the first SuperDOM
    • Submit a sell order to open a short position in the second SuperDOM
    In addition to these instructions, I suggest reviewing the content available in our Online Help Guide specific to this topic.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hi Ben,

      I'm working with a custom-developed C# strategy... so not sure how to incorporate your instructions regarding ATM Strategy...

      Any ideas?

      Comment


        #4
        Unfortunately you can't be long and short at the same time on the same instrument/position in the same NinjaScript strategy.

        Comment


          #5
          Originally posted by NinjaTrader_Dierk View Post
          Unfortunately you can't be long and short at the same time on the same instrument/position in the same NinjaScript strategy.
          Okay, understood.

          I realize this isn't a question you're "responsible" for... but how do you think IB would behave if I had multiple strategies, that ended up trying to hold short/long positions simultaneously?

          I feel like I've seen it reject a BuyToCover when there weren't short shares available. Which would suggest I can't do it across multiple strategies either.

          I'd probably have to add another layer of code to kind of "net" together all of my strategy positions, before passing it on to IB...?

          Comment


            #6
            Hello,

            They most likely would not allow you to be both long and short within the same market. One order would cancel the other one.
            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by CarlTrading, 03-31-2026, 09:41 PM
            1 response
            152 views
            1 like
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 04-01-2026, 02:41 AM
            0 responses
            89 views
            1 like
            Last Post CarlTrading  
            Started by CaptainJack, 03-31-2026, 11:44 PM
            0 responses
            133 views
            2 likes
            Last Post CaptainJack  
            Started by CarlTrading, 03-30-2026, 11:51 AM
            0 responses
            127 views
            1 like
            Last Post CarlTrading  
            Started by CarlTrading, 03-30-2026, 11:48 AM
            0 responses
            107 views
            0 likes
            Last Post CarlTrading  
            Working...
            X