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

20 bar min requirement. prohibiting trade from occuring

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

    20 bar min requirement. prohibiting trade from occuring

    i had a strategy that executed like it was supposed to. but, then it didn't shortly after. i have current bar greater too or equal to 20. this requires 20 bars to assessed. does the order handling, order quantity per direction unique entries have a play as active to 20 bars after a trade because of this? or is that reset immediately after a trade flattens?

    #2
    Hello SteveReiza,

    Thanks for your post.

    Are you referring to the BarsRequiredToTrade property?

    The BarsRequiredToTrade property is set to 20 by default and this means that at least 20 historical bars would need to be populated on the chart window before the strategy starts placing a trade.

    See this help guide page for more information about BarsRequiredToTrade: https://ninjatrader.com/support/help...redtotrade.htm

    To clarify, are you seeing an error message occur when running the script? Is there an error message reported in the Log tab of the Control Center?

    If so, what exactly does the error message report so we may accurately assist? Please send a screenshot of the error.
    • To send a screenshot with Windows 10 or newer I would recommend using the Windows Snipping Tool.
    • Alternatively to send a screenshot press Alt + PRINT SCREEN to take a screenshot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save it as a jpeg file and send the file as an attachment.
    ​We look forward to assisting further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      thanks for the reply. i'm not drawing anything from the strategy - so, does that still pertain?

      nope i'm not getting an error message. but, i see what the problem is. i'm only get executions on the equal sign. i have if low [1] is greater or equal to than -3 ticks of bollinger line and low [1] is less than or equal to 5 ticks above bollinger line. then the next candle i have some stuff. but its been doing this. only entering when it equals that -3 or 5. not inbetween. any suggestions.

      Comment


        #4
        Hello SteveReiza,

        Thanks for your notes.

        The BarsRequiredToTrade property determines how many bars need to be populated on the chart window before the strategy places a trade. This does not pertain to drawing objects on a chart from a strategy.

        BarsRequiredToTrade help guide documentation: https://ninjatrader.com/support/help...redtotrade.htm

        If the strategy is not behaving as expected then it is necessary to add debugging prints to the strategy to understand how the logic is evaluating.

        In the strategy add prints (outside of any conditions) that print the values of every value 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).

        Also, enable TraceOrders which will let us know if any orders are being ignored and not being submitted when the condition to place the orders is evaluating as true.

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121​​
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          thanks for the reply. okay i'm tracking. appreciate the clarification!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jxs_xrj, 01-12-2020, 09:49 AM
          5 responses
          3,290 views
          1 like
          Last Post jgualdronc  
          Started by Touch-Ups, Today, 10:36 AM
          0 responses
          7 views
          0 likes
          Last Post Touch-Ups  
          Started by geddyisodin, 04-25-2024, 05:20 AM
          8 responses
          61 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Option Whisperer, Today, 09:55 AM
          0 responses
          8 views
          0 likes
          Last Post Option Whisperer  
          Started by halgo_boulder, 04-20-2024, 08:44 AM
          2 responses
          24 views
          0 likes
          Last Post halgo_boulder  
          Working...
          X