Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Simple question about BarsInProgress != 0

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

    Simple question about BarsInProgress != 0

    If you had a strategy that works only with the original price data series as Close[0], Close[1]...etc, is it really necessary this statement generated by the Strategy Builder?

    Code:
    if (BarsInProgress != 0)
                    return;​


    Obviously, this means: discarding any update different than the original data series 0.

    Thanks


    #2
    Hello pstrusi,

    Thanks for your post.

    This line of code is automatically generated by the Strategy Builder when creating a Strategy Builder strategy.

    This section of code is preventing OnBarUpdate() from running in other series in case additional secondary data series are added to the Strategy Builder strategy.​

    If you are unlocking the script from the Strategy Builder to manually program your script then you could remove this section of code from the strategy.

    BarsInProgress: https://ninjatrader.com/support/help...inprogress.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    97 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    51 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    24 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    35 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    37 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X