Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help, about EnterLong/ShortStopLimit orders

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

    Help, about EnterLong/ShortStopLimit orders

    I have created an automatic strategy in strategy builder, with this logic: when the price reaches a level set on an "input", it should put an “EnterLongStopLimit” order and immediately it should puts an “EnterShortStopLimit” order, but it only puts the “EnterLongStopLimit” order and does not puts the “EnterShortStopLimit” order, when I delete the “EnterLongStopLimit” from the automatic strategy, the strategy correctly puts the “EnterShortStopLimit” order. This only happens to me in the live market.

    Any idea why that happens?

    Thank you!

    #2
    Hi daying35, thanks for writing in. The strategy can not place an entry method on both sides of the market at the same time. Your strategy may be breaking one of the managed order handling rules listed here:



    Methods that generate orders to enter a position will be ignored if:
    •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.

    This can be confirmed by checking the Trace Orders option in the General settings, then view the New> NinjaScript Output window while the strategy runs. This will include messages about ignored orders.

    Comment


      #3
      So is there any way to have two limit orders open and unfilled at the same time if they're in opposite directions?

      Comment


        #4
        Hi rjm1903, the only way to do this is to use the unmanaged approach, see the methods here:

        Comment


          #5
          I separated the logic from the automatic strategy, now I made an automatic strategy with the entry logic for the order “EnterLongStopLimit” and I made another automatic strategy with the entry logic for the order “EnterShortStopLimit”, and now both strategies work perfectly in the live market (sim), now I have a new question:

          Would there be problems with orders if I activate the two strategies in my real account?

          Thank you!

          Comment


            #6
            Hi, there is always a risk of the two strategies trading against each other (one goes long and the other goes short), and the prevention of two entry orders on either side of the market is in place for a reason, it can lead to unwanted positions. We always recommend running one strategy on one instrument at a time and have one strategy make all of the trading decisions.

            Comment


              #7
              In the general entry logics for the automatic strategy “EnterLongStopLimit” and the automatic strategy for “EnterShortStopLimit” there is always a minimum distance of 125 ticks. Each filled order has a target of 15 ticks and a stop of 10 ticks.

              Example: if the “EnterLongStopLimit” order is filled at 1500.25, the 15 tick target at 1504.00 and the stop at 1497.75 are activated, and the “EnterShortStopLimit” order is at a minimum distance of 125 ticks below the filled “EnterLongStopLimit” order .

              Do you think there is a problem or risk, even if the distance is greater than 125 ticks between “EnterLongStopLimit” and “EnterShortStopLimit”?

              Thank you!​

              Comment


                #8
                Hi daying35, That should not be an issue with a gap that large, but I can not guarantee any outcome of trading.

                Comment


                  #9
                  How would I do live market sim for testing out using two strategies similar to how daying35 did his? I've previous just been looking at strategy results and then analyzing trade by trade within the results window. Do I need to download historical data in order to do live market sim/live backtesting?

                  Comment


                    #10
                    Hi rjm1903, you can either run your two strategies on the Sim101 account on a live data connection, or download 1 tick data of any instrument through Tools>Historical data (you still need to be connected to a live data source) to use the playback connection>Historical mode. This will be able to replay historical 1 tick data.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Today, 05:17 AM
                    0 responses
                    52 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    130 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    70 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    44 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    48 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X