Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 alifarahani, Today, 09:40 AM
            6 responses
            36 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            14 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X