Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Brandon H.NinjaTrader Customer Service

    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 reynoldsn, Today, 02:34 PM
      0 responses
      6 views
      0 likes
      Last Post reynoldsn  
      Started by nightstalker, Today, 02:05 PM
      0 responses
      9 views
      0 likes
      Last Post nightstalker  
      Started by llanqui, Yesterday, 09:59 AM
      8 responses
      28 views
      0 likes
      Last Post llanqui
      by llanqui
       
      Started by quicksandatl, Today, 01:39 PM
      1 response
      6 views
      0 likes
      Last Post quicksandatl  
      Started by md4866, 05-01-2024, 08:15 PM
      2 responses
      18 views
      0 likes
      Last Post md4866
      by md4866
       
      Working...
      X