Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'OnBarUpdate' method on bar on Chart with small resolution value

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

    Error on calling 'OnBarUpdate' method on bar on Chart with small resolution value

    Hi,

    The indicator generates an error like this " Error on calling 'OnBarUpdate' method on bar : Sequence contains no elements " when the Chart resolution is reduced. This does not apply to Time types of Chart. For example, Indicator works on 100Volume Chart, but doesn't on 50Volume Chart. Another example 25Range Chart works, if less then 25Range doesn't.
    Independent of Instruments.

    if (CurrentBars[0] < Nbar
    || CurrentBars[1] < Nbar || CurrentBars[0] < Nbar
    ) return;
    This is not a Solution.

    What could it be related to?​

    #2
    Hello zhiga,

    Thanks for your post.

    Please create a very simple reduced test script that is able to reproduce the behavior. Then, share the simple reduced test script with us along with the exact steps to reproduce the error so we may investigate this matter further.

    Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

    To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.​

    To export the reduced test script, go to Tools > Export > NinjaScript AddOn.

    We look forward to assisting further.
    <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


      #3
      Originally posted by NinjaTrader_BrandonH View Post
      Hello zhiga,

      Thanks for your post.

      Please create a very simple reduced test script that is able to reproduce the behavior. Then, share the simple reduced test script with us along with the exact steps to reproduce the error so we may investigate this matter further.

      Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

      To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.​

      To export the reduced test script, go to Tools > Export > NinjaScript AddOn.

      We look forward to assisting further.
      Hi Brandon,

      thank you for your answer. I resolved my issue. Error in code with writing to array.

      Regards,

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X