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 Likomatervy, Today, 05:35 AM
                0 responses
                4 views
                0 likes
                Last Post Likomatervy  
                Started by z679Gju, 05-03-2024, 02:37 PM
                4 responses
                33 views
                0 likes
                Last Post z679Gju
                by z679Gju
                 
                Started by athexinehowley, Today, 02:39 AM
                0 responses
                8 views
                0 likes
                Last Post athexinehowley  
                Started by dtaylor, Today, 02:24 AM
                0 responses
                7 views
                0 likes
                Last Post dtaylor
                by dtaylor
                 
                Started by RosaRichardow, Today, 12:21 AM
                1 response
                7 views
                0 likes
                Last Post marcus2300  
                Working...
                X