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