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

An order placed at '11-5-2021 06:07:32' has been ignored

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

    An order placed at '11-5-2021 06:07:32' has been ignored

    Hi all,

    I'm having an issues with a strategy. this is the error i keep getting. An order placed at '11-5-2021 06:07:32' has been ignored since the order was submitted before the strategy property BarsRequiredToTrade had been met.

    I have saw in an other post that this code could resolve the issue:


    if (CurrentBar < BarsRequiredToTrade) { return; }

    but i'm not quite sure how to edit the strategy with in the wizard and add this line fo code.

    Hope some one could give me some more clarity regarding this.

    Thanks in advance.

    #2
    Hello RemonH,

    Thank you for your post.

    This message is a warning that states that an order was ignored because the strategy tried to place a trade before there were enough bars loaded on the chart.

    You are correct, if (CurrentBar < BarsRequiredToTrade) { return; } would be used to avoid this warning message. That said, you would not be able to add this condition to your strategy using the Strategy Wizard. To incorporate this condition in your script, you would have to unlock the code of your strategy from the Strategy Wizard using the 'Unlock code' button.

    Make sure you have enough bars - https://ninjatrader.com/support/help...e%2Bsure%2Byou

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello RemonH,

      Thank you for your post.

      This message is a warning that states that an order was ignored because the strategy tried to place a trade before there were enough bars loaded on the chart.

      You are correct, if (CurrentBar < BarsRequiredToTrade) { return; } would be used to avoid this warning message. That said, you would not be able to add this condition to your strategy using the Strategy Wizard. To incorporate this condition in your script, you would have to unlock the code of your strategy from the Strategy Wizard using the 'Unlock code' button.

      Make sure you have enough bars - https://ninjatrader.com/support/help...e%2Bsure%2Byou

      Let us know if we may assist further.
      Hi Brandon,

      Thanks for your quick response. i was able to add this code (CurrentBar < BarsRequiredToTrade) { return; } and i don't get the errors anymore however the strategy don't place any trades. i only see the historical trades. so i'm not sure what else i should do.

      Comment


        #4
        Hello RemonH,

        Thank you for your note.

        If the expected trade(s) are not appearing, this would indicate that the condition to place the order is not evaluating as true or the order is being ignored for other reasons.

        To understand why the script is behaving as it is, such as placing orders or not placing orders when expected, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In the strategy add prints (outside of any conditions) that print the values of every variable used in every condition that places an order along with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        Below is a link to a forum post that demonstrates using prints to understand behavior and including a link to a video recorded using the Strategy Builder.
        https://ninjatrader.com/support/foru...121#post791121

        Please let me know if I may further assist
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          Hi Brandon,

          Thanks again for your help. the problem seems to occur when i set the strategy to on bar close. once i set it to on each tick then the strategy starts to process orders like it should, however this creates a lot of false/bad entries which will not work out well for my strategy. so i'm currently stuck on how to get my strategy to work with bar close instead of each tick.

          do you have any idea on what can cause this kind of problems?

          Thanks!

          Comment


            #6
            Hello RemonH,

            Thank you for your note.

            Please send us a reduced copy of your script so that we may accurately assist. A reduced script means that the script contains the minimum amount of code needed to demonstrate the issue. All other code is commented out or removed.

            Exporting - https://ninjatrader.com/support/help...tAsSourceFiles

            I look forward to assisting further.
            Brandon H.NinjaTrader Customer Service

            Comment


              #7
              Hello RemonH,
              I am facing same above issue, did you resolve it if yes can you please let me know how did you fix the issue?
              Thank you

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by RubenCazorla, Today, 09:07 AM
              2 responses
              11 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by i019945nj, 12-14-2023, 06:41 AM
              7 responses
              81 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by timmbbo, 07-05-2023, 10:21 PM
              4 responses
              158 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by tkaboris, Today, 08:01 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by Lumbeezl, 01-11-2022, 06:50 PM
              31 responses
              819 views
              1 like
              Last Post NinjaTrader_Adrian  
              Working...
              X