Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Limit Orders

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

    Strategy Builder Limit Orders

    I have a strategy created with the builder. I was testing entries using limit orders (the drop down limit under Order Management). The short side works fine. But the long side never fills.
    Conditions are the same for short and long. I tested this a few times, changing the limit order on the buy side to just "enter long position". That works fine and the trades trigger. It's when I change to "enter long position by a limit order" that it doesn't trigger any trades. Tested it on several charts - same thing. Thanks.

    #2
    Hello, thanks for writing in. If the strategy has an active short entry limit order then the long limit order would be ignored. Using the builder you must let the first limit order placed get filled then close the position and submit the next order in the opposite direction or let one bar close and do not re-submit the limit order, this will automatically cancel the order on the next bar. In an unlocked script, one can use the CancelOrder() method to cancel orders at will.

    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Thanks. I'm not sure I understand. The strategy doesn't take a lot of trades. The last short trade would have been triggered and exited before a long would be executed. The strategy can't be short and long at the same time. So there's nothing to cancel. The strategy is flat when a long signal should be generated.

      Comment


        #4
        Hi, If you go into the strategy builder General Properties>More Properties> enable Trace Orders, then observe the New>NinjaScript Output window after running your strategy you will be able to see ignored orders. Please check if the order is being ignored from this output window.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          I ran it in replay for a few days. Nothing in NinjaScript Output. I enabled Trace Orders. See attached.
          Attached Files

          Comment


            #6
            Hi, If you add a Print to your entry order do you see this showing up? Using Print will be the best tool you can use to debug your script because it will show you the data your strategy is processing and you can see when and where your entry signals are being hit e.g.

            Code:
            if(<Entry condition>)
            {
              Print("Entry Signal Reached"); //Misc>Print in the builder
              EnterLongLimit();
            }
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              I'm using strategy builder. I can't write in any code. How do I enter that?

              Comment


                #8
                Hi, In the set that contains the EnterLongLimit action, add another action>Misc>Print
                Chris L.NinjaTrader Customer Service

                Comment


                  #9
                  I included the print code and it compiled. But still nothing in NinjaScript Output

                  Comment


                    #10
                    Hi, This would mean that your entry signal for long orders is not being hit. Your condition to enter is not true if you are not seeing any print.
                    Chris L.NinjaTrader Customer Service

                    Comment


                      #11
                      The conditions are the same for long and short except for opposite direction. When I just use the "Enter Long Position", the trades trigger long. There's something wrong with the "Enter Long Limit Order" code.

                      Comment


                        #12
                        Also, why doesn't the NinjaScript Output work?

                        Comment


                          #13
                          Hi, thanks for the follow up. You will need to debug your script to find out why no orders are being placed. The output window works and limit orders/stop order work if implemented correctly. Another thing to note about these resting orders is that you need to re-submit them on every bar they should be active, otherwise they will be canceled after the next bar closes. See this example for reference:

                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            Thanks. I found a fix for the problem. Working fine now.

                            Comment

                            Latest Posts

                            Collapse

                            Topics Statistics Last Post
                            Started by The_Sec, Yesterday, 03:37 PM
                            1 response
                            11 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by vecnopus, Today, 06:15 AM
                            0 responses
                            1 view
                            0 likes
                            Last Post vecnopus  
                            Started by Aviram Y, Today, 05:29 AM
                            0 responses
                            5 views
                            0 likes
                            Last Post Aviram Y  
                            Started by quantismo, 04-17-2024, 05:13 PM
                            3 responses
                            27 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Started by ScottWalsh, 04-16-2024, 04:29 PM
                            7 responses
                            36 views
                            0 likes
                            Last Post NinjaTrader_Gaby  
                            Working...
                            X