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 CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    24 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-25-2026, 09:53 PM
    0 responses
    30 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 03-25-2026, 09:51 PM
    0 responses
    18 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 03-23-2026, 11:13 AM
    0 responses
    27 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X