Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to disable BarsRequiredToTrade validation completely?

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

    How to disable BarsRequiredToTrade validation completely?

    Hi,

    I have a multi-series strategy that should be able to open a position regardless of the primary Bars' currentbar status. For example I may be using a 1 Minute series for the primary bars and a smaller period for the second series bars. And I need the strategy to open a position before even the 1 minute (primary Bar) has finished generating its first bar. My strategy does not load any historical data. Its logic runs with a fresh set of bars every trading day.
    I have tried setting the primary BarsRequiredToTrade to -1 or even deleting the line from the code, but it always makes this validation and therefore ignores any trades that happen before the first bar of the primary series.

    Is there any way to disable this validation completely?

    Thanks,
    Alex

    #2
    Hello Alex,

    This cannot be disabled, but you can set BarsRequiredToTrade to 0.

    If this is changed in State.SetDefaults instead of State.Configure, you will need to remove the instance of the strategy and add a new instance so the new defaults are pulled for the new instance.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    29 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    46 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    38 views
    0 likes
    Last Post CarlTrading  
    Working...
    X