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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    165 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    86 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    128 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    207 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    185 views
    0 likes
    Last Post CarlTrading  
    Working...
    X