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

strategy not entering trades

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

    strategy not entering trades

    my automated strategies are not entering trades anymore. the only thing i did was add a second enter long. and, i just typed a signal name.

    #2
    Hello SteveReiza,

    Thank you for your post.

    Are there any error messages on the Log tab of the Control Center? If so, what do the errors report?
    If there are no errors, please check the Strategies tab of the Control Center. What color is your strategy's name?
    I also suggest using TraceOrders for useful information about whether the strategy is ignoring orders and why. For more information:


    I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      i changed some thing in the bollinger and keltner. i had an int programmed. and, was plugging that in to where they ask for the particular numbers that go with them. i erased those, and just typed in the numbers. now, it looks like something is happening. the strategies are appearing in orange and green.

      Comment


        #4
        Originally posted by SteveReiza View Post
        i changed some thing in the bollinger and keltner. i had an int programmed. and, was plugging that in to where they ask for the particular numbers that go with them. i erased those, and just typed in the numbers. now, it looks like something is happening. the strategies are appearing in orange and green.
        If the name of the strategy is orange, that means it is waiting to have a flat strategy position before it begins submitting orders to the account it is running on. If the strategy name is green, that means it is active and ready to submit orders to the account whenever the next order signal is triggered. For more information about the information on the Strategies tab as well as account position vs. strategy position, please see the links below:Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          thanks for the reply. i don't have a position open in the account and its orange. what is it reading in order to be flat?

          i'm still not getting executions. do i need an action for [0] bar? i only have stuff for 1 bar ago and 2 bars ago.

          Comment


            #6
            Originally posted by SteveReiza View Post
            thanks for the reply. i don't have a position open in the account and its orange. what is it reading in order to be flat?

            i'm still not getting executions. do i need an action for [0] bar? i only have stuff for 1 bar ago and 2 bars ago.
            Although your account position is flat, if the strategy name is orange that means that the strategy position is not flat. When you enable a strategy, it runs a historical backtest and calculates a virtual strategy position. This means that if you had started your strategy at the very beginning of the session, for example, it would have opened a position at some point that would still be open at this point in time. It is waiting until the strategy logic would close that position and become flat, and then after that point any new entries moving forward will not only be calculated for the strategy position, but they will also be submitted on the account to open an account position. This is the concept explained on the help guide page I shared, with the example "An extremely common scenario" at the link below:


            "what is it reading in order to be flat?" it is reading the strategy's calculated position, which is not flat. Changing your strategy actions for the current bar instead of 1 bar ago and 2 bars ago will likely not make a difference; it is all about the strategy position vs. the account position and how they are synced. You could consider using a different start behavior so the strategy doesn't wait until it's flat to submit orders. The start behaviors are described in one of the other links I already shared:


            Thank you for your time and patience.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              thanks for the reply. i read through some of the links you sent. what does it mean to immediately submit. it doesn't mean it will submit an order right away on being selected "enable" does it? it still needs to wait for the entry method to happen right?

              Comment


                #8
                Originally posted by SteveReiza View Post
                thanks for the reply. i read through some of the links you sent. what does it mean to immediately submit. it doesn't mean it will submit an order right away on being selected "enable" does it? it still needs to wait for the entry method to happen right?
                Immediately Submit should only be used if your account position is how you would like it in relation to your strategy position upon enabling the strategy. It does not mean it will submit an order right away; it will wait for an entry method to be triggered, but the "immediate" part means it is immediately ready to submit live orders rather than waiting until the strategy position is flat. There is a contrast between "wait" and "immediate" that differentiates the behaviors.

                Please let us know if we may be of further assistance.
                Emily C.NinjaTrader Customer Service

                Comment


                  #9
                  thanks for the reply. i switched it to immediately. and, one of the strategies did execute right away. its like it looked back to see if it was valid. is that what the 20 bars ago min required look back does?

                  Comment


                    #10
                    Originally posted by SteveReiza View Post
                    thanks for the reply. i switched it to immediately. and, one of the strategies did execute right away. its like it looked back to see if it was valid. is that what the 20 bars ago min required look back does?
                    Did you use Immediately Submit or did you perhaps select Immediately Submit, Synchronize Account? If you chose the second option, then it is possible that a reconciliatory order was submitted to sync your account with the strategy position. That order would have the name "Synchronize" on the Orders tab of the Control Center.

                    Otherwise, I suggest looking at the order name and comparing that to the logic in your strategy to understand what signal was hit. You could also use Trace Orders and print statements for information about your strategy's logic and how it is executed, as previously mentioned.

                    "is that what the 20 bars ago min required look back does?" I do not think the execution has to do with a lookback. What "20 bars ago" are you referring to exactly? Is this a setting you have in your strategy? Please provide more details or a screenshot to demonstrate what you are referring to.

                    I look forward to your reply.
                    Emily C.NinjaTrader Customer Service

                    Comment


                      #11
                      thanks for the reply. i have it set to where there are a min of 20 bars for the strategy to read. so it doesn't pass the entry methods over. for some reason my strategies keep getting un-enabled. not all of them but just some of them. i'm not sure why.

                      i checked the trade log. and it wasn't synchronize. it was just entry. and, the signal names for the automated trades entries.
                      Attached Files

                      Comment


                        #12
                        Originally posted by SteveReiza View Post
                        thanks for the reply. i have it set to where there are a min of 20 bars for the strategy to read. so it doesn't pass the entry methods over. for some reason my strategies keep getting un-enabled. not all of them but just some of them. i'm not sure why.

                        i checked the trade log. and it wasn't synchronize. it was just entry. and, the signal names for the automated trades entries.
                        Adding a check for a minimum number of bars is a common practice and lines up with the following tip in the help guide:


                        Your strategy will check for those 20 bars from the beginning of the historical data on the chart, not from the moment it was enabled. So if you enable your strategy after there are more than 20 bars on the chart historically, that logic will not prevent any orders from happening. Adding Print() statements to your strategy and printing the value for CurrentBar will help to see how many bars are on the chart at the moment your strategy hits State.Realtime.

                        When a strategy is disabled, it will be logged on the Log tab of the Control Center. Also, if you have a NinjaScript Output window open (which you should if you are using TraceOrders and Prints) the strategy being disabled will also show in the output. If you are not manually disabling the strategy, it could be due to an error message. Please check for any errors if a strategy is unexpectedly disabled.

                        Thank you for your time and patience.
                        Emily C.NinjaTrader Customer Service

                        Comment


                          #13
                          thanks for the reply. i'll see if i can get the output window to supply some information. i see where i select "trace" orders. is there a way to put print in without unlocking the code. once i unlock the code i can't edit in the strategy builder.

                          Comment


                            #14
                            Originally posted by SteveReiza View Post
                            thanks for the reply. i'll see if i can get the output window to supply some information. i see where i select "trace" orders. is there a way to put print in without unlocking the code. once i unlock the code i can't edit in the strategy builder.
                            Hello SteveReiza,

                            Thank you for your reply.

                            You may add prints in the Strategy Builder so that you do not have to unlock the strategy. This information is mentioned under the header "Debugging in the Strategy Builder" on the following page, which also has a link to a video about adding prints in the Strategy Builder:


                            I am editing this post to add: based on your screenshot, it seems that you might be running multiple strategies on the same account and the same instrument. I removed your screenshot because although it did not contain your full account numbers, it did contain partial account numbers that you may want to keep private rather than posting publicly on the support forum. Unexpected behaviors can happen and sync issues can come up when running multiple strategies for the same account and instrument. You should run the strategies on separate accounts or consolidate strategy logic into one strategy if you plan to execute that logic on the same account and instrument. More info may be found here:


                            Please don't hesitate to reach out with any additional questions or concerns.
                            Last edited by NinjaTrader_Emily; 02-07-2024, 11:21 AM.
                            Emily C.NinjaTrader Customer Service

                            Comment


                              #15
                              thanks for the reply. sweet i'll check out the video. alright i'll see about making the strategies into sets in one strategy.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by geddyisodin, 04-25-2024, 05:20 AM
                              8 responses
                              61 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Started by jxs_xrj, 01-12-2020, 09:49 AM
                              4 responses
                              3,288 views
                              1 like
                              Last Post jgualdronc  
                              Started by Option Whisperer, Today, 09:55 AM
                              0 responses
                              5 views
                              0 likes
                              Last Post Option Whisperer  
                              Started by halgo_boulder, 04-20-2024, 08:44 AM
                              2 responses
                              22 views
                              0 likes
                              Last Post halgo_boulder  
                              Started by mishhh, 05-25-2010, 08:54 AM
                              19 responses
                              6,189 views
                              0 likes
                              Last Post rene69851  
                              Working...
                              X