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

ShortLimit & LongLimit at the same time

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

    ShortLimit & LongLimit at the same time

    Hi,

    Is it possible to place a LongLimit and ShortLimit at the same time ?

    Regards

    #2
    Hello,

    Thank you for your forum post.

    Yes this is possible, and should you have one an EnterLongLimit fill when your short NinjaTrader will automatically make you long instead of flat, this is due to the managed approach.

    Let me know if I can be of further assistance.

    Comment


      #3
      I can't find a way to program this : http://www.imagup.com/pics/1285614369.html in my strategy

      To have a LongLimit and ShortLimit at the same time in my orderbook?
      Could you help?

      regards

      Comment


        #4
        Hello,

        Please post your code you are using for entry and I will be able to further assist.

        You will need to continually make the call every bar for EnterLongLimit and EnterShortLimit until these orders are filled.

        Let me know if I can be of further assistance.

        Comment


          #5
          I have done this but if my LongLitmitOrder is place it does not take into account the ShortLimitOrder :

          Code:
          protected override void OnBarUpdate()
                  {
             if(Historical)
              return;
             else if(Bars.BarsSinceSession < 5)
              return;
                
             if(Position.Quantity == 0)
             {
              EnterLongLimit(myPrice + 2 );
              EnterShortLimit(myPrice - 2]);
             }
             
             
              
              
              
                  }
          thc

          Comment


            #6
            Hello,

            EnterShortLimit(myPrice - 2]);

            You have a ] in here is this causing us issues?

            Comment


              #7
              No this is not an issue

              Comment


                #8
                Hello Smuhr,

                In this case you would be running into our internal order handling rules.

                Methods that generate orders (excluding market orders) to enter a position will be ignored if:
                • <LI class=rvps1>A position is open and an order submitted by an exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction <LI class=rvps1>A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
                • The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction

                In order to place both entry orders at same time you would have to use an unmanaged approach in version 7. An introduction to this is here:
                http://www.ninjatrader.com/support/helpGuides/nt7/unmanaged_approach.htm
                Ryan M.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by nightstalker, Today, 02:05 PM
                0 responses
                8 views
                0 likes
                Last Post nightstalker  
                Started by llanqui, Yesterday, 09:59 AM
                8 responses
                28 views
                0 likes
                Last Post llanqui
                by llanqui
                 
                Started by quicksandatl, Today, 01:39 PM
                1 response
                5 views
                0 likes
                Last Post quicksandatl  
                Started by md4866, 05-01-2024, 08:15 PM
                2 responses
                18 views
                0 likes
                Last Post md4866
                by md4866
                 
                Started by samish18, Today, 12:20 PM
                0 responses
                7 views
                0 likes
                Last Post samish18  
                Working...
                X