Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unwanted order entry

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

    Unwanted order entry

    After enabling strategy and waiting for chart to finish calculating data as soon as it finishes it automatically enters a trade with no stop or profit target. How do I get rid of this annoying problem strategy works fine but I closed trade manually and now when I reset for another trade with enable I get the unwanted order entry as soon as it is don calculating. Please HELP!

    #2
    This seems like a logic problem - why don't you wait for there to be a new setup before you place an entry order?

    Also consider setting the mode StartBehavior = StartBehavior.WaitUntilFlat.

    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      I don't place the order it comes up automatically. I closed trade manually before it hit my stop loss. Have to re enable strategy as box is unchecked after closing trade. Chart calculates when done calculating order is entered no profit target no stop. Did strategy again from scratch works fine in both directions sell and buy withmy profit target and stop, but when I close trade manually to prevent hitting stop loss it does the order entry when I reset. Thought someone might have run into this problem before and was something simple I was missing. Any help is appreciated thanks for viewing and answering post

      Comment


        #4
        New setup will not engage because strategy has to be enabled again and once the strategy is done calculating the unwanted order entry comes up and all that happens is I watch the PNL go up and down. Simple strategy from ninjacators in Turkey. MACD with ninzarenko chart by cutey atesman ordered some robots from hi. And this strategy was on one of the videos he sent me.

        Comment


          #5
          Do you have the source code so you can fix it? If not you may have to contact the strategy's developer to see what you (or they) should do about it.
          Bruce DeVault
          QuantKey Trading Vendor Services
          NinjaTrader Ecosystem Vendor - QuantKey

          Comment


            #6
            Just entered settings into ninjatrader strategy builder did not think about the code. I was having a similar problem automating a footprint chart from orderflows with Markers and could not figure out the conflict between the automated strategy and using the flatten feature to clear the order but it will not reset to automated trades before having to check enable box and cycle starts all over again. Will look at code in the morning as I am at work right now.

            Comment


              #7
              Oh. If it's a strategy builder it should be fixable. NinjaTrader Support may be able to help you but would probably need some more information.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                GroundHog241,

                Thank you for your post.

                Please keep in mind that clicking the "Close" button to close a position for an account/instrument that has a strategy running will disable the strategy. This is in the "Tips" section of the following page:
                https://ninjatrader.com/support/help...ategy.htm#HowT oRunAninjascriptStrategyInAChart

                Since your strategy is opening a position without the stop loss or profit target immediately upon enabling it, I am curious about the following questions:
                • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
                • Who are you connected to? This is displayed in green in the lower-left corner of the Control Center window.
                • What instrument(s) (and expiry if applicable) have you selected?
                • What Data Series Type have you selected? Example: Tick, Minute, Day
                  • You mentioned NinjzaRenko, correct?
                • Is your strategy a multi-instrument or multi-time frame strategy?
                • When you right-click the Chart and select Strategies, what setting do you have selected for the "Start behavior" dropdown menu?
                • Do you receive an error on the screen? Are there errors on the Log tab of the Control Center? If so, what do these errors report?
                As an additional tool to understand which order from your strategy is being submitted, I suggest enabling TraceOrders and reviewing the output in the NinjaScript Output window. Trace Orders may be enabled on the Default Properties screen of the Strategy Builder:You could also consider adding Print statements to your strategy whenever orders are submitted to distinguish what the values compared in the conditions are equal to at the time of the order submission. This can help you understand why an order is triggering if you believe that the condition was not met because it will show you what values were used when evaluating whether the condition was true or false. For more information about using Prints to debug and better understand your strategy, including a video about adding prints to the Strategy Builder, please see the links below:I look forward to your reply.

                Comment


                  #9
                  I have come across others that have had similar problems because the action of using the close button on the order chart is outside the parameters of the strategy I am using is the reason for the problem posts on the forum have stated that it disables the strategy and throws it out of sync. Solution has been suggested to write code for a close button on a toolbar in the strategy itself which makes a great deal of sense. I have some experience with Python programming but have not used C# before but hopefully the two languages are similar other than differences in syntax. The toolbar was downloaded from ninjatrader ecosystem by ninjatrader_zacheryG. Hopefully changing the coding a little will make the buttons a manual way of closing the trade in the strategy without affecting it the way it does when using the close button on ninjatraders order chart. Thank you for your interest Emily I will try to start coding on Saturday as I will be from regular work. If you know of the procedure for coding a toolbar button like this please give me some direction it would be greatly appreciated as this would not only help this strategy but all the others I use in the future that are automated. Thanks Jeffry W Smith

                  Comment


                    #10
                    At work so I will try to make it quick ?attest version of ninjatrader 8, 1 minute frame, ES06-23, Just a ninzarenko chart set 10/1. Regular MACD settings, renko changes directions at MACD crossover long and short. Stop-loss set at 15, there can be a profit target set but presently have it set to run until turnaround whether buy or sell so trade can run longest time course. Problem sometimes turnaround from buy to sell or sell to buy you can tell from delta on footprint chart trade will go in wrong direction, hence the need fe or manual pclose of trade since I can usually can tell before it hits stop loss. Back to work

                    Comment


                      #11
                      Yes, that is probably what you want to do if you want the strategy to continue running - add a button to either the chart or the toolbar such that when you push the button your STRATEGY closes the trade rather than you closing the trade from outside the strategy. It is your intervention from OUTSIDE the strategy that causes the strategy to be disabled but if it is the strategy that decides to close the trade (because you pushed the button) it is not out of sync because it is in the expected position and there were no unexpected external interventions that would knock it offline.
                      Bruce DeVault
                      QuantKey Trading Vendor Services
                      NinjaTrader Ecosystem Vendor - QuantKey

                      Comment


                        #12
                        Hello GroundHog241,

                        Thank you for your insight.

                        If you would like to add a button to your chart, I suggest checking out the reference sample for creating WPF modifications from an indicator that may be found here:


                        The same ideas and use cases may be applied in a strategy as well. You could create a button with a button press event, and when the button is pressed you could set it up to check your strategy's position (potentially save it in a variable) and toggle a bool that will cause logic to be triggered to close the position in your strategy script.

                        Please feel free to reach out if you need any additional assistance.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by NullPointStrategies, 03-13-2026, 05:17 AM
                        0 responses
                        86 views
                        0 likes
                        Last Post NullPointStrategies  
                        Started by argusthome, 03-08-2026, 10:06 AM
                        0 responses
                        151 views
                        0 likes
                        Last Post argusthome  
                        Started by NabilKhattabi, 03-06-2026, 11:18 AM
                        0 responses
                        79 views
                        0 likes
                        Last Post NabilKhattabi  
                        Started by Deep42, 03-06-2026, 12:28 AM
                        0 responses
                        53 views
                        0 likes
                        Last Post Deep42
                        by Deep42
                         
                        Started by TheRealMorford, 03-05-2026, 06:15 PM
                        0 responses
                        61 views
                        0 likes
                        Last Post TheRealMorford  
                        Working...
                        X